summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-31 22:58:37 +0000
committerjim <jim@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2004-05-31 22:58:37 +0000
commit20c1b4ccb4d8c659ddcbda7d89b507512cf09d24 (patch)
tree7e42a8463ca0e03e0504f2348d2a6fb4bc68ab4c
parent90c3049b6685b7407f61b403b4945b6044495a14 (diff)
Added DPO (Loop Closure/E&M) signalling support and fixed loop detect debounce for FXS/DPO module
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@405 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-xwcfxs.c18
-rwxr-xr-xwctdm.c18
2 files changed, 26 insertions, 10 deletions
diff --git a/wcfxs.c b/wcfxs.c
index d02017d..251443d 100755
--- a/wcfxs.c
+++ b/wcfxs.c
@@ -1339,7 +1339,7 @@ static inline void wcfxs_proslic_check_hook(struct wcfxs *wc, int card)
hook = (res & 1);
if (hook != wc->mod.fxs.lastrxhook[card]) {
/* Reset the debounce (must be multiple of 4ms) */
- wc->mod.fxs.debounce[card] = 3 * 4 * 8;
+ wc->mod.fxs.debounce[card] = 8 * (4 * 8);
#if 0
printk("Resetting debounce card %d hook %d, %d\n", card, hook, wc->mod.fxs.debounce[card]);
#endif
@@ -1512,6 +1512,7 @@ static int wcfxs_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
switch(txsig) {
case ZT_TXSIG_ONHOOK:
switch(chan->sig) {
+ case ZT_SIG_EM:
case ZT_SIG_FXOKS:
case ZT_SIG_FXOLS:
wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
@@ -1522,7 +1523,14 @@ static int wcfxs_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
}
break;
case ZT_TXSIG_OFFHOOK:
- wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
+ switch(chan->sig) {
+ case ZT_SIG_EM:
+ wc->mod.fxs.lasttxhook[chan->chanpos-1] = 5;
+ break;
+ default:
+ wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
+ break;
+ }
break;
case ZT_TXSIG_START:
wc->mod.fxs.lasttxhook[chan->chanpos-1] = 4;
@@ -1552,7 +1560,7 @@ static int wcfxs_initialize(struct wcfxs *wc)
wc->span.deflaw = ZT_LAW_MULAW;
for (x=0;x<wc->cards;x++) {
sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF;
+ wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM;
wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF;
wc->chans[x].chanpos = x+1;
wc->chans[x].pvt = wc;
@@ -1584,7 +1592,7 @@ static void wcfxs_post_initialize(struct wcfxs *wc)
if (wc->modtype[x] == MOD_TYPE_FXO)
wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF;
else
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF;
+ wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM;
}
}
}
@@ -1684,7 +1692,7 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
/* Init with Auto Calibration */
if (!(ret=wcfxs_init_proslic(wc, x, 0, 0, sane))) {
wc->cardflag |= (1 << x);
- printk("Module %d: Installed -- AUTO FXS\n",x);
+ printk("Module %d: Installed -- AUTO FXS/DPO\n",x);
} else {
if(ret!=-2) {
sane=1;
diff --git a/wctdm.c b/wctdm.c
index d02017d..251443d 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -1339,7 +1339,7 @@ static inline void wcfxs_proslic_check_hook(struct wcfxs *wc, int card)
hook = (res & 1);
if (hook != wc->mod.fxs.lastrxhook[card]) {
/* Reset the debounce (must be multiple of 4ms) */
- wc->mod.fxs.debounce[card] = 3 * 4 * 8;
+ wc->mod.fxs.debounce[card] = 8 * (4 * 8);
#if 0
printk("Resetting debounce card %d hook %d, %d\n", card, hook, wc->mod.fxs.debounce[card]);
#endif
@@ -1512,6 +1512,7 @@ static int wcfxs_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
switch(txsig) {
case ZT_TXSIG_ONHOOK:
switch(chan->sig) {
+ case ZT_SIG_EM:
case ZT_SIG_FXOKS:
case ZT_SIG_FXOLS:
wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
@@ -1522,7 +1523,14 @@ static int wcfxs_hooksig(struct zt_chan *chan, zt_txsig_t txsig)
}
break;
case ZT_TXSIG_OFFHOOK:
- wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
+ switch(chan->sig) {
+ case ZT_SIG_EM:
+ wc->mod.fxs.lasttxhook[chan->chanpos-1] = 5;
+ break;
+ default:
+ wc->mod.fxs.lasttxhook[chan->chanpos-1] = wc->mod.fxs.idletxhookstate[chan->chanpos-1];
+ break;
+ }
break;
case ZT_TXSIG_START:
wc->mod.fxs.lasttxhook[chan->chanpos-1] = 4;
@@ -1552,7 +1560,7 @@ static int wcfxs_initialize(struct wcfxs *wc)
wc->span.deflaw = ZT_LAW_MULAW;
for (x=0;x<wc->cards;x++) {
sprintf(wc->chans[x].name, "WCTDM/%d/%d", wc->pos, x);
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF;
+ wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM;
wc->chans[x].sigcap |= ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF;
wc->chans[x].chanpos = x+1;
wc->chans[x].pvt = wc;
@@ -1584,7 +1592,7 @@ static void wcfxs_post_initialize(struct wcfxs *wc)
if (wc->modtype[x] == MOD_TYPE_FXO)
wc->chans[x].sigcap = ZT_SIG_FXSKS | ZT_SIG_FXSLS | ZT_SIG_SF;
else
- wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF;
+ wc->chans[x].sigcap = ZT_SIG_FXOKS | ZT_SIG_FXOLS | ZT_SIG_FXOGS | ZT_SIG_SF | ZT_SIG_EM;
}
}
}
@@ -1684,7 +1692,7 @@ static int wcfxs_hardware_init(struct wcfxs *wc)
/* Init with Auto Calibration */
if (!(ret=wcfxs_init_proslic(wc, x, 0, 0, sane))) {
wc->cardflag |= (1 << x);
- printk("Module %d: Installed -- AUTO FXS\n",x);
+ printk("Module %d: Installed -- AUTO FXS/DPO\n",x);
} else {
if(ret!=-2) {
sane=1;