aboutsummaryrefslogtreecommitdiffstats
path: root/pbx
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-10 18:59:58 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-10-10 18:59:58 +0000
commit87de25bea97ad5a2f9a51f9c33ca0260731d5484 (patch)
tree2596c29fc8baeed37fc55edc69ae1365208fad83 /pbx
parent0865c8f92169dc66a5bda99010caa4ea0126d5f9 (diff)
Reset continuation items at the beginning of each context (suggested by
kpfleming). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@148329 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r--pbx/pbx_config.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c
index e2b38c15d..798a098bb 100644
--- a/pbx/pbx_config.c
+++ b/pbx/pbx_config.c
@@ -1410,7 +1410,7 @@ static int pbx_load_config(const char *config_file)
const char *aft;
const char *newpm, *ovsw;
struct ast_flags config_flags = { 0 };
- char lastextension[256] = "";
+ char lastextension[256];
cfg = ast_config_load(config_file, config_flags);
if (!cfg)
return 0;
@@ -1451,11 +1451,19 @@ static int pbx_load_config(const char *config_file)
if (con == NULL)
continue;
+ /* Reset continuation items at the beginning of each context */
+ lastextension[0] = '\0';
+ lastpri = -2;
+
for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
char *tc = NULL;
char realext[256] = "";
char *stringp, *ext;
if (!strncasecmp(v->name, "same", 4)) {
+ if (ast_strlen_zero(lastextension)) {
+ ast_log(LOG_ERROR, "No previous pattern in the first entry of context '%s' to match '%s'!\n", cxt, v->name);
+ continue;
+ }
if ((stringp = tc = ast_strdup(v->value))) {
ast_copy_string(realext, lastextension, sizeof(realext));
goto copy_last_extension;