Manually set SIP qualify frequency for the FreePBX server

We are having issues with handsets dropping registration. We have identified some SIP registration settings that have helped but I need information on how to modify the SIP qualify frequency on the server side.

There is nothing in sip.conf or sip_general_custom.conf that references qualifying. By looking at the full log I see that the server is defaulting to 2000 ms. The handsets are using 60 seconds. I would like to extend the servers expectation from 20 to something like 60-90. I cannot find the settings to place in a custom conf file to adjust this setting.

I am assuming it would go in the sip_general_custom.conf file. Would it be in the form of qualify=yes or qualify=60 or qualify=6000 or qualifyfreq=6000? Or am I completely off base here?

The system is unstable and we are trying to get it to settle down so we can start the install process of a new FreePBX 16 system. The current system is:
PBX Version:
13.0.197.31
Asterisk Version:
13.28.0

I do not see anywhere in the Web GUI to adjust this setting either.

FreePBX is a SIP client when it is using qualify.

There is no expectation of a qualify frequency. As a client the frequency is whatever it is set to. As a server (unlikely here), it does not check for qualifies, but simply responds to them.

What it does expect is a sufficiently low round trip time, which is what the qualify option sets. Even 2 seconds is unreasonably high as most people would consider calls unusable above about 500ms, and objectionable at about 100ms. 2.51s would be the Apollo Moon communications round trip time.

qualifyfreq is the frequency (in seconds in the configuration). Asterisk itself doesn’t care about this but many people use qualify to keep dynamic rules open in routers, and and an excessive value is likely to cause routers to break the “connection”.

qualify is the maximum acceptable round trip time in milliseconds. yes sets the default, which I’d probably have to check in the code.

Both your Asterisk and FreePBX are end of life. chan_sip is also, effectively, end of life.

I think the variable has a different name for pjsip. For chan_sip it appears in etc/asterisk/sip_aditional.conf

qualify=yes
qualifyfreq=60

Thanks for the explanation. Information on the web concerning SIP registration and SIP qualify or qualify timers can be a bit confusing if not a little contradictory.

As I mention we are trying to stabilize this system in order to carve out enough time to build a new one based on FreePBX 16 and Asterisk 18 and migrate extensions to PJ_SIP.

With this system trying to die on us and the limited resources it is hard to breathe life into a new server while trying to resuscitate the old one.

I missed that conf file somehow–trying to do a dozen things at once possibly–thanks for this input. I will check it out.

As mentioned by David, there are two different timers. The qualify frequency is how often the phone is forced to re-register, which sounds like it might be your issue if you have port timers in your router.

The 2 second timer is how long the server tries to reach the phone before giving up on it.

We are having a little of both issues and it seems like the server is lagging in response time in general. We have jiggered SIP registration settings so that those have settled down. But the server is looking for a qualify response with 2000 ms as the base and the phones seem to have 60 secs/6000 ms as their metric. I want to set the server expectation to 60 or 90 to take a load off of that side of the SIP communications. The server is trying to die anyway and we keep putting bandaids wherever we see bleeding.

In sip_additional.conf I see the extension specific settings including qualify= and qualifyfreq= but not for the PBX and chan_sip. Could this go in sip_general_custom.conf possibly? It already has sections to config TCP and TLS on the server as a whole.

Register involves a different set of timers again. The qualify ones are the interval between qualify tests and the maximum time to get a response.

Anything named sip-*.conf is for chan_sip.

However, for chan_sip extensions, you should be using the GUI:

https://wiki.freepbx.org/display/FPG/Extensions+Module+-+SIP+Extension#ExtensionsModule-SIPExtension-AddExtension#ExtensionsModule-SIPExtension-Qualify

I did not set this system up. So I am never quite sure what I am going to find, where and why. We use the Extension and EPM modules to configure extensions. And both sip_additional.conf and sip_general_additional.conf have the banner at top saying this is a system generated file do not edit directly warning.

The only sip custom conf file with any data in it is the sip_general_custom.conf file. All the others are 0 byte files. That is why I asked expressly about it as the place to put the qualify settings.

If anyone can’t tell already, I am not that comfortable with working in conf files. I just embraced using fwconsole in place of the GUI for some critical modifications the last year or so.

Thanks everyone for the quick response to my issue and the help so far.

You shouldn’t need to modify files. This should be doable from the GUI.

Also, I’d be very surprised if the qualify settings on the HT need to match chose on Asterisk, and they may not really be needed at all. Asterisk will not check that it is receiving their OPTIONs, so won’t care about the interval they use, and only they can see the full round trip, so Asterisk will have no idea if that limit is being exceeded.

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