aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-25 17:50:06 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2003-10-25 17:50:06 +0000
commitb2724a44d0ce19b6451b6c0da4ed6ea32394307c (patch)
treec163913c8f39ede741e20c64b56d3467f9ddc0cb /pbx.c
parent79ab512ffd931a402ca29d279d670782b2cae1e4 (diff)
Verify includes, and give warnings if invalid (bug #429)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@1667 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rwxr-xr-xpbx.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 98c7392ed..98e1ade6a 100755
--- a/pbx.c
+++ b/pbx.c
@@ -4644,3 +4644,17 @@ struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con,
else
return ip->next;
}
+
+int ast_context_verify_includes(struct ast_context *con)
+{
+ struct ast_include *inc;
+ int res = 0;
+
+ for (inc = ast_walk_context_includes(con, NULL); inc; inc = ast_walk_context_includes(con, inc))
+ if (!ast_context_find(inc->rname)) {
+ res = -1;
+ ast_log(LOG_WARNING, "Context '%s' tries includes non-existant context '%s'\n",
+ ast_get_context_name(con), inc->rname);
+ }
+ return res;
+}