Unable to verify endpoint

I am having a weird issue. Upstream provider is flowroute and everything is usually working fine. However - from time to time asterisk loses the endpoint to flowroute, but pjsip shows it to be available with varying RTTs. flowroute however doesn’t show any active SIP registrations and incoming calls fail. Restarting asterisk resolves the issue. I haven’t found anything that would allow me to reliably verify that the endpoint is indeed connected and available. Any suggestions as to tracing the problem or to reliably determine the status of the registration ?

Hello @mischmerz - This sounds like a Flowroute issue from what you are reporting. The reason is if Asterisk is showing the trunk is up, then this means Flow is responding to OPTIONS. It also means Asterisk thinks its still registered, and there is no need to register again yet.

The way registration works is your PBX will register to flow, and flow will give it an expiry time. Probably something like 1800 to 3600 seconds (30-60mins). The PBX will then register again typically when 50% or so of the time elapses. This means if flow says 3600 then we will register every 30mins.

So this means Flow may have dropped the registration and has no record of our registration, but on our side we think we have another 15-45 minutes to re-register. This fits the description the best, but of course debugging is needed to see what is really occurring here.

To debug this simply do the following.

  1. Start a pcap either using the command “tcpdump -i any -s 0 -w sip-trace.pcap port 5060”. Don’t use system admin, since we nee this capture to run for a while. If you are familiar with the screen command it may be best to run the command there to keep the capture running.

  2. Verify the link is working great by placing an inbound call. Verify 2 way audio and keep the call up at least 40 seconds to verify there is no SIP issues.

  3. Wait until the issue occurs.

  4. Once the issue occurs note down the time and stop the trace.

You can then DM the trace over to me and I can take a look through it there to see what is occurring. Please include the following.

  1. Flow’s IP or FQDN.
  2. Number of trunks to flow. As I’ve seen some cases where flow requires multiple trunks.
  3. Time you noticed inbound calls stopped working.
  4. Wait another 60 minutes (if possible) and see if the link comes up on its own.

What I’ll be looking at here is to see if FreePBX re-registered when it should have. The signalling will indicate exactly where the PBX is in the registration cycle at the time of the event.

Let me know.

Hello Marc - thank you for the response. Flow’s customer support actually suggested to disable retry_interval because the Flowroute network does not support SIP Options (that’s what they said .. ?) For the time being, I switched the registration to transport-tcp because the NAT binding for tcp is longer. They are not much help - don’t even have a default config for pjsip. If this doesn’t work, I’ll proceed as you suggested. Thanks again.

Michaela

IMO if you don’t have a good reason for using registration with Flowroute, switch to IP auth.

If you need registration (dynamic IP, behind CGNAT, no admin control of router, etc.), set Expiration to e.g., 120 seconds, to avoid most timeouts and regain registration quickly if it is lost anyway.

BTW, I have no problem with OPTIONS on Flowroute:

6698	[2025-04-04 01:23:24] VERBOSE[19317] res_pjsip_logger.c: <--- Transmitting SIP request (466 bytes) to UDP:34.210.91.112:5060 --->	
6699	OPTIONS sip:us-west-or.sip.flowroute.com:5060 SIP/2.0	
6700	Via: SIP/2.0/UDP xx.xx.xx.xx:xxx;rport;branch=z9hG4bKPj27adfbb3-7996-4ab4-8079-cfd661bcdfae	
6701	From: <sip:[email protected]>;tag=ccae754a-fcc9-4b43-8988-1cc2e031b5a1	
6702	To: <sip:us-west-or.sip.flowroute.com>	
6703	Contact: <sip:[email protected]:xxx>	
6704	Call-ID: 75f8b4cb-9009-4235-b092-d132b0c6a8d5	
6705	CSeq: 55489 OPTIONS	
6706	Max-Forwards: 70	
6707	User-Agent: FPBX-16.0.40.11(18.20.2)	
6708	Content-Length: 0	
6709		
6710		
6711	[2025-04-04 01:23:24] VERBOSE[25296] res_pjsip_logger.c: <--- Received SIP response (469 bytes) from UDP:34.210.91.112:5060 --->	
6712	SIP/2.0 200 OK	
6713	Via: SIP/2.0/UDP xx.xx.xx.xx:xxx;rport=xxx;branch=z9hG4bKPj27adfbb3-7996-4ab4-8079-cfd661bcdfae;received=xx.xx.xx.xx	
6714	From: <sip:[email protected]>;tag=ccae754a-fcc9-4b43-8988-1cc2e031b5a1	
6715	To: <sip:us-west-or.sip.flowroute.com>;tag=bf8638324618dc61059d4c604476fea1.49022598	
6716	Call-ID: 75f8b4cb-9009-4235-b092-d132b0c6a8d5	
6717	CSeq: 55489 OPTIONS	
6718	Accept: */*	
6719	Accept-Encoding:	
6720	Accept-Language: en	
6721	Supported: timer	
6722	Content-Length: 0