diff options
author | Shaun Ruffell <sruffell@digium.com> | 2009-08-14 00:46:26 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2009-08-14 00:46:26 +0000 |
commit | ca98237e00f09f327fe3a227fca304c0ada272e9 (patch) | |
tree | 3a426b68151c33e91b5e6528b135350768be8923 /drivers/dahdi/wctdm24xxp/base.c | |
parent | e12e4475e2e1643d3d11d6ddf1c20b67fa0b9cde (diff) |
wctdm24xxp, wctdm: Detect if our hookstate has been set back to the initial state.
Check if our hookstate has been set back to the initial state, typically the
result of a chanconfig, and if so, if we're an FXO port, forget our current
battery state. This allows the driver to determine and report again what the
hook state of the port is.
(related to issue #14577)
(closes issue #15429)
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@7003 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/wctdm24xxp/base.c')
-rw-r--r-- | drivers/dahdi/wctdm24xxp/base.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c index 9715c67..65ff54d 100644 --- a/drivers/dahdi/wctdm24xxp/base.c +++ b/drivers/dahdi/wctdm24xxp/base.c @@ -1405,6 +1405,21 @@ static inline void wctdm_voicedaa_check_hook(struct wctdm *wc, int card) } } + if (unlikely(DAHDI_RXSIG_INITIAL == wc->chans[card]->rxhooksig)) { + /* + * dahdi-base will set DAHDI_RXSIG_INITIAL after a + * DAHDI_STARTUP or DAHDI_CHANCONFIG ioctl so that new events + * will be queued on the channel with the current received + * hook state. Channels that use robbed-bit signalling always + * report the current received state via the dahdi_rbsbits + * call. Since we only call dahdi_hooksig when we've detected + * a change to report, let's forget our current state in order + * to force us to report it again via dahdi_hooksig. + * + */ + fxo->battery = BATTERY_UNKNOWN; + } + if (abs_voltage < battthresh) { /* possible existing states: battery lost, no debounce timer |