summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorGeorge Joseph <george.joseph@fairview5.com>2014-12-23 23:18:50 +0000
committerGeorge Joseph <george.joseph@fairview5.com>2014-12-23 23:18:50 +0000
commitd1c532034b6f281dfb2cda8a3294da0d725001e6 (patch)
tree1a4da900c8624d14a49c96eb177906fc1e512167 /res
parent0a3dd7589ebf6845a95b561a08ffb239b5ed2b07 (diff)
pjsip_options: Fix continued qualifies after endpoint/aor deletion
If you remove an endpoint/aor from pjsip.conf then do a core reload, qualifies will continue even though the object are gone. This happens because nothing clears out the qualify tasks. This patch unschedules all existing qualify tasks before scheduling new ones on reload. Tested-by: George Joseph Review: https://reviewboard.asterisk.org/r/4290/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@430064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r--res/res_pjsip/pjsip_options.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/res/res_pjsip/pjsip_options.c b/res/res_pjsip/pjsip_options.c
index f64c83f38..1c3c9347e 100644
--- a/res/res_pjsip/pjsip_options.c
+++ b/res/res_pjsip/pjsip_options.c
@@ -1006,10 +1006,25 @@ static int qualify_and_schedule_all_cb(void *obj, void *arg, int flags)
return 0;
}
+/*!
+ * \internal
+ * \brief Unschedule all existing contacts
+ */
+static int unschedule_all_cb(void *obj, void *arg, int flags)
+{
+ struct sched_data *data = obj;
+
+ AST_SCHED_DEL_UNREF(sched, data->id, ao2_ref(data, -1));
+
+ return CMP_MATCH;
+}
+
static void qualify_and_schedule_all(void)
{
struct ao2_container *endpoints = ast_sip_get_endpoints();
+ ao2_callback(sched_qualifies, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK, unschedule_all_cb, NULL);
+
if (!endpoints) {
return;
}