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");
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)) {
* 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;