summaryrefslogtreecommitdiff
path: root/drivers/dahdi/wctdm.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2009-08-14 00:46:26 +0000
committerShaun Ruffell <sruffell@digium.com>2009-08-14 00:46:26 +0000
commitbf484fbac87d404573175d320d55b887ab0ef9c1 (patch)
tree3a426b68151c33e91b5e6528b135350768be8923 /drivers/dahdi/wctdm.c
parentc7d5d0ea2be3f94c93963d047e56dd677fdcfbb0 (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/wctdm.c')
-rw-r--r--drivers/dahdi/wctdm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dahdi/wctdm.c b/drivers/dahdi/wctdm.c
index 49ed741..3bc4e8f 100644
--- a/drivers/dahdi/wctdm.c
+++ b/drivers/dahdi/wctdm.c
@@ -842,6 +842,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(b) < battthresh) {
/* possible existing states:
battery lost, no debounce timer