[asterisk-commits] rmudgett: trunk r225446 - /trunk/channels/sig_pri.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 22 15:07:58 CDT 2009


Author: rmudgett
Date: Thu Oct 22 15:07:55 2009
New Revision: 225446

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225446
Log:
Search for the subaddress only within the extension section of the dial string.

Dial(DAHDI/(g|G|r|R)<group#(0-63)>[c|r<cadance#>|d][/extension])

Modified:
    trunk/channels/sig_pri.c

Modified: trunk/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/trunk/channels/sig_pri.c?view=diff&rev=225446&r1=225445&r2=225446
==============================================================================
--- trunk/channels/sig_pri.c (original)
+++ trunk/channels/sig_pri.c Thu Oct 22 15:07:55 2009
@@ -2718,7 +2718,7 @@
 	char dest[256]; /* must be same length as p->dialdest */
 	struct ast_party_subaddress dialed_subaddress; /* Called subaddress */
 	struct pri_sr *sr;
-	char *c, *l, *n, *s = NULL;
+	char *c, *l, *n, *s;
 #ifdef SUPPORT_USERUSER
 	const char *useruser;
 #endif
@@ -2745,39 +2745,40 @@
 	p->dialdest[0] = '\0';
 	p->outgoing = 1;
 
-	/* setup dialed_subaddress if found */
-	ast_party_subaddress_init(&dialed_subaddress);
-	c = strrchr(dest, ':');
-	if (c) {
-		*c = '\0';
-		c++;
-		/* prefix */
-		/* 'n' = NSAP */
-		/* 'U' = odd, 'u'= even */
-		/* Default = NSAP */
-		switch (*c) {
-		case 'U':
-			dialed_subaddress.odd_even_indicator = 1;
-			/* fall through */
-		case 'u':
-			c++;
-			dialed_subaddress.type = 2;
-			break;
-		case 'N':
-		case 'n':
-			c++;
-			/* default already covered with ast_party_subaddress_init */
-			break;
-		}
-		dialed_subaddress.str = c;
-		dialed_subaddress.valid = 1;
-	}
-
 	c = strchr(dest, '/');
 	if (c) {
 		c++;
 	} else {
 		c = "";
+	}
+
+	/* setup dialed_subaddress if found */
+	ast_party_subaddress_init(&dialed_subaddress);
+	s = strchr(c, ':');
+	if (s) {
+		*s = '\0';
+		s++;
+		/* prefix */
+		/* 'n' = NSAP */
+		/* 'U' = odd, 'u'= even */
+		/* Default = NSAP */
+		switch (*s) {
+		case 'U':
+			dialed_subaddress.odd_even_indicator = 1;
+			/* fall through */
+		case 'u':
+			s++;
+			dialed_subaddress.type = 2;
+			break;
+		case 'N':
+		case 'n':
+			s++;
+			/* default already covered with ast_party_subaddress_init */
+			break;
+		}
+		dialed_subaddress.str = s;
+		dialed_subaddress.valid = 1;
+		s = NULL;
 	}
 
 	l = NULL;




More information about the asterisk-commits mailing list