[Asterisk-cvs] asterisk/pbx pbx_config.c,1.48,1.49

markster at lists.digium.com markster at lists.digium.com
Sun Oct 3 12:14:01 CDT 2004


Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv22927/pbx

Modified Files:
	pbx_config.c 
Log Message:
Allow you to use labels with + to be nice to Tilghman.


Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -u -d -r1.48 -r1.49
--- pbx_config.c	3 Oct 2004 05:08:51 -0000	1.48
+++ pbx_config.c	3 Oct 2004 16:15:44 -0000	1.49
@@ -17,6 +17,7 @@
 #include <asterisk/module.h>
 #include <asterisk/logger.h>
 #include <asterisk/cli.h>
+#include <asterisk/callerid.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -1656,6 +1657,12 @@
 							ext = strsep(&stringp, ",");
 							if (!ext)
 								ext="";
+							cidmatch = strchr(ext, '/');
+							if (cidmatch) {
+								*cidmatch = '\0';
+								cidmatch++;
+								ast_shrink_phone_number(cidmatch);
+							}
 							pri = strsep(&stringp, ",");
 							if (!pri)
 								pri="";
@@ -1688,8 +1695,10 @@
 									ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
 							} else  {
 								if (sscanf(pri, "%i", &ipri) != 1) {
-									ast_log(LOG_WARNING, "Invalid priority '%s' at line %d\n", pri, v->lineno);
-									ipri = 0;
+									if ((ipri = ast_findlabel_extension2(NULL, con, ext, pri, cidmatch)) < 1) {
+										ast_log(LOG_WARNING, "Invalid priority/label '%s' at line %d\n", pri, v->lineno);
+										ipri = 0;
+									}
 								}
 							}
 							appl = stringp;
@@ -1715,13 +1724,6 @@
 								else
 									data = "";
 							}
-							cidmatch = strchr(ext, '/');
-							if (cidmatch) {
-								*cidmatch = '\0';
-								cidmatch++;
-							}
-							stringp=ext;
-							strsep(&stringp, "/");
 
 							if (!data)
 								data="";




More information about the svn-commits mailing list