summaryrefslogtreecommitdiff
path: root/res/res_pjsip
diff options
context:
space:
mode:
authorKevin Harwell <kharwell@digium.com>2017-12-07 18:18:00 -0600
committerKevin Harwell <kharwell@digium.com>2017-12-07 18:38:23 -0600
commitbd2218ce63e9a1d3a0d7365f1a99a72dff2222bc (patch)
tree8728813e66d0d86497bc9c446edc95588120dcd3 /res/res_pjsip
parentb0b28446c1e5f76c54b823bc3f4e2a5423c9c79b (diff)
pjsip_options: dynamic contact's fields not updated on reload
Dynamic contacts were not being properly updated on reload. As a matter of fact any changes to the AOR that a dynamic contact was associated with were not being applied. On reload, this patch makes it so for each dynamic contact, the associated AOR is now retrieved and the AOR's fields are applied to the contact. ASTERISK-27467 Change-Id: I8e3165dc6a745218c1c9db837f77fafa0516985d
Diffstat (limited to 'res/res_pjsip')
-rw-r--r--res/res_pjsip/pjsip_options.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 662166c89..8c22fd2fc 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1147,7 +1147,24 @@ static int qualify_and_schedule_cb_with_aor(void *obj, void *arg, int flags)
static int qualify_and_schedule_cb_without_aor(void *obj, void *arg, int flags)
{
- qualify_and_schedule_contact((struct ast_sip_contact *) obj);
+ /*
+ * These are really dynamic contacts. We need to retrieve the aor associated
+ * with the contact since it's possible some of the aor's fields were updated
+ * since last load.
+ */
+ struct ast_sip_contact *contact = obj;
+ struct ast_sip_aor *aor = ast_sip_location_retrieve_aor(contact->aor);
+
+ if (aor) {
+ qualify_and_schedule_cb_with_aor(obj, aor, flags);
+ ao2_ref(aor, -1);
+ } else {
+ ast_log(LOG_WARNING, "Unable to locate AOR for contact '%s'. Keeping old "
+ "associated settings: frequency=%d, timeout=%f, authenticate=%s\n",
+ contact->uri, contact->qualify_frequency, contact->qualify_timeout,
+ contact->authenticate_qualify ? "yes" : "no");
+ qualify_and_schedule_contact(contact);
+ }
return 0;
}