login | register
Thu 21 of Aug, 2008 [06:08 UTC]

voip-info.org

Discuss [2] History

Asterisk sip qualify

Created by: oej,Last modification on Wed 30 of Jan, 2008 [17:43 UTC] by dlublink

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 sip.conf, Asterisk will send a SIP 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. There is no way to change this value on a per peer basis. It is compiled into the chan_sip module. The value in qualfiy = 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 which 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,


Comments

Comments Filter
222

333re How regularly?

by netvoice, Saturday 13 of October, 2007 [09:14:30 UTC]
The source (channel/chan_sip.c) defines:

  1. define DEFAULT_FREQ_OK 60 * 1000 /*!< Qualification: How often to check for the host to be up */
  2. define DEFAULT_FREQ_NOTOK 10 * 1000 /*!< Qualification: How often to check, if the host is down... */

so. normally, it checks every 60 seconds. It is not configurable but can easily be changed in the source.
222

333How regularly?

by Eil, Thursday 30 of November, 2006 [18:18:20 UTC]
"Asterisk will send a SIP OPTIONS command regularly to check that the device is still online."

Just how regularly? And is it configurable?