Upgrade 3CX to v18 and get it hosted free!

Asterisk sip qualify

Author image

SIP.conf: device configuration – qualify

Syntax: qualify=xxx|no|yes
where XXX is the number of milliseconds used. If yes the default timeout is used 2 seconds.

If you turn on qualify in the configuration of a SIP device in Asterisk config sip.conf, Asterisk will send a SIP method options command regularly to check that the device is still online. If the device does not answer within the configured (or default) period (in ms) Asterisk considers the device off-line for future calls. This status can be checked by the SIPPEER function, and inversely this function will only provide status information for peers which have qualify=yes.

This feature may also be used to keep a UDP session open to a device that is located behind a network address translator (NAT). By sending the OPTIONS request, the UDP port binding in the NAT (on the outside address of the NAT/firewall device) is maintained by sending traffic through it. If the binding were to expire, there would be no way for Asterisk to initiate a call to the SIP device. This can be used in conjunction with the nat=yes setting.

By default chan_sip.c sends the qualify every 60 seconds. At least in 1.6.0 you can change this value with qualifyfreq. The value in qualify = represents the timeout after a packet is sent before we consider the peer to be unreachable. If the packet is not responded within 1 second, asterisk will keep trying until 7 packets have failed. At this point, asterisk won’t try again until the next 60 cycle period completes. If a packet is lost, which can easily happen with UDP, there are 7 more packets that are transmitted. Additionally, asterisk will keep trying every 60 seconds. So even if all 7 packets are lost, asterisk tries again at the next 60-second cycle. The number of retransmits and time between each qualify is defined in chan_sip.c,

2008-08-27 – In v1.4 (SVN only) “qualify=yes” is ignored if the peer is realtime and caching is not turned on. See https://issues.asterisk.org/jira/browse/ASTERISK-12650.

See Also


qualifyfreq for 1.4

Attached you’ll find a backports to 1.4 of qualifyfreq
Patch against 1.4.26 (patch by albert _at_ mediacaster.nl) – qualifyfreq5.backport-1.4.patch :

Patch against 1.4.26.1 (patch by TSM) – qualifyfreq.backport-1.4.26.1.patch


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.