[svn-commits] rmudgett: trunk r207318 - in /trunk: CHANGES channels/chan_misdn.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jul 17 23:17:05 CDT 2009


Author: rmudgett
Date: Fri Jul 17 23:17:01 2009
New Revision: 207318

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=207318
Log:
Merged 207316 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...

..........
r207316 | rmudgett | 2009-07-17 23:05:05 -0500 (Fri, 17 Jul 2009) | 20 lines

Fixed incoming calls being matched to MSNs without type-of-number prefix added.

For an incoming ISDN call the dialed.number is incorrectly matched against
the configured MSNs in misdn.conf.  The numbers passed to the dialplan
include the configured prefix for the dialed.number_type, whereas the
check against the configured MSNs (to decide if the call is accepted at
all), is executed without the configured prefix.

e.g., dialed.number = 241168020, TON = national, configured national
prefix is "0".  (This is the TON which is used by ISDN providers in the
Netherlands.)

In chan_misdn.c:cb_events() in case EVENT_SETUP the call to
misdn_cfg_is_msn_valid() uses the unnormalized number 241168020, but 57
lines later the call to read_config() adds the prefix, and the
dialed.number is now 0241168020, which is then used in the dialplan.
misdn_cfg_is_msn_valid() must use the normalized number, too.

JIRA ABE-1912

Modified:
    trunk/CHANGES
    trunk/channels/chan_misdn.c

Modified: trunk/CHANGES
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/CHANGES?view=diff&rev=207318&r1=207317&r2=207318
==============================================================================
--- trunk/CHANGES (original)
+++ trunk/CHANGES Fri Jul 17 23:17:01 2009
@@ -120,7 +120,8 @@
     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.
+    number has the corresponding Type-Of-Number.  NOTE:  This includes
+    comparing the incoming call's dialed number against the MSN list.
   * Added the following new parameters: unknownprefix, netspecificprefix,
     subscriberprefix, and abbreviatedprefix in misdn.conf to prefix any
     received number from the ISDN link if that number has the corresponding

Modified: trunk/channels/chan_misdn.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/channels/chan_misdn.c?view=diff&rev=207318&r1=207317&r2=207318
==============================================================================
--- trunk/channels/chan_misdn.c (original)
+++ trunk/channels/chan_misdn.c Fri Jul 17 23:17:01 2009
@@ -9390,6 +9390,26 @@
 	}
 }
 
+/*!
+ * \internal
+ * \brief Determine if the given dialed party matches our MSN.
+ * \since 1.6.3
+ *
+ * \param port ISDN port
+ * \param dialed Dialed party information of incoming call.
+ *
+ * \retval non-zero if MSN is valid.
+ * \retval 0 if MSN invalid.
+ */
+static int misdn_is_msn_valid(int port, const struct misdn_party_dialing *dialed)
+{
+	char number[sizeof(dialed->number)];
+
+	ast_copy_string(number, dialed->number, sizeof(number));
+	misdn_add_number_prefix(port, dialed->number_type, number, sizeof(number));
+	return misdn_cfg_is_msn_valid(port, number);
+}
+
 /************************************************************/
 /*  Receive Events from isdn_lib  here                     */
 /************************************************************/
@@ -9640,7 +9660,6 @@
 	case EVENT_SETUP:
 	{
 		struct chan_list *ch = find_chan_by_bc(cl_te, bc);
-		int msn_valid = misdn_cfg_is_msn_valid(bc->port, bc->dialed.number);
 		struct ast_channel *chan;
 		int exceed;
 		int ai;
@@ -9657,7 +9676,7 @@
 			}
 		}
 
-		if (!bc->nt && ! msn_valid) {
+		if (!bc->nt && !misdn_is_msn_valid(bc->port, &bc->dialed)) {
 			chan_misdn_log(1, bc->port, " --> Ignoring Call, its not in our MSN List\n");
 			return RESPONSE_IGNORE_SETUP; /*  Ignore MSNs which are not in our List */
 		}




More information about the svn-commits mailing list