From 8c5727e26bd7dfcb13e3e57515d91b4fe527d774 Mon Sep 17 00:00:00 2001 From: Antonio Silva Date: Mon, 15 Jul 2024 17:08:30 +0100 Subject: [PATCH] mod_callcenter: try to fix #2529 hangup the call when answered - already answered by other agent --- src/mod/applications/mod_callcenter/mod_callcenter.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index 3ed5c1b5fa..cc5875e303 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1922,6 +1922,8 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa switch_safe_free(sql); if (atoi(res) == 0) { + /* Unexpected, it's possible the agent channel wasn't created when the agent that won the race was connected, so hangup the channel */ + switch_channel_hangup(switch_core_session_get_channel(agent_session), SWITCH_CAUSE_LOSE_RACE); goto done; } switch_core_session_hupall_matching_var("cc_member_pre_answer_uuid", h->member_uuid, SWITCH_CAUSE_LOSE_RACE);