summaryrefslogtreecommitdiff
path: root/res/res_pjsip/pjsip_options.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2017-02-08 11:50:11 -0600
committerMark Michelson <mmichelson@digium.com>2017-02-08 11:54:39 -0600
commit46147a8f3013ba7fcf326e1b2d6e1b6c4ad68202 (patch)
tree23d733aa23cb2994ee55dbb1cc5da8dd58e601e9 /res/res_pjsip/pjsip_options.c
parentc72b4c98e8e7ef2d833178dea12d34298ffa194f (diff)
Revert "Update qualifies when AOR configuration changes."
This reverts commit 6492e91392b8fd394193e411c6eb64b45486093f. The change in question was intended to prevent the need to reload in order to update qualifies on contacts when an AOR changes. However, this ended up causing a deadlock instead. Change-Id: I1a835c90a5bb65b6dc3a1e94cddc12a4afc3d71e
Diffstat (limited to 'res/res_pjsip/pjsip_options.c')
-rw-r--r--res/res_pjsip/pjsip_options.c45
1 files changed, 6 insertions, 39 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index 51987f4de..6fd3c2575 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -518,18 +518,6 @@ static int qualify_contact_task(void *obj)
static int qualify_contact_sched(const void *obj)
{
struct sched_data *data = (struct sched_data *) obj;
- struct ast_sip_aor *aor;
-
- /* This helps us to determine if an AOR has been removed
- * from configuration, and if so, stop qualifying the
- * contact
- */
- aor = ast_sip_location_retrieve_aor(data->contact->aor);
- if (!aor) {
- ao2_ref(data, -1);
- return 0;
- }
- ao2_ref(aor, -1);
ao2_ref(data->contact, +1);
if (ast_sip_push_task(NULL, qualify_contact_task, data->contact)) {
@@ -1176,10 +1164,12 @@ static int qualify_and_schedule_all_cb(void *obj, void *arg, int flags)
struct ast_sip_aor *aor = obj;
struct ao2_container *contacts;
- contacts = ast_sip_location_retrieve_aor_contacts(aor);
- if (contacts) {
- ao2_callback(contacts, OBJ_NODATA, qualify_and_schedule_cb_with_aor, aor);
- ao2_ref(contacts, -1);
+ if (aor->permanent_contacts) {
+ contacts = ast_sip_location_retrieve_aor_contacts(aor);
+ if (contacts) {
+ ao2_callback(contacts, OBJ_NODATA, qualify_and_schedule_cb_with_aor, aor);
+ ao2_ref(contacts, -1);
+ }
}
return 0;
@@ -1506,29 +1496,6 @@ int ast_res_pjsip_init_options_handling(int reload)
return 0;
}
-static int unschedule_for_aor_cb(void *obj, void *arg, int flags)
-{
- struct sched_data *data = obj;
- struct ast_sip_aor *aor = arg;
-
- if (!strcmp(ast_sorcery_object_get_id(aor), data->contact->aor)) {
- AST_SCHED_DEL_UNREF(sched, data->id, ao2_ref(data, -1));
- }
-
- return 0;
-}
-
-void ast_res_pjsip_update_options(struct ast_sip_aor *aor)
-{
- /* This can happen if an AOR is created and applied before OPTIONs code has been initialized */
- if (!sched_qualifies) {
- return;
- }
-
- ao2_callback(sched_qualifies, OBJ_NODATA | OBJ_UNLINK, unschedule_for_aor_cb, aor);
- qualify_and_schedule_all_cb(aor, NULL, 0);
-}
-
void ast_res_pjsip_cleanup_options_handling(void)
{
ast_cli_unregister_multiple(cli_options, ARRAY_LEN(cli_options));