diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-05-15 19:26:16 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2004-05-15 19:26:16 +0000 |
commit | bfe1d465365fbbead0b36b747daaffa47bc76dc3 (patch) | |
tree | ed36762d013617c3ddce94058c4b595d8a785b72 | |
parent | 1a8e6a9ca62be302d7c1b53ed9abe702d015268c (diff) |
Don't accept ring when there is no battery, print which ports things hapepn on
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@391 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rwxr-xr-x | wcfxs.c | 14 | ||||
-rwxr-xr-x | wctdm.c | 14 |
2 files changed, 14 insertions, 14 deletions
@@ -290,14 +290,14 @@ static inline void ring_check(struct wcfxs *wc, int card) if (!wc->mod.fxo.ring[card] && (wc->mod.fxo.pegcount[card] > PEGCOUNT)) { /* It's ringing */ if (debug) - printk("RING!\n"); + printk("RING on %d/%d!\n", wc->span.spanno, card + 1); zt_hooksig(&wc->chans[card], ZT_RXSIG_RING); wc->mod.fxo.ring[card] = 1; } if (wc->mod.fxo.ring[card] && !wc->mod.fxo.pegcount[card]) { /* No more ring */ if (debug) - printk("NO RING!\n"); + printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1); zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK); wc->mod.fxo.ring[card] = 0; } @@ -1193,14 +1193,14 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) #ifndef AUDIO_RINGCHECK if (!wc->mod.fxo.offhook[card]) { res = wcfxs_getreg(wc, card, 5); - if (res & 0x60) { + if ((res & 0x60) && wc->mod.fxo.battery[card]) { wc->mod.fxo.ringdebounce[card] += (ZT_CHUNKSIZE * 4); if (wc->mod.fxo.ringdebounce[card] >= ZT_CHUNKSIZE * 32) { if (!wc->mod.fxo.wasringing[card]) { wc->mod.fxo.wasringing[card] = 1; zt_hooksig(&wc->chans[card], ZT_RXSIG_RING); if (debug) - printk("RING!\n"); + printk("RING on %d/%d!\n", wc->span.spanno, card + 1); } wc->mod.fxo.ringdebounce[card] = ZT_CHUNKSIZE * 32; } @@ -1211,7 +1211,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) wc->mod.fxo.wasringing[card] =0; zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK); if (debug) - printk("NO RING!\n"); + printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1); } wc->mod.fxo.ringdebounce[card] = 0; } @@ -1236,7 +1236,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) #endif if (wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) { if (debug) - printk("NO BATTERY!\n"); + printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1); wc->mod.fxo.battery[card] = 0; #ifdef JAPAN if ((!wc->ohdebounce) && wc->offhook) { @@ -1256,7 +1256,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) } else if (abs(b) > BATT_THRESH) { if (!wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) { if (debug) - printk("BATTERY!\n"); + printk("BATTERY on %d/%d!\n", wc->span.spanno, card + 1); #ifdef ZERO_BATT_RING if (wc->onhook) { wc->onhook = 0; @@ -290,14 +290,14 @@ static inline void ring_check(struct wcfxs *wc, int card) if (!wc->mod.fxo.ring[card] && (wc->mod.fxo.pegcount[card] > PEGCOUNT)) { /* It's ringing */ if (debug) - printk("RING!\n"); + printk("RING on %d/%d!\n", wc->span.spanno, card + 1); zt_hooksig(&wc->chans[card], ZT_RXSIG_RING); wc->mod.fxo.ring[card] = 1; } if (wc->mod.fxo.ring[card] && !wc->mod.fxo.pegcount[card]) { /* No more ring */ if (debug) - printk("NO RING!\n"); + printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1); zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK); wc->mod.fxo.ring[card] = 0; } @@ -1193,14 +1193,14 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) #ifndef AUDIO_RINGCHECK if (!wc->mod.fxo.offhook[card]) { res = wcfxs_getreg(wc, card, 5); - if (res & 0x60) { + if ((res & 0x60) && wc->mod.fxo.battery[card]) { wc->mod.fxo.ringdebounce[card] += (ZT_CHUNKSIZE * 4); if (wc->mod.fxo.ringdebounce[card] >= ZT_CHUNKSIZE * 32) { if (!wc->mod.fxo.wasringing[card]) { wc->mod.fxo.wasringing[card] = 1; zt_hooksig(&wc->chans[card], ZT_RXSIG_RING); if (debug) - printk("RING!\n"); + printk("RING on %d/%d!\n", wc->span.spanno, card + 1); } wc->mod.fxo.ringdebounce[card] = ZT_CHUNKSIZE * 32; } @@ -1211,7 +1211,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) wc->mod.fxo.wasringing[card] =0; zt_hooksig(&wc->chans[card], ZT_RXSIG_OFFHOOK); if (debug) - printk("NO RING!\n"); + printk("NO RING on %d/%d!\n", wc->span.spanno, card + 1); } wc->mod.fxo.ringdebounce[card] = 0; } @@ -1236,7 +1236,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) #endif if (wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) { if (debug) - printk("NO BATTERY!\n"); + printk("NO BATTERY on %d/%d!\n", wc->span.spanno, card + 1); wc->mod.fxo.battery[card] = 0; #ifdef JAPAN if ((!wc->ohdebounce) && wc->offhook) { @@ -1256,7 +1256,7 @@ static inline void wcfxs_voicedaa_check_hook(struct wcfxs *wc, int card) } else if (abs(b) > BATT_THRESH) { if (!wc->mod.fxo.battery[card] && !wc->mod.fxo.battdebounce[card]) { if (debug) - printk("BATTERY!\n"); + printk("BATTERY on %d/%d!\n", wc->span.spanno, card + 1); #ifdef ZERO_BATT_RING if (wc->onhook) { wc->onhook = 0; |