summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-09-25 21:35:37 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2005-09-25 21:35:37 +0000
commitcf09488f3260fc252ac1ea402ea31b6c9d33d07b (patch)
tree82821c91b4ff1526c41e38d584af4629c3d06140
parentec2f9974a3acf3795da36ecf0ee7f46b4d524148 (diff)
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
-rwxr-xr-xzaptel.c13
1 files 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;