[asterisk-bugs] [Zaptel 0008290]: [patch] zap hookstate is never set offhook if wctdm module is loaded with an active fxo line

noreply at bugs.digium.com noreply at bugs.digium.com
Thu Nov 29 10:17:19 CST 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8290 
====================================================================== 
Reported By:                tmarkov
Assigned To:                mattf
====================================================================== 
Project:                    Zaptel
Issue ID:                   8290
Category:                   wctdm
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     assigned
Zaptel Version:              1.2.10 
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             11-03-2006 17:28 CST
Last Modified:              11-29-2007 10:17 CST
====================================================================== 
Summary:                    [patch] zap hookstate is never set offhook if wctdm
module is loaded with an active fxo line
Description: 
If #define ZAP_CHECK_HOOKSTATE is uncommented in chan_zap.c, then the
hookstate stays onhook if the wctdm module is loaded with an active line. 
Removing line and reinserting will cause the hookstate to initialize
properly.  The problem appears to be that wc->mod[card].fxo.battery never
gets initialized to 0, so in wctdm_voicedaa_check_hook() the test "if
(!wc->mod[card].fxo.battery && !wc->mod[card].fxo.battdebounce)" is never
entered, and the hookstate remains onhook upon module startup.  Only a
cycling of line voltage will correct the problem.  I have attached a patch
which initializes the battery variable and fixes the problem for me.
====================================================================== 

---------------------------------------------------------------------- 
 meneault - 11-29-07 10:17  
---------------------------------------------------------------------- 
Hi flefoll,

I read your comments, your traces and your code. It's true that your
problem seems strange but I definitively think that this is a configuration
problem. We see that voicedaa_check_hook is correctly called but not my
routine which implies that abs(b) == battthresh regularly.
The behavior of wctdm in that case is to do nothing and reset battdebounce
counter (simply because value is considered as undetermined).

Your traces imply that during initialization the battery is greater than
battthresh and then after a while it gets values equal to battthresh.

I think that you are simply unlucky because your line battery voltage
periodically goes to 3V. Depending on your country it maybe a good value
but seem quite low for an on-hook line.
- What is supposed to be the right voltage for a on-hook line in your
country?
- Do you have any phones connected in parallel to your FXO port?
- Is the line really on-hook?

Anyway please load wctdm with battthresh=2 or 5 (and with my patch
applied).
It should work as soon as you get the right value for your line.

You may add to your traces the value of abs(b) so as to know how your line
battery voltage fluctuates. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
11-29-07 10:17  meneault       Note Added: 0074550                          
======================================================================




More information about the asterisk-bugs mailing list