]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-10661: [mod_callcenter] Making cc_export_vars work with uuid-standby agents
authorItalo Rossi <italorossib@gmail.com>
Fri, 15 Sep 2017 01:18:20 +0000 (22:18 -0300)
committerItalo Rossi <italorossib@gmail.com>
Fri, 15 Sep 2017 01:18:20 +0000 (22:18 -0300)
src/mod/applications/mod_callcenter/mod_callcenter.c

index 9b9448bb1f5ce51309642a2893dc00956ddcffe6..64b21b0cd07a51d999cb34b8657b542436257afe 100644 (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);