]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10304: [mod_callcenter] Prevent infinite logging when a stale queue member in...
authorEduardo Marinho <e@calmaamigo.com>
Thu, 11 May 2017 12:27:34 +0000 (09:27 -0300)
committerEduardo Marinho <e@calmaamigo.com>
Thu, 11 May 2017 12:43:58 +0000 (09:43 -0300)
Having a member from a queue that is no longer found on the current system
causes infinite logging about skipping a member.

There is already cleanup code for abandoned calls in same function, but it can
never be reached for this case, because there is no queue.

If the queue is never found again in the system, the logging would continue
forever or until the stale record gets removed from the database.

FS-10304 #resolve

src/mod/applications/mod_callcenter/mod_callcenter.c

index d3ab7a820fb3bfe7f94e0a9599af70f4cc16c1a2..a55c408c40bd6d458b3ef0e7eff17b10fdb9bbf3 100644 (file)
@@ -2361,7 +2361,10 @@ static int members_callback(void *pArg, int argc, char **argv, char **columnName
        cbt.member_system = argv[10];
 
        if (!cbt.queue_name || !(queue = get_queue(cbt.queue_name))) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Queue %s not found locally, skip this member\n", cbt.queue_name);
+               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Queue %s not found locally, delete this member\n", cbt.queue_name);
+               sql = switch_mprintf("DELETE FROM members WHERE uuid = '%q' AND system = '%q'", cbt.member_uuid, cbt.member_system);
+               cc_execute_sql(NULL, sql, NULL);
+               switch_safe_free(sql);
                goto end;
        } else {
                queue_name = strdup(queue->name);