summaryrefslogtreecommitdiff
path: root/zaptel.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-04 03:20:08 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-04 03:20:08 +0000
commit89e2d0efedc95e1717c37c57a0cef6316a21b4cd (patch)
tree8f04d4b10ce3ef10f289d6fa1f12ae8d7a556980 /zaptel.c
parentf7d84bc12d8ecf566ba67545344573ffd0954e54 (diff)
Add RBS support to DACS (bug #1451)
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@384 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'zaptel.c')
-rwxr-xr-xzaptel.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/zaptel.c b/zaptel.c
index 69c4af5..f57fe01 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -422,6 +422,8 @@ static char *sigstr(int sig)
return "CAS";
case ZT_SIG_DACS:
return "DACS";
+ case ZT_SIG_DACS_RBS:
+ return "DACS+RBS";
case ZT_SIG_SF:
return "SF (ToneOnly)";
case ZT_SIG_NONE:
@@ -906,7 +908,7 @@ static void close_channel(struct zt_chan *chan)
oldconf = chan->confna;
/* initialize conference variables */
chan->_confn = 0;
- if ((chan->sig & ZT_SIG_DACS) != ZT_SIG_DACS) {
+ if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
chan->confna = 0;
chan->confmode = 0;
}
@@ -1970,7 +1972,7 @@ static int initialize_channel(struct zt_chan *chan)
chan->iomask = 0;
/* release conference resource if any */
if (chan->confna) zt_check_conf(chan->confna);
- if ((chan->sig & ZT_SIG_DACS) != ZT_SIG_DACS) {
+ if ((chan->sig & __ZT_SIG_DACS) != __ZT_SIG_DACS) {
chan->confna = 0;
chan->confmode = 0;
}
@@ -2085,7 +2087,7 @@ static int zt_specchan_open(struct inode *inode, struct file *file, int unit, in
res = -EBUSY;
else if (chans[unit]->master != chans[unit])
res = -EBUSY;
- else if (chans[unit]->sig == ZT_SIG_DACS)
+ else if ((chans[unit]->sig & __ZT_SIG_DACS) == __ZT_SIG_DACS)
res = -EBUSY;
else {
/* Assume everything is going to be okay */
@@ -2929,7 +2931,7 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
return -EINVAL;
ch.sigtype = chans[ch.master]->sig;
newmaster = chans[ch.master];
- } else if (ch.sigtype == ZT_SIG_DACS) {
+ } else if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
newmaster = chans[ch.chan];
if ((ch.idlebits < 1) || (ch.idlebits >= ZT_MAX_CHANNELS))
return -EINVAL;
@@ -3003,7 +3005,7 @@ static int zt_ctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd
/* Clear FCS flag */
chans[ch.chan]->flags &= ~ZT_FLAG_FCS;
}
- if ((ch.sigtype & ZT_SIG_DACS) == ZT_SIG_DACS) {
+ if ((ch.sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) {
/* Setup conference properly */
chans[ch.chan]->confmode = ZT_CONF_DIGITALMON;
chans[ch.chan]->confna = ch.idlebits;
@@ -5766,6 +5768,16 @@ int zt_transmit(struct zt_span *span)
__zt_real_transmit(&span->chans[x]);
}
}
+ if (span->chans[x].sig == ZT_SIG_DACS_RBS) {
+ if (chans[span->chans[x].confna]) {
+ /* Just set bits for our destination */
+ if (span->chans[x].txsig != chans[span->chans[x].confna]->rxsig) {
+ span->chans[x].txsig = chans[span->chans[x].confna]->rxsig;
+ span->rbsbits(&span->chans[x], chans[span->chans[x].confna]->rxsig);
+ }
+ }
+ }
+
}
spin_unlock_irqrestore(&span->chans[x].lock, flags);
}