提交 e27a9c78 authored 作者: Anthony Minessale's avatar Anthony Minessale

put caller back into the fifo if the agent hangs up before they are bridged

上级 51810b98
...@@ -2926,12 +2926,27 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -2926,12 +2926,27 @@ SWITCH_STANDARD_APP(fifo_function)
if (!(switch_channel_ready(channel))) { if (!(switch_channel_ready(channel))) {
const char *app = switch_channel_get_variable(other_channel, "current_application"); const char *app = switch_channel_get_variable(other_channel, "current_application");
const char *arg = switch_channel_get_variable(other_channel, "current_application_data"); const char *arg = switch_channel_get_variable(other_channel, "current_application_data");
switch_caller_extension_t *extension = NULL; switch_caller_extension_t *extension = NULL;
send_presence(node);
check_cancel(node);
switch_channel_set_variable_printf(channel, "last_sent_callee_id_name", "%s (AGENT FAIL)",
switch_channel_get_variable(other_channel, "caller_id_name"));
switch_channel_set_variable(channel, "last_sent_callee_id_number", switch_channel_get_variable(other_channel, "caller_id_number"));
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING,
"Customer %s %s [%s] appears to be abandoned by agent %s [%s] "
"but is still on the line, redirecting them back to the queue with VIP status.\n",
switch_channel_get_name(other_channel),
switch_channel_get_variable(other_channel, "caller_id_name"),
switch_channel_get_variable(other_channel, "caller_id_number"),
switch_channel_get_variable(channel, "caller_id_name"),
switch_channel_get_variable(channel, "caller_id_number"));
switch_channel_wait_for_state_timeout(other_channel, CS_HIBERNATE, 5000);
send_presence(node);
check_cancel(node);
if (app) { if (app) {
extension = switch_caller_extension_new(other_session, app, arg); extension = switch_caller_extension_new(other_session, app, arg);
switch_caller_extension_add_application(other_session, extension, app, arg); switch_caller_extension_add_application(other_session, extension, app, arg);
...@@ -2940,6 +2955,7 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -2940,6 +2955,7 @@ SWITCH_STANDARD_APP(fifo_function)
} else { } else {
switch_channel_hangup(other_channel, SWITCH_CAUSE_NORMAL_CLEARING); switch_channel_hangup(other_channel, SWITCH_CAUSE_NORMAL_CLEARING);
} }
switch_channel_set_variable(other_channel, "fifo_vip", "true");
switch_core_session_rwunlock(other_session); switch_core_session_rwunlock(other_session);
break; break;
...@@ -3098,6 +3114,7 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -3098,6 +3114,7 @@ SWITCH_STANDARD_APP(fifo_function)
send_presence(node); send_presence(node);
check_cancel(node); check_cancel(node);
switch_core_session_rwunlock(other_session); switch_core_session_rwunlock(other_session);
...@@ -3230,7 +3247,6 @@ SWITCH_STANDARD_APP(fifo_function) ...@@ -3230,7 +3247,6 @@ SWITCH_STANDARD_APP(fifo_function)
switch_channel_clear_app_flag_key(FIFO_APP_KEY, channel, FIFO_APP_BRIDGE_TAG); switch_channel_clear_app_flag_key(FIFO_APP_KEY, channel, FIFO_APP_BRIDGE_TAG);
switch_core_media_bug_resume(session); switch_core_media_bug_resume(session);
} }
struct xml_helper { struct xml_helper {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论