summaryrefslogtreecommitdiff
path: root/xpp/card_fxs.c
diff options
context:
space:
mode:
authortzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 22:51:19 +0000
committertzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2006-09-04 22:51:19 +0000
commit393ca276af8b3f2610ae82b1971fa0b5d2abb336 (patch)
tree5bea87c21db1086eb6c8644c47bfb05a1497e55c /xpp/card_fxs.c
parent9a69492b7a4fb3840bff33b59b81fac1d0b46f93 (diff)
Move all zt_hooksig(...{OFF,ON}HOOK) calls into update_line_status()
in xpp_zap.c git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1390 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/card_fxs.c')
-rw-r--r--xpp/card_fxs.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/xpp/card_fxs.c b/xpp/card_fxs.c
index 1264348..0050348 100644
--- a/xpp/card_fxs.c
+++ b/xpp/card_fxs.c
@@ -768,21 +768,17 @@ HANDLER_DEF(FXS, SIG_CHANGED)
if(IS_SET(xpd->digital_outputs, i) || IS_SET(xpd->digital_inputs, i))
continue;
if(IS_SET(sig_toggles, i)) {
- struct zt_chan *chan = &xpd->span.chans[i];
-
xpd->ringing[i] = 0; // No more ringing...
do_chan_power(xpd->xbus, xpd, BIT(i), 0); // When not ringing, VBAT is always Low
MARK_BLINK(priv,i,LED_GREEN,0);
if(IS_SET(sig_status, i)) {
- DBG("%s/%s/%d: OFFHOOK\n", xbus->busname, xpd->xpdname, chan->channo);
+ DBG("%s/%s/%d: OFFHOOK\n", xbus->busname, xpd->xpdname, i);
MARK_LED(priv,i,LED_GREEN,LED_ON);
- BIT_SET(xpd->hookstate, i);
- zt_hooksig(chan, ZT_RXSIG_OFFHOOK);
+ update_line_status(xpd, i, 1);
} else {
- DBG("%s/%s/%d: ONHOOK\n", xbus->busname, xpd->xpdname, chan->channo);
+ DBG("%s/%s/%d: ONHOOK\n", xbus->busname, xpd->xpdname, i);
MARK_LED(priv,i,LED_GREEN,LED_OFF);
- BIT_CLR(xpd->hookstate, i);
- zt_hooksig(chan, ZT_RXSIG_ONHOOK);
+ update_line_status(xpd, i, 0);
}
}
}
@@ -819,22 +815,18 @@ HANDLER_DEF(FXS, SLIC_REPLY)
for(i = 0; i < ARRAY_SIZE(input_channels); i++) {
int channo = input_channels[i];
int newchanno;
- struct zt_chan *chan;
if(IS_SET(lines, channo)) {
newchanno = LINES_REGULAR + LINES_DIGI_OUT + i;
BIT_CLR(lines, channo);
BIT_SET(lines, newchanno);
- chan = &xpd->span.chans[newchanno];
xpd->ringing[newchanno] = 0; // Stop ringing. No leds for digital inputs.
if(offhook && !IS_SET(xpd->hookstate, newchanno)) { // OFFHOOK
- DBG("OFFHOOK: channo=%d\n", chan->channo);
- BIT_SET(xpd->hookstate, newchanno);
- zt_hooksig(chan, ZT_RXSIG_OFFHOOK);
+ DBG("%s/%s/%d: OFFHOOK\n", xbus->busname, xpd->xpdname, newchanno);
+ update_line_status(xpd, newchanno, 1);
} else if(!offhook && IS_SET(xpd->hookstate, newchanno)) { // ONHOOK
- DBG("ONHOOK channo=%d\n", chan->channo);
- BIT_CLR(xpd->hookstate, newchanno);
- zt_hooksig(chan, ZT_RXSIG_ONHOOK);
+ DBG("%s/%s/%d: ONHOOK\n", xbus->busname, xpd->xpdname, newchanno);
+ update_line_status(xpd, newchanno, 0);
}
}
}