summaryrefslogtreecommitdiff
path: root/res/res_pjsip/location.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2017-02-01 13:54:50 -0600
committerMark Michelson <mmichelson@digium.com>2017-02-01 14:21:04 -0600
commitbbed75c3ba424b63257e1556b79a80242f3b6e2b (patch)
tree88b1d9f613a9d40e6678c6f614bd84d4db03eaf9 /res/res_pjsip/location.c
parente252aff9ad9e8448ec0bdcd031b3833dd460d7db (diff)
Update qualifies when AOR configuration changes.
Prior to this change, qualifies would only update in the following cases: * A reload of res_pjsip.so was issued. * A dynamic contact was re-registered after its AOR's qualify_frequency had been changed This does not work well if you are using realtime for your AORs. You can update your database to have a new qualify_frequency, but the permanent contacts on that AOR will not have their qualifies updated. And the dynamic contacts on that AOR will not have their qualifies updated until the next registration, which could be a long time. This change seeks to fix this problem by making it so that whenever AOR configuration is applied, the contacts pertaining to that AOR have their qualifies updated. Additions from this patch: * AOR sorcery objects now have an apply handler that calls into a newly added function in the OPTIONS code. This causes all contacts associated with that AOR to re-schedule qualifies. * When it is time to qualify a contact, the OPTIONS code checks to see if the AOR can still be retrieved. If not, then qualification is canceled on the contact. Alterations from this patch: * The registrar code no longer updates contact's qualify_frequence and qualify_timeout. There is no point to this since those values already get updated when the AOR changes. * Reloading res_pjsip.so no longer calls the OPTIONS initialization function. Reloading res_pjsip.so results in re-loading AORs, which results in re-scheduling qualifies. Change-Id: I2e7c3316da28f389c45954f24c4e9389abac1121
Diffstat (limited to 'res/res_pjsip/location.c')
-rw-r--r--res/res_pjsip/location.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_pjsip/location.c b/res/res_pjsip/location.c
index 5abfcabad..cfe65b18e 100644
--- a/res/res_pjsip/location.c
+++ b/res/res_pjsip/location.c
@@ -1137,6 +1137,12 @@ static int contact_apply_handler(const struct ast_sorcery *sorcery, void *object
return status ? 0 : -1;
}
+static int aor_apply_handler(const struct ast_sorcery *sorcery, void *object)
+{
+ ast_res_pjsip_update_options(object);
+ return 0;
+}
+
/*! \brief Initialize sorcery with location support */
int ast_sip_initialize_sorcery_location(void)
{
@@ -1153,7 +1159,7 @@ int ast_sip_initialize_sorcery_location(void)
ast_sorcery_apply_default(sorcery, "aor", "config", "pjsip.conf,criteria=type=aor");
if (ast_sorcery_object_register(sorcery, "contact", contact_alloc, NULL, contact_apply_handler) ||
- ast_sorcery_object_register(sorcery, "aor", aor_alloc, NULL, NULL)) {
+ ast_sorcery_object_register(sorcery, "aor", aor_alloc, NULL, aor_apply_handler)) {
return -1;
}