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

markster at lists.digium.com markster at lists.digium.com
Sun Oct 3 01:07:04 CDT 2004


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

Modified Files:
	pbx_config.c 
Log Message:
Add '+foo' option, update sample config


Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- pbx_config.c	3 Oct 2004 04:19:58 -0000	1.47
+++ pbx_config.c	3 Oct 2004 05:08:51 -0000	1.48
@@ -1649,6 +1649,7 @@
 						char *stringp=NULL;
 						int ipri = -2;
 						char realext[256]="";
+						char *plus;
 						tc = strdup(v->value);
 						if(tc!=NULL){
 							stringp=tc;
@@ -1668,6 +1669,11 @@
 								else
 									ast_log(LOG_WARNING, "Label missing trailing ')' at line %d\n", v->lineno);
 							}
+							plus = strchr(pri, '+');
+							if (plus) {
+								*plus = '\0';
+								plus++;
+							}
 							if (!strcmp(pri,"hint"))
 								ipri=PRIORITY_HINT;
 							else if (!strcmp(pri, "next") || !strcmp(pri, "n")) {
@@ -1680,7 +1686,7 @@
 									ipri = lastpri;
 								else
 									ast_log(LOG_WARNING, "Can't use 'same' priority on the first entry!\n");
-							} else {
+							} else  {
 								if (sscanf(pri, "%i", &ipri) != 1) {
 									ast_log(LOG_WARNING, "Invalid priority '%s' at line %d\n", pri, v->lineno);
 									ipri = 0;
@@ -1722,6 +1728,8 @@
 							while(*appl && (*appl < 33)) appl++;
 							pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
 							if (ipri) {
+								if (plus)
+									ipri += atoi(plus);
 								lastpri = ipri;
 								if (ast_add_extension2(con, 0, realext, ipri, label, cidmatch, appl, strdup(data), FREE, registrar)) {
 									ast_log(LOG_WARNING, "Unable to register extension at line %d\n", v->lineno);




More information about the svn-commits mailing list