diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-06-24 05:09:55 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2003-06-24 05:09:55 +0000 |
commit | 92af76d7b7ef1f7963cedf17656f8b2573eadeca (patch) | |
tree | ad80da2d9755f57c3be569848271a5d5cbfa23d1 /zaptel.c | |
parent | 16b7000c4d879521e99678148279debeaa18f22a (diff) |
Add digital monitoring mode
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@201 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-x | zaptel.c | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -4189,6 +4189,14 @@ static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char for (x=0;x<ZT_CHUNKSIZE;x++) txb[x] = ZT_LIN2X(getlin[x], ms); break; + case ZT_CONF_DIGITALMON: + /* Add monitored channel */ + if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) { + memcpy(txb, chans[ms->confna]->getraw, ZT_CHUNKSIZE); + } else { + memcpy(txb, chans[ms->confna]->putraw, ZT_CHUNKSIZE); + } + break; } } if (ms->confmute) { @@ -4199,6 +4207,8 @@ static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char memcpy(ms->getlin_lastchunk, ms->getlin, ZT_CHUNKSIZE * sizeof(short)); /* save value from current */ memcpy(ms->getlin, getlin, ZT_CHUNKSIZE * sizeof(short)); + /* save value from current */ + memcpy(ms->getraw, txb, ZT_CHUNKSIZE); /* if to make tx tone */ if (ms->v1_1 || ms->v2_1 || ms->v3_1) { @@ -4780,6 +4790,7 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char if (!(ms->flags & ZT_FLAG_PSEUDO)) { memcpy(ms->putlin, putlin, ZT_CHUNKSIZE * sizeof(short)); + memcpy(ms->putraw, rxb, ZT_CHUNKSIZE); } /* Take the rxc, twiddle it for conferencing if appropriate and put it @@ -4904,6 +4915,16 @@ static inline void __zt_process_putaudio_chunk(struct zt_chan *ss, unsigned char for (x=0;x<ZT_CHUNKSIZE;x++) rxb[x] = ZT_LIN2X((int)conf_sums_prev[ms->_confn][x], ms); break; + case ZT_CONF_DIGITALMON: + /* if not a pseudo-channel, ignore */ + if (!(ms->flags & ZT_FLAG_PSEUDO)) break; + /* Add monitored channel */ + if (chans[ms->confna]->flags & ZT_FLAG_PSEUDO) { + memcpy(rxb, chans[ms->confna]->getraw, ZT_CHUNKSIZE); + } else { + memcpy(rxb, chans[ms->confna]->putraw, ZT_CHUNKSIZE); + } + break; } } } @@ -5325,7 +5346,7 @@ static void __zt_receive_chunk(struct zt_chan *chan, unsigned char *buf) buf = waste; } if (chan->flags & ZT_FLAG_AUDIO) { -#ifdef CONFIG_ZAPTEL_MMX +#ifdef CONFIG_ZAPTEL_MMX zt_kernel_fpu_begin(); #endif __zt_process_putaudio_chunk(chan, buf); |