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 ‘’” which is my FreePBX IP.

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

FreePBX - 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.

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 [[email protected]:1] NoOp(“SIP/”, “Received incoming SIP connection from unknown peer to DIDNUMBERHERE”) in new stack
– Executing [[email protected]:2] Set(“SIP/”, “DID=DIDNUMBERHERE”) in new stack
– Executing [[email protected]:3] Goto(“SIP/”, “s,1”) in new stack
– Goto (from-sip-external,s,1)
– Executing [[email protected]:1] GotoIf(“SIP/”, “1?setlanguage:checkanon”) in new stack
– Goto (from-sip-external,s,2)
– Executing [[email protected]:2] Set(“SIP/”, “CHANNEL(language)=en”) in new stack
– Executing [[email protected]:3] GotoIf(“SIP/”, “1?noanonymous”) in new stack
– Goto (from-sip-external,s,5)
– Executing [[email protected]:5] Set(“SIP/”, “TIMEOUT(absolute)=15”) in new stack
– Channel will hangup at 2018-12-19 13:02:04.532 EST.
– Executing [[email protected]:6] Log(“SIP/”, “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 [[email protected]:7] Answer(“SIP/”, “”) in new stack
– Executing [[email protected]:8] Wait(“SIP/”, “2”) in new stack
– Executing [[email protected]:9] Playback(“SIP/”, “ss-noservice”) in new stack
– <SIP/> Playing ‘ss-noservice.ulaw’ (language ‘en’)
– Executing [[email protected]:1] Hangup(“SIP/”, “”) in new stack
== Spawn extension (from-sip-external, h, 1) exited non-zero on ‘SIP/’

Trunk Info:


Ive tried

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 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.