Trunk Disconnects Until Outbound Call is Made

I really need to get this resolved. This production system has been deployed since October of last year, and this issue has persisted since then; even through an in-place upgrade from FreePBX 14 - Asterisk 13 to FreePBX 15 - Asterisk 16. This system is at a doctor’s office, with 20 Sangoma phones (s705’s and s405’s, and around 3 Cisco SPA112 ATAs for fax on some copiers).

Basically here are the symptoms. Randomly, but usually after a couple days of low activity (like over the weekend), I believe the system is losing its trunk registration. If I try and call their primary (trunk) number from my cell, I will get a Verizon wireless message like the number doesn’t exist. Typically if I just place an outbound call from any desk phone or even a soft phone app, the system will immediately begin working as expected.
This issue happens any time they lose their cable internet connection for a few minutes, but also happens sometimes when there’s just been little to no activity on the system (like over the weekend).
I would be glad to provide any additional information that may help in troubleshooting this issue.

Here are some details that may prove helpful. Their SIP trunk provider is Momentum
This is only because of the relationship with the local internet provider. Back when they were on an old NEC PBX, they received their phone service from the local internet provider through an Adtran. The local internet provider uses Momentum as their SIP trunk provider, so in order to keep everything under one bill (Literally electric, cable internet, phone, water, sever, and trash pickup), I stuck with Momentum. I have them configured as a PJSIP trunk directly in FreePBX.

Here are some of the settings…anything not listed is likely default.

Authentication: Outbound
Registration: Send
Context: from-pstn
DTMF Mode: Auto
Trust RPID/PAI: Yes
Send RPID/PAI: Send P-Asserted-Identity header

Because it’s using outbound authentication, I do not have any ports manually opened on the firewall. In other words, there’s no inbound NAT port forwarding of UDP 5060 to the FreePBX server. But again, if the registration is outbound, I wouldn’t think it would be necessary to open this port to the world. And, again, keep in mind this system has been in production since October of last year, and except for a Asterisk bug that caused issues with their Sangoma phones locking up, this is the only other major issue they’ve faced.

Any help would be greatly appreciated.



If Verizon doesn’t thinks that number exists then only Momentum can fix that problem.

Thanks for your reply! If I’m able to resolve the issue by simply making an outbound call from a desk or soft phone, would that still lend the issue to being Momentum vs FreePBX? There is a direct correlation to the trunk not re-registering after even a brief internet outage. And, there is a similar correlation to when there has been no activity (inbound or outbound calls) on the system for a period of time. I apologize if registering may not be the correct term. I’ve yet to learn how to read the Asterisk logs to be 100% sure that’s what is happening, but based on my limited understanding, that’s what it seems to be.

On a lower level, if you have paid for a phonenumber (DID) from any VSP, it should always be extant until you stop paying for it, even if your PBX disappears from the internet. That existence would be perpetrated by your VSP. Verizon ( quite well known) should get back an unavailable SIP response if you are not there. sngrep is always a good tool for the 10000 foot overview

It is not uncommon for a carrier to play a “number is not in service” or “number has been disconnected” when there is no response to an INVITE. That, per se, is not Momentum’s fault. However, a decent provider has a way to handle calls when the customer’s equipment is down or otherwise inaccessible.

Usually, there are settings on the portal that will direct such calls to a mobile phone or other external number, or play an announcement or perhaps take a voicemail. Possibly, Momentum has this feature but it was never set up, or it was set up and not working properly.

Back to the original problem, do you have settings to keep the NAT association alive e.g. Expiration = 120, Qualify Frequency = 60?

Is there any indication by Asterisk that the NAT association was lost (does “unreachable” appear in the Asterisk log)?

Is there any indication on the Momentum side that registration was lost (do they show registration status on their portal)?

What is the value of SIP Server? If this is a domain name (rather than an IP address), is it resolved with SRV records or A records? If multiple records, are all the servers up at the time of outage?

If all of the above looks good, I suspect a router/firewall issue. Make/model? Any special settings for VoIP? Does it get a public IP address on its WAN interface? If not, why (modem is configured as a gateway, ISP is doing NAT, etc.)?

@Stewart1, thank you for the detailed response! I’ve been super busy the last couple days and just now able to respond. Here are the answers to your questions:

  1. Right now my Expiration = 3600 and my Qualify Frequency = 60. Are those settings fine, or should they be adjusted? I believe these are just the defaults.
  2. I haven’t had time to dig through the Asterisk log yet, but when this happens again, I will look for “unreachable”
  3. I will need to reach out the local ISP about Momentum (the SIP trunk provider), as they don’t provide me a portal login.
  4. My AOR is using the IP address of Momentum. My Client URI includes the domain after the @.
  5. I have a Windows domain network, so FreePBX is using by primary and secondary domain controllers for DNS.
  6. I’m using a Ubiquiti EdgeRouter 4 (one of their newer models) running the latest firmware. I have some queue stuff enabled on the EdgeRouter. There are three different ways to accomplish this (Smart Queue, Basic Queue, and Advanced Queue); I believe I’m currently using the Basic Queue option. I’m not saying that’s the best method; just what I’m currently using. I do have a public static IP on the WAN interface.
    I hope these answers help. Any feedback or suggestions would be greatly appreciated.



Two things are easy to try that might fix the problem:

Set Expiration to 120. This should keep the NAT association open if for some reason the Qualify isn’t doing so. Or, bring it back to life quickly if it was lost.

Next, try disabling SIP ALG in the router. Without ALG, you will need to have the RTP ports (UDP 10000-20000 by default) forwarded to the PBX. Also, in Asterisk SIP Settings, Local Networks and External Address must be correctly set.

If no luck, we need to find out what is going wrong. Capturing SIP packets on both the PBX and the router’s WAN interface will show whether REGISTER requests are being sent and being passed properly by the router. And, whether the responses are being received and correctly passed to the PBX. It’s conceivable that registration is fine but incoming calls are still interrupted, so if there is no problem with registration, call in and see what (if anything) gets captured.

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