FS-10661: [mod_callcenter] Making cc_export_vars work with uuid-standby agents

This commit is contained in:
Italo Rossi 2017-09-14 22:18:20 -03:00
parent 77dcd007ad
commit 75c56a0007
1 changed files with 10 additions and 0 deletions

View File

@ -1769,6 +1769,11 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
if (agent_session) {
switch_channel_t *agent_channel = switch_core_session_get_channel(agent_session);
const char *cc_warning_tone = switch_channel_get_variable(agent_channel, "cc_warning_tone");
switch_channel_t *member_channel = switch_core_session_get_channel(member_session);
const char *cc_export_vars = switch_channel_get_variable(member_channel, "cc_export_vars");
char *cc_export_vars_dup = switch_core_session_strdup(member_session, cc_export_vars);
int argc;
char *argv[256];
switch_channel_set_variable(agent_channel, "cc_side", "agent");
switch_channel_set_variable(agent_channel, "cc_queue", h->queue_name);
@ -1777,6 +1782,11 @@ static void *SWITCH_THREAD_FUNC outbound_agent_thread_run(switch_thread_t *threa
switch_channel_set_variable(agent_channel, "cc_member_uuid", h->member_uuid);
switch_channel_set_variable(agent_channel, "cc_member_session_uuid", h->member_session_uuid);
argc = switch_separate_string(cc_export_vars_dup, ',', argv, (sizeof(argv) / sizeof(argv[0])));
for (int i = 0; i < argc; ++i) {
switch_channel_set_variable(agent_channel, argv[i], switch_channel_get_variable(member_channel, argv[i]));
}
/* Playback this to the agent */
if (cc_warning_tone) {
switch_ivr_park_session(agent_session);