[Asterisk-bugs] [Asterisk 0008066]: [patch] hanguponpolarityswitch hangs up on incoming call during ring phase

noreply at bugs.digium.com noreply at bugs.digium.com
Wed Jul 11 06:07:35 CDT 2007


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=8066 
====================================================================== 
Reported By:                jared
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   8066
Category:                   Channels/chan_zap
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     ready for testing
Asterisk Version:            SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 44144 
Disclaimer on File?:        Yes 
Request Review:              
====================================================================== 
Date Submitted:             10-02-2006 02:17 CDT
Last Modified:              07-11-2007 06:07 CDT
====================================================================== 
Summary:                    [patch] hanguponpolarityswitch hangs up on incoming
call during ring phase
Description: 
I am in Australia and use Telstra as my provider. During the ringing phase
of the call I see reversal of polarities, which asterisk interprets
incorrectly. It assumes that the polarity reversal during the ring phase
means that the caller has hung up. This is definitely not the case.
(Telstra may be sending the polarity reversal for good reason during the
ring phase, i just don't know what that reason might be though). 

Below in (Appendix 1: Zaptel Driver Log) the zaptel driver debug output
showing the polarity reversals as they come from the Telstra exchange. In
the example, I ring from an outside phone into the the zaptel line and just
let it ring... no one inside answers. 

When asterisk finds the polarity reversal during this ring phase it does a
ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT) of the incoming channel
see (Appendix 2:  chan_zap.c source code fragment). I think the purpose of
this is so that it will stop ringing extensions that may have started
ringing immediately, so that the users wont pick a call which has actually
stopped ringing but asterisk hasn't detected that fact yet.

I suspect that other users of the reverseonpolarityswitch feature don't
have exchanges that generate these polarity events during the ring phase.

I have made a patch which I have attached that works for my purposes, but
I'm not sure how to go about making it work in a more general sense with
what I think the existing code is trying to achieve. 

I would like to ask how people think this could be improved so that it
could be included in the svn trunk without breaking the existing features.

I have 2 ideas:

1) Add a new config option in zapata.conf. 

nohanguponpolarityswitchinringphase=yes

2) Some how find an alogithm that detects real hangups during ringing
phase rather than just these random reversal pulses.

Any ideas welcome.

Thanks


====================================================================== 

---------------------------------------------------------------------- 
 irroot - 07-11-07 06:07  
---------------------------------------------------------------------- 
i have a similar problem to this i added gaurd time that it will ignore
polarity reversal for at least Xms after answer this is also helped with
some braidead cell routers that send a 800ms pulse on answer and hangup ie
polarity changes 2 in 800ms for answer and hangup.

i enable answer on polarity with a 800ms guard to ignore the second switch
if hangup occurs during this period ill get the second pulse of the hangup
after 800ms so all is good and the line hangs up.

ill be posting this solution shortly. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-11-07 06:07  irroot         Note Added: 0067103                          
======================================================================




More information about the Asterisk-bugs mailing list