[asterisk-commits] trunk r25861 - /trunk/pbx.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Mon May 8 23:17:42 MST 2006


Author: rizzo
Date: Tue May  9 01:17:42 2006
New Revision: 25861

URL: http://svn.digium.com/view/asterisk?rev=25861&view=rev
Log:
simplify matchcid()
define struct pbx_find_info for later use


Modified:
    trunk/pbx.c

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=25861&r1=25860&r2=25861&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Tue May  9 01:17:42 2006
@@ -700,21 +700,30 @@
 
 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,



More information about the asterisk-commits mailing list