Issue - Number not In Service - Call Back - Call flows through

Hi Guys,

This is a very premature message and I plan to have logs tomorrow when I can reduplicate the issue.
When I try to call my DID from a Cell, I sometimes get “The number is not in service, etc”.

If I call immediately back, it flows through to the IVR properly. (Or if I make an Outbound call on my SIP).

Seems like it fails once, then it reestablishes a connection and it’s good to go.

I know this can be a variety of issues however Im hoping someone has a few suggestions to inspect.

I am using PFSense, Ports are Opened as required, DHCP to FreePBX with a DHCP Reservation in place. Incoming/Outgoing have no issues once something gets re-established (Seems that from earlier testing everything is fine when the Asterisk log stays “Setting global variable ‘SIPDOMAIN’ to ‘10.10.10.14’” which is my FreePBX IP.

Hopefully someone has some suggestions until I can post some logs.

FreePBX 14.0.5.2 - Running Fully up to date.

We’ve heard reports of this from time to time. The typical cause is that your PBX connection to your ITSP is “falling asleep”. This can be because you aren’t polling the provider often enough, or that your firewall isn’t configured to meet the needs of your PBX. The incoming call “wakes” the connection up and it stays up until it times out again.

There are many threads here that talk about this. The solution is usually a combination of changing the keep-alive duration on the trunk settings and adjusting your timeouts on the firewall/router. The router setting is (IIRC) the one ITSPs prefer, since it doesn’t increase the workload on the SIP connection.

Another thing to look through the logs for is a message about missing critical packets. This is often a symptom of a similar problem and is always a firewall/router config problem.

Hey Dave,

Thanks for replying back. This makes sense. I am quite new with FreePBX. In regards to the IIRC setting I should be inspecting for, is this on the FreePBX Firewall or PFSense? (Sorry for the silly question).

I’ll keep digging on the forums as well but any insights are appreciated.
Thanks

You can set the qualify parameter so the connection stays open.

Is your FreePBX behind a NAT device?

1 Like

Yes it is. I’ve worked with Flowroute and we’re trying Inbound Routes (PoPs) vs SIP Registration to see if this helps.
Running into new issues though.

Can anyone advise why the following happens - especially when I have the IP range Whitelisted under Intruder Detection and in the Firewall under Trusted Networks?

Log Below:
– Executing [DIDNUMBER@from-sip-external:1] NoOp(“SIP/fl.gg-00000071”, “Received incoming SIP connection from unknown peer to DIDNUMBERHERE”) in new stack
– Executing [DIDNUMBER@from-sip-external:2] Set(“SIP/fl.gg-00000071”, “DID=DIDNUMBERHERE”) in new stack
– Executing [DIDNUMBER@from-sip-external:3] Goto(“SIP/fl.gg-00000071”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [s@from-sip-external:1] GotoIf(“SIP/fl.gg-00000071”, “1?setlanguage:checkanon”) in new stack
– Goto (from-sip-external,s,2)
– Executing [s@from-sip-external:2] Set(“SIP/fl.gg-00000071”, “CHANNEL(language)=en”) in new stack
– Executing [s@from-sip-external:3] GotoIf(“SIP/fl.gg-00000071”, “1?noanonymous”) in new stack
– Goto (from-sip-external,s,5)
– Executing [s@from-sip-external:5] Set(“SIP/fl.gg-00000071”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2018-12-19 13:02:04.532 EST.
– Executing [s@from-sip-external:6] Log(“SIP/fl.gg-00000071”, “WARNING,“Rejecting unknown SIP connection from IPOFSIPHERE””) in new stack
[2018-12-19 13:01:49] WARNING[25832][C-00000057]: Ext. s:6 @ from-sip-external: “Rejecting unknown SIP connection from IPOFSIPHERE”
– Executing [s@from-sip-external:7] Answer(“SIP/fl.gg-00000071”, “”) in new stack
– Executing [s@from-sip-external:8] Wait(“SIP/fl.gg-00000071”, “2”) in new stack
– Executing [s@from-sip-external:9] Playback(“SIP/fl.gg-00000071”, “ss-noservice”) in new stack
– <SIP/fl.gg-00000071> Playing ‘ss-noservice.ulaw’ (language ‘en’)
– Executing [h@from-sip-external:1] Hangup(“SIP/fl.gg-00000071”, “”) in new stack
== Spawn extension (from-sip-external, h, 1) exited non-zero on ‘SIP/fl.gg-00000071’

Trunk Info:

type=friend
secret=ITSASECRET
username=CANTTELLYOU
host=us-east-va.sip.flowroute.com&us-east-nj.sip.flowroute.com
dtmfmode=rfc2833
context=from-trunk
canreinvite=no
allow=ulaw
insecure=port,invite
fromdomain=us-east-va.sip.flowroute.com&us-east-nj.sip.flowroute.com

Ive tried
type=peer
insecure=invite

It was initially just US-EAST-VA for both the from and host but I put both as the IP being rejected is coming from the NJ Sip. Im stumped.

You can’t do that. You need to set up two trunks, one with each address.

If these are actually server clusters, you will need to use PJ-SIP and set up the address range in the SIP Configuration.

Thanks Dave.
I’ve created a second SIP Trunk and fixed up those tags.

Flowroute recommends Whitelisting 34.226.36.32/28 as an example.
So you are indicating I should change this to PJSip?

Edit - I tried calling myself 4 times - everytime worked (did not answer), 5th time caused the Rejecting unknown SIP again). :-/ (Try calling my other DID - fails on the first attempt - sometimes works on the 2nd).

As we suspected, you need to convert this to a PJ-SIP interface. Go to the Wiki (or look back through the Forum) and see how to set up FlowRoute using a range of IP addresses. The method you are using now (using Chan-SIP) isn’t going to work unless you are willing to set up dozens of almost identical inbound trunks (one per IP address).

Whitelist the addresses in the firewall and add them to the PJ-SIP configuration and you should be closer.

Hi Dave,

I want to thank you again for your excellent assistance.
By using the following link:

I’ve been able to set this up. Incoming calls are now flowing properly and I’ve attempted to call myself 7 times and everytime it’s gone through.

The final test will be to see delayed inactivity. I’ll reply back to this thread if I come across any form of Not in Service again however I think this whole issue may have been related all together.

Thanks again!

Update 12/20/18 - All is working well since I completed the Tutorial included. No longer experiencing any issues with Number not in Service or the FreePBX causing registration hiccups.

Fyi for anyone with Flowroute! :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.