[asterisk-commits] jpeeler: trunk r235226 - /trunk/main/channel.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 15 17:41:23 CST 2009


Author: jpeeler
Date: Tue Dec 15 17:41:20 2009
New Revision: 235226

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=235226
Log:
Change match criteria existence in ast_channel_cmp_cb to use ast_strlen_zero.

(closes issue #16161)
Reported by: may213
Patches: 
      core-show-channel.patch uploaded by may213 (license 454)

Modified:
    trunk/main/channel.c

Modified: trunk/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/channel.c?view=diff&rev=235226&r1=235225&r2=235226
==============================================================================
--- trunk/main/channel.c (original)
+++ trunk/main/channel.c Tue Dec 15 17:41:20 2009
@@ -1322,12 +1322,12 @@
 
 	ast_channel_lock(chan);
 
-	if (cmp_args->name) { /* match by name */
+	if (!ast_strlen_zero(cmp_args->name)) { /* match by name */
 		if ((!name_len && strcasecmp(chan->name, cmp_args->name)) ||
 				(name_len && strncasecmp(chan->name, cmp_args->name, name_len))) {
 			ret = 0; /* name match failed */
 		}
-	} else if (cmp_args->exten) {
+	} else if (!ast_strlen_zero(cmp_args->exten)) {
 		if (cmp_args->context && strcasecmp(chan->context, cmp_args->context) &&
 				strcasecmp(chan->macrocontext, cmp_args->context)) {
 			ret = 0; /* context match failed */
@@ -1336,11 +1336,13 @@
 				strcasecmp(chan->macroexten, cmp_args->exten)) {
 			ret = 0; /* exten match failed */
 		}
-	} else if (cmp_args->uniqueid) {
+	} else if (!ast_strlen_zero(cmp_args->uniqueid)) {
 		if ((!name_len && strcasecmp(chan->uniqueid, cmp_args->uniqueid)) ||
 				(name_len && strncasecmp(chan->uniqueid, cmp_args->uniqueid, name_len))) {
 			ret = 0; /* uniqueid match failed */
 		}
+	} else {
+		ret = 0;
 	}
 
 	ast_channel_unlock(chan);




More information about the asterisk-commits mailing list