]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
auto populate global origination_caller_id_name/number from effective_caller_id_name...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Jun 2011 20:57:59 +0000 (15:57 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 29 Jun 2011 20:57:59 +0000 (15:57 -0500)
src/switch_ivr_originate.c

index 872c11cf64c2d38930152454818537bdcb35c17f..cf0fca1d9db5da1db50d5a906c829ac1c8c4fc22 100644 (file)
@@ -1374,7 +1374,17 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess
        }
        
        if (channel) {
+               const char *cid;
+
                switch_channel_process_export(channel, NULL, var_event, SWITCH_EXPORT_VARS_VARIABLE);
+
+               if ((cid = switch_channel_get_variable(channel, "effective_caller_id_name"))) {
+                       switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_caller_id_name", cid);
+               }
+
+               if ((cid = switch_channel_get_variable(channel, "effective_caller_id_number"))) {
+                       switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "origination_caller_id_number", cid);
+               }
        }
 
        /* strip leading spaces */