aboutsummaryrefslogtreecommitdiffstats
path: root/pbx/pbx_config.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-03 16:15:44 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-10-03 16:15:44 +0000
commitc2b1557a20b8cfab2f17310f0c6e99966e6c8e9d (patch)
tree464e4a397c7687b53303a46d0a8ee1d05bda9836 /pbx/pbx_config.c
parentf60cf13e7f82d6e36727092f059f61cbb5530b8f (diff)
Allow you to use labels with + to be nice to Tilghman.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3897 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx/pbx_config.c')
-rwxr-xr-xpbx/pbx_config.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index a6286c0a7..0df07bd47 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -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 @@ static int pbx_load_module(void)
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 @@ static int pbx_load_module(void)
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 @@ static int pbx_load_module(void)
else
data = "";
}
- cidmatch = strchr(ext, '/');
- if (cidmatch) {
- *cidmatch = '\0';
- cidmatch++;
- }
- stringp=ext;
- strsep(&stringp, "/");
if (!data)
data="";