From 92af76d7b7ef1f7963cedf17656f8b2573eadeca Mon Sep 17 00:00:00 2001 From: markster Date: Tue, 24 Jun 2003 05:09:55 +0000 Subject: Add digital monitoring mode git-svn-id: http://svn.digium.com/svn/zaptel/trunk@201 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- zaptel.c | 23 ++++++++++++++++++++++- zaptel.h | 3 +++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/zaptel.c b/zaptel.c index c8cbaa7..1579459 100755 --- a/zaptel.c +++ b/zaptel.c @@ -4189,6 +4189,14 @@ static inline void __zt_process_getaudio_chunk(struct zt_chan *ss, unsigned char for (x=0;xconfna]->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_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); diff --git a/zaptel.h b/zaptel.h index f51f743..5ce9567 100755 --- a/zaptel.h +++ b/zaptel.h @@ -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 */ -- cgit v1.2.3