[svn-commits] dvossel: branch 1.4 r188646 - /branches/1.4/channels/chan_dahdi.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Wed Apr 15 17:08:46 CDT 2009


Author: dvossel
Date: Wed Apr 15 17:08:40 2009
New Revision: 188646

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=188646
Log:
National prefix inserted even when caller ID not available

When the caller ID is restricted, the expected behavior is for the caller id to be blank.  In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank.

(closes issue #13207)
Reported by: shawkris
Patches:
      national_prefix.diff uploaded by dvossel (license 671)

Review: http://reviewboard.digium.com/r/220/


Modified:
    branches/1.4/channels/chan_dahdi.c

Modified: branches/1.4/channels/chan_dahdi.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.4/channels/chan_dahdi.c?view=diff&rev=188646&r1=188645&r2=188646
==============================================================================
--- branches/1.4/channels/chan_dahdi.c (original)
+++ branches/1.4/channels/chan_dahdi.c Wed Apr 15 17:08:40 2009
@@ -8819,6 +8819,13 @@
 
 static void apply_plan_to_number(char *buf, size_t size, const struct dahdi_pri *pri, const char *number, const int plan)
 {
+	if (ast_strlen_zero(number)) { /* make sure a number exists so prefix isn't placed on an empty string */
+		if (size) {
+			*buf = '\0';
+		}
+		return;
+	}
+
 	switch (plan) {
 	case PRI_INTERNATIONAL_ISDN:		/* Q.931 dialplan == 0x11 international dialplan => prepend international prefix digits */
 		snprintf(buf, size, "%s%s", pri->internationalprefix, number);




More information about the svn-commits mailing list