From cf09488f3260fc252ac1ea402ea31b6c9d33d07b Mon Sep 17 00:00:00 2001 From: kpfleming Date: Sun, 25 Sep 2005 21:35:37 +0000 Subject: ensure that idle audio channels transmit silence (issue #5186, slightly different fix) git-svn-id: http://svn.digium.com/svn/zaptel/trunk@773 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zaptel.c b/zaptel.c index 9abe625..48909a8 100755 --- a/zaptel.c +++ b/zaptel.c @@ -4970,10 +4970,15 @@ out in the later versions, and is put back now. */ } 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; -- cgit v1.2.3