]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Add global option to limit the maximum time for initial qualifies 45/45/6
authorGeorge Joseph <george.joseph@fairview5.com>
Sat, 11 Apr 2015 22:04:32 +0000 (16:04 -0600)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 16 Apr 2015 05:47:30 +0000 (00:47 -0500)
commit1b6f6ff841634fcb68b473fde160f1100f70f855
tree3bbf070e1d835b7a512a14426335c715023396b1
parent5d218cde872ed3fa2dc5ad92ed3a17b413ce8203
res_pjsip: Add global option to limit the maximum time for initial qualifies

Currently when Asterisk starts initial qualifies of contacts are spread out
randomly between 0 and qualify_timeout to prevent network and system overload.
If a contact's qualify_frequency is 5 minutes however, that contact may be
unavailable to accept calls for the entire 5 minutes after startup.  So while
staggering the initial qualifies is a good idea, basing the time on
qualify_timeout could leave contacts unavailable for too long.

This patch adds a new global parameter "max_initial_qualify_time" that sets the
maximum time for the initial qualifies.  This way you could make sure that all
your contacts are initialy, randomly qualified within say 30 seconds but still
have the contact's ongoing qualifies at a 5 minute interval.

If max_initial_qualify_time is > 0, the formula is initial_interval =
min(max_initial_interval, qualify_timeout * random().  If not set,
qualify_timeout is used.

The default is "0" (disabled).

ASTERISK-24863 #close

Change-Id: Ib80498aa1ea9923277bef51d6a9015c9c79740f4
Tested-by: George Joseph <george.joseph@fairview5.com>
CHANGES
configs/samples/pjsip.conf.sample
contrib/ast-db-manage/config/versions/a541e0b5e89_add_pjsip_max_initial_qualify_time.py [new file with mode: 0644]
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/config_global.c
res/res_pjsip/pjsip_options.c