Review Board 1.7.16

rmudgett got review request #4444!

chan_dahdi/sig_analog: Fix distinctive ring detection to suck less.

Review Request #4444 - Created Feb. 23, 2015 and submitted

The distinctive ring feature interferes with detecting Caller ID and
appears to have been broken for years.  What happens is if you have a
ring-ring cadence as used in the UK you get too many DAHDI events for the
distinctive ring pattern array and Caller ID detection is aborted.  I
think when Zapata/DAHDI added the ring begin event it broke distinctive
ring.  More events happen than before and the code does no filtering of
which event times are recorded in the pattern array.

* Made distinctive ring only record the ringt count when the ring ends
instead of on just any DAHDI event.  Distinctive ring can be ring,
ring-ring, ring-ring-ring, or different ring durations for the up to three

* Fixed the distinctive ring detection enable (chan_dahdi.conf option
usedistinctiveringdetection) to be per port instead of somewhat per port
and somewhat global.  This has been broken since v1.8.

* Fixed using the default distinctive ring context when the detected
pattern does not match any configured dringX patterns.  The default
context did not get set when the previous call was a matched distinctive
ring pattern and the current call is not matched.  This has been broken
since v1.8.

* Made distinctive ring have no effect on Caller ID detection when it is
disabled.  Caller ID detection just monitors for 10 seconds before giving

* Fixed leak of struct callerid_state memory when a polarity reversal
during Caller ID detection causes the incoming call to be aborted.
Tested the following scenarios for US (ring) and UK (ring-ring) ring cadences:
1) usedistinctiveringdetection=no
2) usedistinctiveringdetection=yes with distinctiveringaftercid=no
3) usedistinctiveringdetection=yes with distinctiveringaftercid=yes

* Caller-ID was detected for each call
* The configured distinctive ring dringX pattern was detected and the specified context set.
Review request changed
Updated (March 6, 2015, 3:22 p.m.)
  • changed from pending to submitted
Committed in revision 432572 runs on a server provided by Digium, Inc. and uses bandwidth donated to the open source Asterisk community by API Digital Communications in Huntsville, AL USA.
Please report problems with this site to