add type of num var for pri

git-svn-id: http://svn.openzap.org/svn/openzap/trunk@622 a93c3328-9c30-0410-af19-c9cd2b2d52af
This commit is contained in:
Anthony Minessale 2009-01-12 17:46:30 +00:00
parent ac845fb58f
commit 2a8e9751a0
2 changed files with 13 additions and 1 deletions

View File

@ -900,6 +900,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
switch_event_header_t *h;
char *argv[3];
int argc = 0;
const char *var;
if (!outbound_profile) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Missing caller profile\n");
@ -966,6 +968,16 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
if (!switch_strlen_zero(dest)) {
zap_set_string(caller_data.ani.digits, dest);
}
if ((var = switch_event_get_header(var_event, "openzap_outbound_ton"))) {
if (!strcasecmp(var, "national")) {
caller_data.ani.type = Q931_TON_NATIONAL;
}
} else {
caller_data.ani.type = outbound_profile->destination_number_ton;
}
caller_data.ani.plan = outbound_profile->destination_number_numplan;
#if 0
if (!switch_strlen_zero(outbound_profile->rdnis)) {

View File

@ -1009,7 +1009,7 @@ static __inline__ void state_advance(zap_channel_t *zchan)
* CallingNum IE
*/
Q931InitIECallingNum(&CallingNum);
CallingNum.TypNum = Q931_TON_UNKNOWN;
CallingNum.TypNum = zchan->caller_data.ani.type;
CallingNum.NumPlanID = Q931_NUMPLAN_E164;
CallingNum.PresInd = Q931_PRES_ALLOWED;
CallingNum.ScreenInd = Q931_SCREEN_USER_NOT_SCREENED;