aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authormatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-12 13:59:15 +0000
committermatteo <matteo@f38db490-d61c-443f-a65b-d21fe96a405b>2003-02-12 13:59:15 +0000
commit6f8508e0dc91d74f9c126759b28d711eeffca2ac (patch)
tree9345a8b61da436462f1b95c568b836a0e4174e6a /pbx
parent34e6118176bb9e9f3244bddef34632a779baafac (diff)
mer feb 12 14:56:57 CET 2003
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@612 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rwxr-xr-xpbx/.cvsignore1
-rwxr-xr-xpbx/pbx_config.c31
2 files changed, 28 insertions, 4 deletions
diff --git a/pbx/.cvsignore b/pbx/.cvsignore
new file mode 100755
index 000000000..053dfa8f1
--- /dev/null
+++ b/pbx/.cvsignore
@@ -0,0 +1 @@
+pbx_kdeconsole.moc
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index b37a98f62..56de6ed26 100755
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1059,6 +1059,7 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
char *whole_exten;
char *exten, *prior;
char *cidmatch, *app, *app_data;
+ char *start, *end;
/* check for arguments at first */
if (argc != 5 && argc != 6) return RESULT_SHOWUSAGE;
@@ -1075,7 +1076,14 @@ static int handle_context_add_extension(int fd, int argc, char *argv[])
}
prior = strsep(&whole_exten,",");
app = strsep(&whole_exten,",");
- app_data = whole_exten;
+ if ((start = strchr(app, '(')) && (end = strrchr(app, ')'))) {
+ *start = *end = '\0';
+ app_data = start + 1;
+ for (start = app_data; *start; start++)
+ if (*start == ',')
+ *start = '|';
+ } else
+ app_data = whole_exten;
if (!exten || !prior || !app || !app_data) return RESULT_SHOWUSAGE;
@@ -1466,6 +1474,7 @@ static int pbx_load_module(void)
struct ast_variable *v;
char *cxt, *ext, *pri, *appl, *data, *tc, *cidmatch;
struct ast_context *con;
+ char *start, *end;
cfg = ast_load(config);
if (cfg) {
@@ -1474,10 +1483,15 @@ static int pbx_load_module(void)
"static"));
write_protect_config = ast_true(ast_variable_retrieve(cfg, "general",
"writeprotect"));
+ v = ast_variable_browse(cfg, "globals");
+ while(v) {
+ pbx_builtin_setvar_helper(NULL, v->name, v->value);
+ v = v->next;
+ }
cxt = ast_category_browse(cfg, NULL);
while(cxt) {
/* All categories but "general" are considered contexts */
- if (!strcasecmp(cxt, "general")) {
+ if (!strcasecmp(cxt, "general") || !strcasecmp(cxt, "globals")) {
cxt = ast_category_browse(cfg, cxt);
continue;
}
@@ -1495,10 +1509,18 @@ static int pbx_load_module(void)
pri = strsep(&stringp, ",");
if (!pri)
pri="";
- appl = strsep(&stringp, ",");
+ appl = stringp;
+ if (!(start = strchr(appl, '(')))
+ appl = strsep(&stringp, ",");
if (!appl)
appl="";
- if (stringp!=NULL && *stringp=='"') {
+ if (start && (end = strrchr(appl, ')'))) {
+ *start = *end = '\0';
+ data = start + 1;
+ for (start = data; *start; start++)
+ if (*start == ',')
+ *start = '|';
+ } else if (stringp!=NULL && *stringp=='"') {
stringp++;
data = strsep(&stringp, "\"");
stringp++;
@@ -1566,6 +1588,7 @@ int load_module(void)
int reload(void)
{
ast_context_destroy(NULL, registrar);
+ pbx_builtin_clear_globals();
pbx_load_module();
return 0;
}