]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10237 [mod_callcenter] Do not kick member out on timeout if originating to an...
authorItalo Rossi <italorossib@gmail.com>
Tue, 13 Jun 2017 03:12:15 +0000 (00:12 -0300)
committerItalo Rossi <italorossib@gmail.com>
Tue, 13 Jun 2017 03:12:15 +0000 (00:12 -0300)
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

index d3ab7a820fb3bfe7f94e0a9599af70f4cc16c1a2..656af706ebfcebf2497cafb840fe1fc8b6c84a09 100644 (file)
@@ -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);