"Number not in service"?

I am getting intermittant “number not in service” from my SP.

Restarting Asterisk restores service.

Doing nothing will result in service being restored at some random time.

I have found several posts with vague references to “performing network tests”, “firewall state times”, I cannot find any documentation on firewall requirements beyond the basics (port 5060, 10000-25000 all udp).

I am working on getting a tcpdump during a failure–I had an opportunity, today, but I literally started tcpdump, dialed, and everything magically worked (so I couldn’t capture the failure).

In the meantime can someone clue me in on network planning? I know how to setup my PBX, NAT, local firewall, edge-server firewall. Is there any documentation? Is there something to this “firewall state timing” I read about in documentation?

I used to find the Documents easy to search and use but several years ago something changed and now it seems difficult to find even simple references. If I’m missing something I would sincerely appreciate a pointer.


Does your carrier return the message “number not in service” as early media or after the call has been established? In either case, it doesn’t seem like there’s much we can do, as this appears to be an issue on the carrier side, possibly related to routing problems.

I suspect they forgot to tell you that it is the non-Asterisk caller that is getting the message. This sounds like a NAT/firewall rule timeout.

OP please say who is receiving the message and whether outbound calls are working.

I think you nailed-it.

I am connected to another Asterisk PBX where this issue never arises.

The “number not in service” message only occurs when there’s a POTS call → SP → my Asterisk PBX. So, exactly as you postulated–non-Asterisk caller is receiving this message “number not in service.”

This is why I was asking about things like firewall states. I have a fairly good understanding of firewalls but my understanding of state-changes is strictly conceptual.

I would really appreciate anything you can share that might help. Thank you very much!

Edit: Outbound calls from my Asterisk PBX work.

In this case, it seems like the INVITE is never reaching Asterisk. It would make sense if this were a firewall issue

I suspect it is a firewall issue.

I have my firewall set up for 5060/udp and 10000-25000/udp.

Is there a firewall sticky or howto that covers addressing NAT state timeout specifically for Asterisk?