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/
........
Merged revisions 430064 from http://svn.asterisk.org/svn/asterisk/branches/13
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@430067
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
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;
}