]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add call_uuid var
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 22:28:20 +0000 (17:28 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 24 Jun 2010 22:28:20 +0000 (17:28 -0500)
src/switch_ivr_originate.c

index c89013eb84ee6a9e6a377545bf1264104e0d2273..03dbd4dd25a12e8f8f97990fdaf114a2f074aca4 100644 (file)
@@ -1922,6 +1922,27 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess
                }
        }
 
+       if (var_event) {
+               switch_uuid_t uuid;
+               char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
+               char *use_uuid;
+
+               if (caller_channel) {
+                       use_uuid = switch_core_session_get_uuid(session);
+               } else {
+                       switch_uuid_get(&uuid);
+                       switch_uuid_format(uuid_str, &uuid);
+                       use_uuid = uuid_str;
+               }
+
+               switch_event_del_header(var_event, "call_uuid");
+               switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "call_uuid", use_uuid);
+
+               if (caller_channel) {
+                       switch_channel_set_variable(caller_channel, "call_uuid", use_uuid);
+               }
+       }
+
        /* A comma (,) separated list of variable names that should ne propagated from originator to originatee */
        if (caller_channel && (export_vars = switch_channel_get_variable(caller_channel, SWITCH_EXPORT_VARS_VARIABLE))) {
                char *cptmp = switch_core_session_strdup(session, export_vars);