]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Zap/pseudo is ten characters, but DAHDI/pseudo is
authorMark Michelson <mmichelson@digium.com>
Wed, 23 Jul 2008 19:06:16 +0000 (19:06 +0000)
committerMark Michelson <mmichelson@digium.com>
Wed, 23 Jul 2008 19:06:16 +0000 (19:06 +0000)
twelve. The strncmp call in next_channel should
account for this.

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

apps/app_chanspy.c

index d5068030060bcf303d0262cd8800005f60d0b43a..d9f20a177c6e1712a8c5d3e82828cf20f5605544 100644 (file)
@@ -55,6 +55,15 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
 #define AST_NAME_STRLEN 256
 
+/* "Zap/pseudo" is ten characters.
+ * "DAHDI/pseudo" is twelve characters.
+ */
+#ifdef HAVE_ZAPTEL
+#define PSEUDO_CHAN_LEN 10
+#else
+#define PSEUDO_CHAN_LEN 12
+#endif
+
 static const char *tdesc = "Listen to a channel, and optionally whisper into it";
 static const char *app_chan = "ChanSpy";
 static const char *desc_chan = 
@@ -475,7 +484,7 @@ redo:
                return NULL;
 
        snprintf(channel_name, AST_CHANNEL_NAME, "%s/pseudo", dahdi_chan_name);
-       if (!strncmp(this->name, channel_name, 10)) {
+       if (!strncmp(this->name, channel_name, PSEUDO_CHAN_LEN)) {
                last = this;
                ast_channel_unlock(this);
                goto redo;