[Asterisk-cvs] zaptel zaptel.c,1.115,1.116

kpfleming kpfleming
Sun Sep 25 17:38:38 CDT 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv15000

Modified Files:
	zaptel.c 
Log Message:
ensure that idle audio channels transmit silence (issue #5186, slightly different fix)


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -d -r1.115 -r1.116
--- zaptel.c	8 Sep 2005 17:22:39 -0000	1.115
+++ zaptel.c	25 Sep 2005 21:35:37 -0000	1.116
@@ -4970,10 +4970,15 @@
 			}
 			bytes = 0;
 		} else if (ms->flags & ZT_FLAG_CLEAR) {
-			/* Clear channels should idle with 0xff for the sake
-			of silly PRI's that care about idle B channels */
-			memset(txb, 0xff, bytes);
-			bytes = 0;
+			/* Clear channels that are idle in audio mode need
+			   to send silence; in non-audio mode, always send 0xff
+			   so stupid switches won't consider the channel active
+			*/
+			if (ms->flags & ZT_FLAG_AUDIO) {
+				memset(txb, ZT_LIN2X(0, ms), bytes);
+			} else {
+				memset(txb, 0xff, bytes);
+			}
 		} else {
 			memset(txb, ZT_LIN2X(0, ms), bytes);	/* Lastly we use silence on telephony channels */
 			bytes = 0;




More information about the svn-commits mailing list