diff options
author | Jenkins2 <jenkins2@gerrit.asterisk.org> | 2017-12-13 14:11:15 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-12-13 14:11:15 -0600 |
commit | 898889d3f1efa6e1eba50ad53c87886f48300d4d (patch) | |
tree | efde497aee1a3cedc2c569fa765202740e282934 | |
parent | c1972ebbab8ff672a927ee567cb1bd3a819ec271 (diff) | |
parent | 845a0d8de34fa72aa255bc6856cee209f817e214 (diff) |
Merge "pjsip_options: dynamic contact's fields not updated on reload" into 15
-rw-r--r-- | res/res_pjsip/pjsip_options.c | 19 |
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; } |