diff options
-rwxr-xr-x | zaptel.c | 23 | ||||
-rwxr-xr-x | zaptel.h | 3 |
2 files changed, 25 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); @@ -763,6 +763,7 @@ struct zt_tone_def { /* Structure for zone programming */ #define ZT_CONF_CONFMON 6 /* conference monitor mode */ #define ZT_CONF_CONFANNMON 7 /* conference announce/monitor mode */ #define ZT_CONF_REALANDPSEUDO 8 /* real and pseudo port both on conf */ +#define ZT_CONF_DIGITALMON 9 /* Do not decode or interpret */ #define ZT_CONF_FLAG_MASK 0xff00 /* mask for flags */ #define ZT_CONF_LISTENER 0x100 /* is a listener on the conference */ #define ZT_CONF_TALKER 0x200 /* is a talker on the conference */ @@ -977,8 +978,10 @@ struct zt_chan { struct confq confout; short getlin[ZT_MAX_CHUNKSIZE]; /* Last transmitted samples */ + unsigned char getraw[ZT_MAX_CHUNKSIZE]; /* Last received raw data */ short getlin_lastchunk[ZT_MAX_CHUNKSIZE]; /* Last transmitted samples from last chunk */ short putlin[ZT_MAX_CHUNKSIZE]; /* Last received samples */ + unsigned char putraw[ZT_MAX_CHUNKSIZE]; /* Last received raw data */ short conflast[ZT_MAX_CHUNKSIZE]; /* Last conference sample -- base part of channel */ short conflast1[ZT_MAX_CHUNKSIZE]; /* Last conference sample -- pseudo part of channel */ short conflast2[ZT_MAX_CHUNKSIZE]; /* Previous last conference sample -- pseudo part of channel */ |