[zaptel-commits] tzafrir: branch 1.4 r4353 - in /branches/1.4: ./ kernel/xpp/xbus-pcm.c
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Sun Jun 15 12:10:12 CDT 2008
Author: tzafrir
Date: Sun Jun 15 12:10:12 2008
New Revision: 4353
URL: http://svn.digium.com/view/zaptel?view=rev&rev=4353
Log:
Muted DTMF PCM (from FXS modules) could "leak" to the next channel.
(From xpp r5796).
Merged revisions 4352 via svnmerge from
http://svn.digium.com/svn/zaptel/branches/1.2
Modified:
branches/1.4/ (props changed)
branches/1.4/kernel/xpp/xbus-pcm.c
Propchange: branches/1.4/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.
Modified: branches/1.4/kernel/xpp/xbus-pcm.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/kernel/xpp/xbus-pcm.c?view=diff&rev=4353&r1=4352&r2=4353
==============================================================================
--- branches/1.4/kernel/xpp/xbus-pcm.c (original)
+++ branches/1.4/kernel/xpp/xbus-pcm.c Sun Jun 15 12:10:12 2008
@@ -858,34 +858,36 @@
{
byte *pcm;
xpp_line_t pcm_mask;
+ xpp_line_t pcm_mute;
unsigned long flags;
int i;
pcm = RPACKET_FIELD(pack, GLOBAL, PCM_READ, pcm);
pcm_mask = RPACKET_FIELD(pack, GLOBAL, PCM_READ, lines);
spin_lock_irqsave(&xpd->lock, flags);
+ pcm_mute = xpd->mute_dtmf | xpd->silence_pcm;
if(!SPAN_REGISTERED(xpd))
goto out;
for (i = 0; i < xpd->channels; i++) {
volatile u_char *r = xpd->span.chans[i].readchunk;
-
- if(!IS_SET(xpd->wanted_pcm_mask, i)) {
- if(IS_SET(xpd->silence_pcm, i)) {
- memset((u_char *)r, 0x7F, ZT_CHUNKSIZE); // SILENCE
+ bool got_data = IS_SET(pcm_mask, i);
+
+ if(IS_SET(xpd->wanted_pcm_mask, i)) {
+ /* Must fill zaptel buffers */
+ if(got_data && !IS_SET(pcm_mute, i)) {
+ /* We have and want real data */
+ // memset((u_char *)r, 0x5A, ZT_CHUNKSIZE); // DEBUG
+ // fill_beep((u_char *)r, 1, 1); // DEBUG: BEEP
+ memcpy((u_char *)r, pcm, ZT_CHUNKSIZE);
+ } else {
+ /* Inject SILENCE */
+ memset((u_char *)r, 0x7F, ZT_CHUNKSIZE);
memset(xpd->ec_chunk2[i], 0x7F, ZT_CHUNKSIZE);
memset(xpd->ec_chunk1[i], 0x7F, ZT_CHUNKSIZE);
}
- continue;
- }
- pcm_mask &= ~xpd->mute_dtmf;
- if(IS_SET(pcm_mask, i)) {
- // memset((u_char *)r, 0x5A, ZT_CHUNKSIZE); // DEBUG
- // fill_beep((u_char *)r, 1, 1); // DEBUG: BEEP
- memcpy((u_char *)r, pcm, ZT_CHUNKSIZE);
+ }
+ if(got_data)
pcm += ZT_CHUNKSIZE;
- } else {
- memset((u_char *)r, 0x7F, ZT_CHUNKSIZE); // SILENCE
- }
}
out:
XPD_COUNTER(xpd, PCM_READ)++;
More information about the zaptel-commits
mailing list