[svn-commits] rmudgett: branch group/v14_colp r161908 - in /team/group/v14_colp: ./ channel...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Dec 8 16:24:18 CST 2008


Author: rmudgett
Date: Mon Dec  8 16:24:18 2008
New Revision: 161908

URL: http://svn.digium.com/view/asterisk?view=rev&rev=161908
Log:
Merged revisions 161905 via svnmerge from
https://origsvn.digium.com/svn/asterisk/team/group/issue8824

..........
r161905 | rmudgett | 2008-12-08 16:13:04 -0600 (Mon, 08 Dec 2008) | 5 lines

*  Addresses JIRA ABE-1747
mISDN now uses the nationalprefix and internationalprefix misdn.conf
parameters to prefix any received number from the ISDN link if that
number has the corresponding Type-Of-Number.

Modified:
    team/group/v14_colp/CHANGES
    team/group/v14_colp/channels/chan_misdn.c
    team/group/v14_colp/configs/misdn.conf.sample

Modified: team/group/v14_colp/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/v14_colp/CHANGES?view=diff&rev=161908&r1=161907&r2=161908
==============================================================================
--- team/group/v14_colp/CHANGES (original)
+++ team/group/v14_colp/CHANGES Mon Dec  8 16:24:18 2008
@@ -26,12 +26,15 @@
     channel.
   * Made misdn.conf parameter callerid accept the "name" <number> format
     used by the rest of the system.
+  * Made use the nationalprefix and internationalprefix misdn.conf
+    parameters to prefix any received number from the ISDN link if that
+    number has the corresponding Type-Of-Number.
 
 SIP channel driver (chan_sip) changes
 -------------------------------------------
   * The sendrpid parameter has been expanded to include the options
     'rpid' and 'pai'. Setting sendrpid to 'rpid' will cause Remote-Party-ID
-    header to be sent (equivalent to setting sendrpid=yes) and setting 
+    header to be sent (equivalent to setting sendrpid=yes) and setting
     sendrpid to 'pai' will cause P-Asserted-Identity header to be sent.
 
 ------------------------------------------------------------------------------

Modified: team/group/v14_colp/channels/chan_misdn.c
URL: http://svn.digium.com/view/asterisk/team/group/v14_colp/channels/chan_misdn.c?view=diff&rev=161908&r1=161907&r2=161908
==============================================================================
--- team/group/v14_colp/channels/chan_misdn.c (original)
+++ team/group/v14_colp/channels/chan_misdn.c Mon Dec  8 16:24:18 2008
@@ -1260,6 +1260,41 @@
 		break;
 	}
 }
+
+
+
+
+/* ******************************************************************* */
+/*!
+ * \internal
+ * \brief Add a confiured prefix to the given number.
+ *
+ * \param port Logical port number
+ * \param number_type Type-of-number passed in.
+ * \param number Given number string to add prefix
+ * \param size Buffer size number string occupies.
+ *
+ * \return Nothing
+ */
+static void misdn_add_number_prefix(int port, enum mISDN_NUMBER_TYPE number_type, char *number, size_t size)
+{
+	char prefix[MISDN_MAX_NUMBER_LEN];
+	char saved_number[MISDN_MAX_NUMBER_LEN];
+
+	prefix[0] = 0;
+	switch (number_type) {
+	case NUMTYPE_INTERNATIONAL:
+		misdn_cfg_get(port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
+		break;
+	case NUMTYPE_NATIONAL:
+		misdn_cfg_get(port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
+		break;
+	default:
+		return;
+	}
+	ast_copy_string(saved_number, number, sizeof(saved_number));
+	snprintf(number, size, "%s%s", prefix, saved_number);
+}	/* end misdn_add_number_prefix() */
 
 static void export_aoc_vars(int originator, struct ast_channel *ast, struct misdn_bchannel *bc)
 {
@@ -2617,12 +2652,11 @@
 
 	misdn_cfg_get(bc->port, MISDN_CFG_EARLY_BCONNECT, &bc->early_bconnect, sizeof(bc->early_bconnect));
 
+	misdn_cfg_get(port, MISDN_CFG_DISPLAY_CONNECTED, &bc->display_connected, sizeof(bc->display_connected));
+	misdn_cfg_get(port, MISDN_CFG_DISPLAY_SETUP, &bc->display_setup, sizeof(bc->display_setup));
+
 	misdn_cfg_get(port, MISDN_CFG_PICKUPGROUP, &pg, sizeof(pg));
 	misdn_cfg_get(port, MISDN_CFG_CALLGROUP, &cg, sizeof(cg));
-
-	misdn_cfg_get(port, MISDN_CFG_DISPLAY_CONNECTED, &bc->display_connected, sizeof(bc->display_connected));
-	misdn_cfg_get(port, MISDN_CFG_DISPLAY_SETUP, &bc->display_setup, sizeof(bc->display_setup));
-
 	chan_misdn_log(5, port, " --> * CallGrp:%s PickupGrp:%s\n", ast_print_group(buf, sizeof(buf), cg), ast_print_group(buf2, sizeof(buf2), pg));
 	ast->pickupgroup = pg;
 	ast->callgroup = cg;
@@ -2666,8 +2700,6 @@
 
 		ch->overlap_dial = 0;
 	} else {
-		char prefix[BUFFERSIZE + 1];
-
 		/* ORIGINATOR MISDN (incoming call) */
 
  		if (strstr(faxdetect, "incoming") || strstr(faxdetect, "both")) {
@@ -2678,42 +2710,16 @@
  		}
 
 		/* Add configured prefix to caller.number */
-		prefix[0] = 0;
-		switch (bc->caller.number_type) {
-		case NUMTYPE_INTERNATIONAL:
-			misdn_cfg_get(bc->port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
-			break;
-		case NUMTYPE_NATIONAL:
-			misdn_cfg_get(bc->port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
-			break;
-		default:
-			break;
-		}
-		ast_copy_string(buf, bc->caller.number, sizeof(buf));
-		snprintf(bc->caller.number, sizeof(bc->caller.number), "%s%s", prefix, buf);
-
-		if ( ast_strlen_zero(bc->dialed.number) && !ast_strlen_zero(bc->keypad)) {
+		misdn_add_number_prefix(bc->port, bc->caller.number_type, bc->caller.number, sizeof(bc->caller.number));
+
+		if (ast_strlen_zero(bc->dialed.number) && !ast_strlen_zero(bc->keypad)) {
 			ast_copy_string(bc->dialed.number, bc->keypad, sizeof(bc->dialed.number));
 		}
 
 		/* Add configured prefix to dialed.number */
-		prefix[0] = 0;
-		switch (bc->dialed.number_type) {
-		case NUMTYPE_INTERNATIONAL:
-			misdn_cfg_get(bc->port, MISDN_CFG_INTERNATPREFIX, prefix, sizeof(prefix));
-			break;
-		case NUMTYPE_NATIONAL:
-			misdn_cfg_get(bc->port, MISDN_CFG_NATPREFIX, prefix, sizeof(prefix));
-			break;
-		default:
-			break;
-		}
-		ast_copy_string(buf, bc->dialed.number, sizeof(buf));
-		snprintf(bc->dialed.number, sizeof(bc->dialed.number), "%s%s", prefix, buf);
-
-		if (strcmp(bc->dialed.number, ast->exten)) {
-			ast_copy_string(ast->exten, bc->dialed.number, sizeof(ast->exten));
-		}
+		misdn_add_number_prefix(bc->port, bc->dialed.number_type, bc->dialed.number, sizeof(bc->dialed.number));
+
+		ast_copy_string(ast->exten, bc->dialed.number, sizeof(ast->exten));
 	
 		misdn_cfg_get(bc->port, MISDN_CFG_OVERLAP_DIAL, &ch->overlap_dial, sizeof(ch->overlap_dial));
 		ast_mutex_init(&ch->overlap_tv_lock);
@@ -5049,6 +5055,9 @@
 		if (!ast_strlen_zero(bc->redirecting.from.number)) {
 			struct ast_party_redirecting redirecting;
 
+			/* Add configured prefix to redirecting.from.number */
+			misdn_add_number_prefix(bc->port, bc->redirecting.from.number_type, bc->redirecting.from.number, sizeof(bc->redirecting.from.number));
+
 			/* Update asterisk channel redirecting information */
 			ast_party_redirecting_set_init(&redirecting, &chan->redirecting);
 			redirecting.from.number = bc->redirecting.from.number;
@@ -5325,6 +5334,9 @@
 			break;
 
 		stop_indicate(ch);
+
+		/* Add configured prefix to connected.number */
+		misdn_add_number_prefix(bc->port, bc->connected.number_type, bc->connected.number, sizeof(bc->connected.number));
 
 		/* Update the connected line information on the other channel */
 		ast_party_connected_line_init(&connected);

Modified: team/group/v14_colp/configs/misdn.conf.sample
URL: http://svn.digium.com/view/asterisk/team/group/v14_colp/configs/misdn.conf.sample?view=diff&rev=161908&r1=161907&r2=161908
==============================================================================
--- team/group/v14_colp/configs/misdn.conf.sample (original)
+++ team/group/v14_colp/configs/misdn.conf.sample Mon Dec  8 16:24:18 2008
@@ -190,10 +190,11 @@
 ;
 allowed_bearers=all
 
-; Prefixes for national and international Type-Of-Number, these are
-; put before the caller number and dialed number if a corresponding
-; dialplan is set for incoming calls.  See the dialplan and localdialplan
-; options.
+; Prefixes for national and international Type-Of-Number.  These are
+; inserted before any number (caller, dialed, connected, redirecting,
+; redirection) received from the ISDN link if that number has the
+; correspondng Type-Of-Number.
+; See the dialplan options.
 ;
 ; default values: nationalprefix      : 0
 ;                 internationalprefix : 00




More information about the svn-commits mailing list