From c909649b85f8236e527b1437d054585c62dc548c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 12 Jan 2009 17:50:26 +0000 Subject: [PATCH] add type of num var for pri git-svn-id: http://svn.openzap.org/svn/openzap/trunk@623 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/mod_openzap/mod_openzap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/freetdm/mod_openzap/mod_openzap.c b/libs/freetdm/mod_openzap/mod_openzap.c index ef1bd3e520..ce0d5042d7 100644 --- a/libs/freetdm/mod_openzap/mod_openzap.c +++ b/libs/freetdm/mod_openzap/mod_openzap.c @@ -901,7 +901,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi char *argv[3]; int argc = 0; const char *var; - + switch_channel_t *channel = NULL; + + if (!outbound_profile) { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing caller profile\n"); @@ -969,7 +971,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi zap_set_string(caller_data.ani.digits, dest); } - if ((var = switch_event_get_header(var_event, "openzap_outbound_ton"))) { + channel = switch_core_session_get_channel(*new_session); + + if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_channel_get_variable(channel, "openzap_outbound_ton"))) { if (!strcasecmp(var, "national")) { caller_data.ani.type = Q931_TON_NATIONAL; } @@ -1011,12 +1015,10 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi if ((*new_session = switch_core_session_request(openzap_endpoint_interface, pool)) != 0) { private_t *tech_pvt; - switch_channel_t *channel; switch_caller_profile_t *caller_profile; switch_core_session_add_stream(*new_session, NULL); if ((tech_pvt = (private_t *) switch_core_session_alloc(*new_session, sizeof(private_t))) != 0) { - channel = switch_core_session_get_channel(*new_session); tech_init(tech_pvt, *new_session, zchan); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Hey where is my memory pool?\n");