mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-03 19:16:46 +00:00
pjsip_options.c: Allow immediate qualifies for new contacts.
When multiple endpoints try to register close together using the same AOR with qualify_frequency set, one contact would qualify immediately while the other contacts would have to wait out the duration of the timer before being able to qualify. Changing the conditional to check the contact container count for a non-zero value allows all contacts to qualify immediately. Change-Id: I79478118ee7e0d6e76af7c354d66684220db9415
This commit is contained in:
committed by
Benjamin Keith Ford
parent
8357ab7e9a
commit
941dead08d
@@ -2100,8 +2100,10 @@ static int sip_options_contact_add_task(void *obj)
|
||||
ao2_cleanup(contact_status);
|
||||
|
||||
if (task_data->aor_options->qualify_frequency) {
|
||||
/* If this is the first contact we need to schedule up qualification */
|
||||
if (ao2_container_count(task_data->aor_options->contacts) == 1) {
|
||||
/* There will always be a contact here, and we need to immediately schedule
|
||||
* a qualify so that contacts are not waiting for the qualify_frequency
|
||||
* timer duration before qualifying.
|
||||
*/
|
||||
ast_debug(3, "Starting scheduled callback on AOR '%s' for qualifying as there is now a contact on it\n",
|
||||
task_data->aor_options->name);
|
||||
/*
|
||||
@@ -2124,7 +2126,6 @@ static int sip_options_contact_add_task(void *obj)
|
||||
ast_log(LOG_ERROR, "Unable to schedule qualify for contacts of AOR '%s'\n",
|
||||
task_data->aor_options->name);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* If this was the first contact added to a non-qualified AOR then
|
||||
|
Reference in New Issue
Block a user