summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
Diffstat (limited to 'zaptel.c')
-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;