[asterisk-commits] mmichelson: branch 1.4 r133104 - /branches/1.4/apps/app_chanspy.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jul 23 14:06:17 CDT 2008


Author: mmichelson
Date: Wed Jul 23 14:06:16 2008
New Revision: 133104

URL: http://svn.digium.com/view/asterisk?view=rev&rev=133104
Log:
Zap/pseudo is ten characters, but DAHDI/pseudo is
twelve. The strncmp call in next_channel should
account for this.


Modified:
    branches/1.4/apps/app_chanspy.c

Modified: branches/1.4/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/apps/app_chanspy.c?view=diff&rev=133104&r1=133103&r2=133104
==============================================================================
--- branches/1.4/apps/app_chanspy.c (original)
+++ branches/1.4/apps/app_chanspy.c Wed Jul 23 14:06:16 2008
@@ -54,6 +54,15 @@
 #include "asterisk/lock.h"
 
 #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";
@@ -475,7 +484,7 @@
 		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;




More information about the asterisk-commits mailing list