]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add channel variables
authorMathieu Rene <mrene@avgs.ca>
Thu, 12 Mar 2009 15:27:29 +0000 (15:27 +0000)
committerMathieu Rene <mrene@avgs.ca>
Thu, 12 Mar 2009 15:27:29 +0000 (15:27 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@696 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/freetdm/mod_openzap/mod_openzap.c

index 1b9f96ab45fbeba5a46a1eaca9c902d888d81f3a..a6bbd55c410cf17ee552674a1fbfc68b60fc52a3 100644 (file)
@@ -1041,6 +1041,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
                snprintf(name, sizeof(name), "OpenZAP/%u:%u/%s", zchan->span_id, zchan->chan_id, dest);
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connect outbound channel %s\n", name);
                switch_channel_set_name(channel, name);
+               switch_channel_set_variable(channel, "openzap_span_name", zchan->span->name);
+               switch_channel_set_variable_printf(channel, "openzap_span_number", "%d", zchan->span_id);       
+               switch_channel_set_variable_printf(channel, "openzap_chan_number", "%d", zchan->chan_id);
                zchan->caller_data = caller_data;
                caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
                switch_channel_set_caller_profile(channel, caller_profile);
@@ -1150,6 +1153,10 @@ zap_status_t zap_channel_from_event(zap_sigmsg_t *sigmsg, switch_core_session_t
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Connect inbound channel %s\n", name);
        switch_channel_set_name(channel, name);
        switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
+
+       switch_channel_set_variable(channel, "openzap_span_name", sigmsg->channel->span->name);
+       switch_channel_set_variable_printf(channel, "openzap_span_number", "%d", sigmsg->channel->span_id);     
+       switch_channel_set_variable_printf(channel, "openzap_chan_number", "%d", sigmsg->channel->chan_id);
                
        switch_channel_set_state(channel, CS_INIT);
        if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) {