From b4ada1b849d526e3d808fd22626b7d618289c537 Mon Sep 17 00:00:00 2001 From: Italo Rossi Date: Tue, 13 Jun 2017 00:12:15 -0300 Subject: [PATCH] FS-10237 [mod_callcenter] Do not kick member out on timeout if originating to an agent Now we're passing member_session as session parameter to switch_ivr_originate, this will make the cc_export_vars no longer needed in the future as now all the variables previously exported will be seen by switch_ivr_originate because member_session is the ORIGINATOR. cc_export_vars still works. --- src/mod/applications/mod_callcenter/mod_callcenter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_callcenter/mod_callcenter.c b/src/mod/applications/mod_callcenter/mod_callcenter.c index d3ab7a820f..656af706eb 100644 --- a/src/mod/applications/mod_callcenter/mod_callcenter.c +++ b/src/mod/applications/mod_callcenter/mod_callcenter.c @@ -1663,7 +1663,7 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa t_agent_called = local_epoch_time_now(NULL); dialstr = switch_channel_expand_variables(member_channel, h->originate_string); - status = switch_ivr_originate(NULL, &agent_session, &cause, dialstr, 60, NULL, cid_name ? cid_name : h->member_cid_name, cid_number ? cid_number : h->member_cid_number, NULL, ovars, SOF_NONE, NULL); + status = switch_ivr_originate(member_session, &agent_session, &cause, dialstr, 60, NULL, cid_name ? cid_name : h->member_cid_name, cid_number ? cid_number : h->member_cid_number, NULL, ovars, SOF_NONE, NULL); /* Search for loopback agent */ if (status == SWITCH_STATUS_SUCCESS) { @@ -2709,7 +2709,7 @@ void *SWITCH_THREAD_FUNC cc_member_thread_run(switch_thread_t *thread, void *obj break; } /* Make the Caller Leave if he went over his max wait time */ - if (queue->max_wait_time > 0 && queue->max_wait_time <= time_now - m->t_member_called) { + if (queue->max_wait_time > 0 && queue->max_wait_time <= time_now - m->t_member_called && !switch_channel_test_flag(member_channel, CF_ORIGINATOR)) { switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(member_session), SWITCH_LOG_DEBUG, "Member %s <%s> in queue '%s' reached max wait time\n", m->member_cid_name, m->member_cid_number, m->queue_name); m->member_cancel_reason = CC_MEMBER_CANCEL_REASON_TIMEOUT; switch_channel_set_flag_value(member_channel, CF_BREAK, 2);