[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
Mon Dec 3 09:51:40 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:              12-03-2007 09:51 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 - 12-03-07 09:51  
---------------------------------------------------------------------- 
Sorry flefoll, I think we are just communicating almost real-time, I didn't
see your previous post.

wctdm-race-1.4-rev3211 was made to correct the first issue : "BATTERY"
message not printed out when loading driver (when AUDIO_RINGCHECK not
enabled) (see Additional information in bug description).
fxo.battery = -1 was made to correct another problem that was not reported
if no line is connected then at load time "NO BATTERY" was not printed out
neither.
I agree that I could have made this line into another patch wctdm-race2
but I included it into wctdm-hooksig.

wctdm-hooksig is the main issue (the one you expect to be corrected).
About checking the value of rxhooksig at the end of voice_daa_check_hook,
the problem lies in design consideration and locking. This is not wctdm
business to deal with this member (rxhooksig is internal to zaptel-base
from my point of view). And if you really want to check it, to do it safely
you should lock on the channel's lock before attempting to access
rxhooksig.
But obviously it could be done that way, If other agree that rxhooksig can
be considered 'public' to other drivers. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
12-03-07 09:51  meneault       Note Added: 0074680                          
======================================================================




More information about the asterisk-bugs mailing list