Remote extension becomes Unavailable

I have lots of remote extensions, they all work fine, except for one odd ball.
This one device is remote, uses SIP over UDP, and it’s on a poor network.
I cannot fix those things as they are out of my control. I also cannot remotely administer this one device. I have to drive there to make changes. Before you say just get a better phone/network, I can’t in this case.

Here’s the problem. The phone works, but it goes “Unavaliable” every few minutes, then comes back to Available. I would like to just change a timer setting to relax this. I need the warnings to go away because they are triggering alerts (50 times a day).

I will be making a trip tomorrow night to that site.
Can someone suggest which setting/timer I should change in SIP Settings?

Also, the device is a Snom M3 handset, and I use PJSIP on FreePBX 16.
Thanks in advance.

Who is the ISP? Router/firewall make/model?

We can probably fix that. Is the problem administrative, e.g., the manager there won’t allow remote access? Or is it technical (router is behind CGNAT or 464xlat)?

If you’d like to try something blind, add this to /etc/asterisk/pjsip_custom_post.conf and reload Asterisk:

[1234](+type=aor)
qualify_timeout=16

(replace 1234 with the extension number of the Snom)

If no luck, the next step is to find out what is going wrong. To start, post entries in the Asterisk log showing the device becoming unreachable and reachable again (all entries related to this device in that interval). If the trouble also occurs outside of business hours when the system is idle or nearly so, it may be easiest to just post, e.g., 50 lines from the log.

Stewart, thanks for the ideas.
I tested your qualify_timeout, but the extension still went offline.

The problem is that it is on a Guest WIFI network in a medical facility. I don’t have access to the hardware, for admin reasons. The ISP is Comcast, the access points are Ubuiquity, but all that are not the problem, they are fine.

This is not my facility, so the situation is odd. I have to work in their restrictions.
I CAN access the SIP settings on the phone, but I have to drive there with a laptop. I am doing that tomorrow night.

Here is the log summary you asked for.

[2024-02-22 09:35:39] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 09:38:40] VERBOSE[16597] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 09:38:40] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 50.802 msec
[2024-02-22 09:55:43] VERBOSE[9001] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 10:04:00] VERBOSE[5964] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 10:07:08] VERBOSE[7344] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 10:07:08] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 51.375 msec
[2024-02-22 10:27:11] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 10:32:39] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 10:32:39] VERBOSE[9001] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 10:35:53] VERBOSE[13093] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 10:35:53] VERBOSE[16597] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 41.949 msec
[2024-02-22 11:56:56] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 12:02:10] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 12:02:10] VERBOSE[16597] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 12:05:30] VERBOSE[13093] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 12:05:30] VERBOSE[9001] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 99.622 msec
[2024-02-22 12:40:33] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 12:46:10] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 12:46:10] VERBOSE[27277] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 12:49:30] VERBOSE[5964] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 12:49:30] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 45.521 msec
[2024-02-22 13:31:33] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 13:40:11] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 13:40:11] VERBOSE[27277] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 13:43:28] VERBOSE[6127] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 13:43:28] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 50.036 msec
[2024-02-22 14:49:31] VERBOSE[16597] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 14:54:41] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 14:54:41] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 14:57:59] VERBOSE[5072] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 14:57:59] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 71.067 msec
[2024-02-22 15:42:02] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 15:48:34] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 15:51:56] VERBOSE[27277] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 15:51:57] VERBOSE[9001] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 55.050 msec
[2024-02-22 16:59:59] VERBOSE[27277] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 17:08:13] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 17:08:13] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 17:11:38] VERBOSE[6127] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 17:11:38] VERBOSE[5964] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 31.700 msec
[2024-02-22 17:31:41] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 17:36:43] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 17:36:43] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 17:40:02] VERBOSE[5964] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 17:40:03] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 38.121 msec
[2024-02-22 17:42:05] VERBOSE[6127] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 17:50:06] VERBOSE[5964] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 17:53:25] VERBOSE[7344] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 17:53:25] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 47.059 msec
[2024-02-22 18:52:28] VERBOSE[5072] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 18:59:43] VERBOSE[13093] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 19:02:44] VERBOSE[9001] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 19:02:44] VERBOSE[27277] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 41.951 msec
[2024-02-22 19:07:47] VERBOSE[7344] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 19:12:44] VERBOSE[31217] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 19:12:44] VERBOSE[6127] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 19:16:08] VERBOSE[16597] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 19:16:08] VERBOSE[9001] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 29.930 msec
[2024-02-22 20:15:21] VERBOSE[3890] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[2024-02-22 20:22:19] VERBOSE[3916] res_pjsip_registrar.c: Removed contact 'sip:270@[redacted]:5060;line=19409' from AOR '270' due to expiration
[2024-02-22 20:22:19] VERBOSE[11210] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 has been deleted
[2024-02-22 20:25:30] VERBOSE[3890] res_pjsip_registrar.c: Added contact 'sip:270@[redacted]:5060;line=19409' to AOR '270' with expiration of 600 seconds
[2024-02-22 20:25:30] VERBOSE[3890] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Reachable.  RTT: 35.935 msec
[2024-02-22 20:55:46] VERBOSE[3890] res_pjsip/pjsip_options.c: Contact 270/sip:270@[redacted]:5060;line=19409 is now Unreachable.  RTT: 0.000 msec
[root@voip asterisk]#

I know nothing about the M3 and was unable to find a complete admin guide online. I did find one for the M9 and assuming it’s similar, it appears that some settings, such as NAT keepalive (we want the CRLF option, not STUN) are provisionable but accessible from the web interface. Is that also true for the M3?

Possibly, changing the registration expiry from 600 seconds to 120 will help. If not, it should at least reduce the length of the unavailable intervals.

If a STUN server is set, setting it blank might help.

If no luck, do you have a way to capture traffic at the phone, so we can how the phone and/or network is misbehaving? Is switching from UDP to TCP or TLS an option?

From the Asterisk command prompt, please post the output of
pjsip show aor 270

Looks like the M3 doesn’t do TCP or TLS, at least I couldn’t get it to.

This morning I changed Qualify Frequency from 60 to 30.
It’s been stable for a couple of hours now.

Any thoughts about that?

We don’t have STUN setup.

      Aor:  <Aor..............................................>  <MaxContact>
    Contact:  <Aor/ContactUri............................> <Hash....> <Status> <RTT(ms)..>
==========================================================================================

      Aor:  270                                                  1
    Contact:  270/sip:270@[redacted]:5060;line=19409     aff309c610 Avail        42.106


 ParameterName        : ParameterValue
 ===========================================================
 authenticate_qualify : false
 contact              : sip:270@[redacted]:5060;line=19409
 default_expiration   : 3600
 mailboxes            :
 max_contacts         : 1
 maximum_expiration   : 7200
 minimum_expiration   : 60
 outbound_proxy       :
 qualify_frequency    : 30
 qualify_timeout      : 3.000000
 remove_existing      : true
 remove_unavailable   : false
 support_path         : false
 voicemail_extension  :


I have an almost identical issue with a Grandstream HT802 running on wifi in a nursing home. I ended up having to set the ATA to send an Options request to the host every 10 seconds. I also set the minimum expiration to 90 seconds and maximum expiration to 180. It appears that the NAT port lasts less than 15 seconds so I keep it alive with the frequent Options request at each end.

While not perfect because the wifi is also poor, the unit unregisters and reregisters frequently but continues to work. I would like to VPN to the PBX but the Grandstream HT802 will not properly run an OpenVPN connection.

Well, I originally thought I couldn’t change the device, I worked that problem out.
I changed the unit with a desk phone.

Now it supports TLS and everything just works.

Thanks everyone for your advice, I did put these ideas in my notes to learn from.

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