[Freeswitch-trunk] [freeswitch] FreeSWITCH Source branch master updated. git2svn-syncpoint-master-1683-g43dd776

git at svn.freeswitch.org git at svn.freeswitch.org
Wed Feb 2 01:36:31 MSK 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FreeSWITCH Source".

The branch, master has been updated
       via  43dd776c3616f3735bd8b73d965f81e9d16dab79 (commit)
      from  fb66abfab4a74055c38cdc67da83e6e0175a4a0b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 43dd776c3616f3735bd8b73d965f81e9d16dab79
Author: Brian West <brian at freeswitch.org>
Date:   Tue Feb 1 16:35:53 2011 -0600

     sigh

diff --git a/libs/openzap/mod_openzap/mod_openzap.c b/libs/openzap/mod_openzap/mod_openzap.c
index 3e5227e..d52149c 100644
--- a/libs/openzap/mod_openzap/mod_openzap.c
+++ b/libs/openzap/mod_openzap/mod_openzap.c
@@ -135,7 +135,9 @@ void dump_chan_xml(zap_span_t *span, uint32_t chan_id, switch_stream_handle_t *s
 
 static void zap_set_npi(const char *npi_string, uint8_t *target)
 {
-	if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {
+	if (switch_is_number(npi_string)) {
+		*target = (uint8_t)atoi(npi_string);
+	} else if (!strcasecmp(npi_string, "isdn") || !strcasecmp(npi_string, "e164")) {
 		*target = ZAP_NPI_ISDN;
 	} else if (!strcasecmp(npi_string, "data")) {
 		*target = ZAP_NPI_DATA;
@@ -157,7 +159,9 @@ static void zap_set_npi(const char *npi_string, uint8_t *target)
 
 static void zap_set_ton(const char *ton_string, uint8_t *target)
 {
-	if (!strcasecmp(ton_string, "national")) {
+	if (switch_is_number(ton_string)) {
+		*target = (uint8_t)atoi(ton_string);
+	} else if (!strcasecmp(ton_string, "national")) {
 		*target = ZAP_TON_NATIONAL;
 	} else if (!strcasecmp(ton_string, "international")) {
 		*target = ZAP_TON_INTERNATIONAL;
@@ -1231,15 +1235,8 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 	}
 	
 	if ((var = switch_event_get_header(var_event, "openzap_outbound_ton")) || (var = switch_core_get_variable("openzap_outbound_ton"))) {
-		if (!strcasecmp(var, "national")) {
-			caller_data.ani.type = ZAP_TON_NATIONAL;
-		} else if (!strcasecmp(var, "international")) {
-			caller_data.ani.type = ZAP_TON_INTERNATIONAL;
-		} else if (!strcasecmp(var, "local")) {
-			caller_data.ani.type = ZAP_TON_SUBSCRIBER_NUMBER;
-		} else if (!strcasecmp(var, "unknown")) {
-			caller_data.ani.type = ZAP_TON_UNKNOWN;
-		}
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting TON to: %s\n", var);
+		zap_set_ton(var, &caller_data.ani.type);
 	} else {
 		caller_data.ani.type = outbound_profile->destination_number_ton;
 	}
@@ -1248,9 +1245,14 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi
 		zap_set_string((char *)caller_data.raw_data, var);
 		caller_data.raw_data_len = strlen(var);
 	}
-
-	caller_data.ani.plan = outbound_profile->destination_number_numplan;
-
+	
+	if ((var = switch_event_get_header(var_event, "openzap_outbound_npi")) || (var = switch_core_get_variable("openzap_outbound_npi"))) {
+		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting NPI to: %s\n", var);
+		zap_set_npi(var, &caller_data.ani.plan);
+	} else {
+		caller_data.ani.plan = outbound_profile->destination_number_numplan;
+	}
+	
 	/* blindly copy data from outbound_profile. They will be overwritten 
 	 * by calling zap_caller_data if needed after */
 	caller_data.cid_num.type = outbound_profile->caller_ton;

-----------------------------------------------------------------------

Summary of changes:
 libs/openzap/mod_openzap/mod_openzap.c |   30 ++++++++++++++++--------------
 1 files changed, 16 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
FreeSWITCH Source



More information about the Freeswitch-trunk mailing list