[Asterisk-cvs] asterisk/pbx pbx_config.c,1.46,1.47
markster at lists.digium.com
markster at lists.digium.com
Sun Oct 3 00:18:12 CDT 2004
Update of /usr/cvsroot/asterisk/pbx
In directory mongoose.digium.com:/tmp/cvs-serv7037/pbx
Modified Files:
pbx_config.c
Log Message:
Major PBX revamps (including labels, update examples)
Index: pbx_config.c
===================================================================
RCS file: /usr/cvsroot/asterisk/pbx/pbx_config.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- pbx_config.c 2 Oct 2004 20:43:16 -0000 1.46
+++ pbx_config.c 3 Oct 2004 04:19:58 -0000 1.47
@@ -1215,7 +1215,7 @@
if (!app_data)
app_data="";
- if (ast_add_extension(argv[4], argc == 6 ? 1 : 0, exten, iprior, cidmatch, app,
+ if (ast_add_extension(argv[4], argc == 6 ? 1 : 0, exten, iprior, NULL, cidmatch, app,
(void *)strdup(app_data), free, registrar)) {
switch (errno) {
case ENOMEM:
@@ -1617,6 +1617,7 @@
char *cxt, *ext, *pri, *appl, *data, *tc, *cidmatch;
struct ast_context *con;
char *start, *end;
+ char *label;
char realvalue[256];
int lastpri = -2;
@@ -1657,6 +1658,16 @@
pri = strsep(&stringp, ",");
if (!pri)
pri="";
+ label = strchr(pri, '(');
+ if (label) {
+ *label = '\0';
+ label++;
+ end = strchr(label, ')');
+ if (end)
+ *end = '\0';
+ else
+ ast_log(LOG_WARNING, "Label missing trailing ')' at line %d\n", v->lineno);
+ }
if (!strcmp(pri,"hint"))
ipri=PRIORITY_HINT;
else if (!strcmp(pri, "next") || !strcmp(pri, "n")) {
@@ -1712,7 +1723,7 @@
pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
if (ipri) {
lastpri = ipri;
- if (ast_add_extension2(con, 0, realext, ipri, cidmatch, appl, strdup(data), FREE, registrar)) {
+ 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