[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
Tue Jan 15 13:36:43 CST 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8290 
====================================================================== 
Reported By:                tmarkov
Assigned To:                kpfleming
====================================================================== 
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:              01-15-2008 13:36 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 - 01-15-08 13:36  
---------------------------------------------------------------------- 
>They can't apply anymore to zaptel 1.4.8 (rejects for wctdm.c and
>wctdm24xxp/base.c) but I tested them with an extract from SVN that I got
>yesterday. 

kpfleming just changed wctdm.c and wctdm24xxp/base.c yesterday revision
3688. So  you should test them with zaptel 1.4 revision 3682 until I update
them once more.
And you don't have to apply 8290-alarm-zaptel-base-c it was just a remark
for kpfleming (applying it or not shouldn't change the issue).

>I can't even do an outgoing call anymore (although the original SVN
extract >runs fine, apart from the original line state detection ;-) ) :
"Unable to >create channel of type 'ZAP'" ... until I disconnect/reconnect
a line.
>menault: can you give us the result of your own tests ? Maybe I missed
>something ?

You are the first one to test them (as I mentioned I still not tested them
I only compiled them and the rest is pure logic... Sometimes logic is not
so good though. I may have made a mistake even If I hardly see where the
problem lies because I made these new patches almost identical as the one I
am running now.)

>meneault: your patch adds alarms, but I'm afraid there's a slight
mismatch >somewhere. When I disconnect/reconnect the line, Asterisk CLI
displays this :
>Disconnect =>
>    Detected alarm on channel 34: No Alarm

This looks correct it detected an alarm that's good. However I think it
should be 'Red Alarm' rather than 'No Alarm'.

>Reconnect =>
>    handle_init_event: Alarm cleared on channel 34

And this trace is definitively correct.

I guess you didn't try it with latest revision from asterisk trunk, did
you?
What I know is that it is only supposed to work with one of the latest
revision of asterisk (the one that contains the latest kpfleming's
changes).

For now asterisk trunk is not accessible so I can't make any test but I'll
check that this week-end (I'll produce new patches for latest zaptel
revision also). 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
01-15-08 13:36  meneault       Note Added: 0076988                          
======================================================================




More information about the asterisk-bugs mailing list