aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 06:17:42 +0000
committerrizzo <rizzo@f38db490-d61c-443f-a65b-d21fe96a405b>2006-05-09 06:17:42 +0000
commit1b2ea5bc9365181e3028381485b816e86d88a7c3 (patch)
tree801abfc4e1c49c92e02a1aac472bdf34a899f23b /pbx.c
parentc199e3b0e21f73b47735d1a1ffadbc7b678c76bc (diff)
simplify matchcid()
define struct pbx_find_info for later use git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25861 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/pbx.c b/pbx.c
index f64616a2f..e0a873fd3 100644
--- a/pbx.c
+++ b/pbx.c
@@ -700,22 +700,31 @@ struct ast_context *ast_context_find(const char *name)
static int matchcid(const char *cidpattern, const char *callerid)
{
- int failresult;
-
/* If the Caller*ID pattern is empty, then we're matching NO Caller*ID, so
failing to get a number should count as a match, otherwise not */
- if (!ast_strlen_zero(cidpattern))
- failresult = 0;
- else
- failresult = 1;
-
- if (!callerid)
- return failresult;
+ if (ast_strlen_zero(callerid))
+ return ast_strlen_zero(cidpattern) ? 1 : 0;
return ast_extension_match(cidpattern, callerid);
}
+/* request and result for pbx_find_extension */
+struct pbx_find_info {
+#if 0
+ const char *context;
+ const char *exten;
+ int priority;
+#endif
+
+ char *incstack[AST_PBX_MAX_STACK]; /* filled during the search */
+ int stacklen; /* modified during the search */
+ int status; /* set on return */
+ struct ast_switch *swo; /* set on return */
+ const char *data; /* set on return */
+ const char *foundcontext; /* set on return */
+};
+
static struct ast_exten *pbx_find_extension(struct ast_channel *chan,
struct ast_context *bypass,
const char *context, const char *exten, int priority,