]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add type of num var for pri
authorAnthony Minessale <anthony.minessale@gmail.com>
Mon, 12 Jan 2009 17:46:30 +0000 (17:46 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Mon, 12 Jan 2009 17:46:30 +0000 (17:46 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@622 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/mod_openzap/mod_openzap.c
libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c

index 935f367c6109d16d84e3d0a9df1a98285b3a59f9..ef1bd3e520ce9595d4cd37cdb4ed26d64202ef08 100644 (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)) {
index c374eeded4bca06a644cf49510d45f33cdba55e5..096086d437ef387f725e4c738abdf0303c3f30b8 100644 (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;