Merged revisions 133104 via svnmerge from
authorMark Michelson <mmichelson@digium.com>
Wed, 23 Jul 2008 19:07:56 +0000 (19:07 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 23 Jul 2008 19:07:56 +0000 (19:07 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133104 | mmichelson | 2008-07-23 14:06:16 -0500 (Wed, 23 Jul 2008) | 5 lines

Zap/pseudo is ten characters, but DAHDI/pseudo is
twelve. The strncmp call in next_channel should
account for this.

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133106 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c

index 3716c33..2646f56 100644 (file)
@@ -52,6 +52,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 #define AST_NAME_STRLEN 256
 #define NUM_SPYGROUPS 128
 
+ /* "DAHDI/pseudo" is twelve characters */
+#define PSEUDO_CHAN_LEN 12
+
 static const char *tdesc = "Listen to a channel, and optionally whisper into it";
 static const char *app_chan = "ChanSpy";
 static const char *desc_chan =
@@ -609,7 +612,7 @@ redo:
                return NULL;
 
        snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
-       if (!strncmp(next->name, channel_name, 10)) {
+       if (!strncmp(next->name, channel_name, PSEUDO_CHAN_LEN)) {
                last = next;
                ast_channel_unlock(next);
                goto redo;