From 473837a4ab2440239f9f4a860555c0e75ef8fbbb Mon Sep 17 00:00:00 2001 From: Jeff Peeler Date: Tue, 15 Dec 2009 23:41:20 +0000 Subject: 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) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235226 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/channel.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'main/channel.c') diff --git a/main/channel.c b/main/channel.c index 0bea870d8..9f3f550df 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1322,12 +1322,12 @@ static int ast_channel_cmp_cb(void *obj, void *arg, int flags) 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 @@ static int ast_channel_cmp_cb(void *obj, void *arg, int flags) 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); -- cgit v1.2.3