[Home]

Summary:ASTERISK-14655: [patch] Distinctive ring detection not working. Exits after first cadence
Reporter:Alec Davis (alecdavis)Labels:
Date Opened:2009-08-13 22:54:40Date Closed:2010-07-19 09:39:07
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_dahdi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) bug15718.patch
( 1) chan_dahdi_dring.diff.txt
Description:ARRAYLEN(ringdata) before call to my_distinctive_ring=3, but inside my_distincetive_ring=1, so have hardcoded 3. (must be a better way!)


****** ADDITIONAL INFORMATION ******

/etc/asterisk/chan_dahdi.conf
...
;usedistinctiveringdetection=yes
;
; enable dring detection after caller ID for those countries like Australia
; where the ring cadence is changed *after* the caller ID spill:
;
distinctiveringaftercid=yes
;
; Whether or not to use caller ID:
;
usecallerid=yes
...  

Comments:By: Alec Davis (alecdavis) 2009-08-13 22:55:23

uploaded chan_dahdi_dring.diff.txt

if dringXcontext=internalX wasn't set, the dial plan would wipe out default context.
core show channels, after first call had an empty defcontext.

print 'Detected ring pattern, 300,200,100' to aid in distinctive ring setup.

By: Alec Davis (alecdavis) 2009-09-09 05:10:47

chatted with jpeeler on IRC a few weeks ago.
I thought he may have assigned this to himself?

By: Jeff Peeler (jpeeler) 2010-06-28 17:08:18

Since ARRAY_LEN won't work here, I've just defined the size. I don't think I have a way to test with distinctiveringaftercid turned on, so Alec can you verify the attached patch works correctly?

By: Alec Davis (alecdavis) 2010-07-12 05:27:54

after setting chan_dahdi.conf with following values, using SVN-trunk-r275551, with distinctiveringaftercid=yes enabled, didn't need the patch.

in chan_dahdi.conf<pre>[channels]
....
; Distinctive Ring 1 - Forwarded Calls
cadence=400,400,200,200,400,1400
; Distinctive Ring 2 - Selective Ring 2 + Operator + Recall
cadence=400,400,200,2000
; Distinctive Ring 3 - Multiple Subscriber Number 1
cadence=200,200,400,2200
; Distinctive Ring 4 - Selective Ring 1 + Centrex
cadence=400,2600
; Distinctive Ring 5 - Selective Ring 3
cadence=400,400,200,400,200,1400
; Distinctive Ring 6 - Multiple Subscriber Number 2
cadence=200,400,200,200,400,1600
; Distinctive Ring 7 - Multiple Subscriber Number 3 + Data Privacy
cadence=200,400,200,400,200,1600

....

dring1=247,337,277
dring1context=internal1
dring1range=10
dring2=247,366,277
dring2context=internal2
dring2range=10
dring3=97,247,147
dring3context=internal3
dring3range=10</pre>
Hardware setup:
 TE121 channles 1-31
 TDM800P
   channel 32 (FXS module)
   channel 37 (FXO module)

The dialplan;
exten => 71,1,Dial(DAHDI/32r1)  ;Garage -> (LoopIn)
exten => 72,1,Dial(DAHDI/32r2)  ;Garage -> (LoopIn)
exten => 73,1,Dial(DAHDI/32r3)  ;Garage -> (LoopIn)
exten => 74,1,Dial(DAHDI/32r4)  ;Garage -> (LoopIn)
exten => 75,1,Dial(DAHDI/32r5)  ;Garage -> (LoopIn)
exten => 76,1,Dial(DAHDI/32r6)  ;Garage -> (LoopIn)
exten => 77,1,Dial(DAHDI/32r7)  ;Garage -> (LoopIn)

console output:

asterix*CLI> dahdi show cadences
r1: 400,400,200,200,400,1400
r2: 400,400,200,2000
r3: 200,200,400,2200
r4: 400,2600
r5: 400,400,200,400,200,1400
r6: 200,400,200,200,400,1600
r7: 200,400,200,400,200,1600

   -- Starting simple switch on 'DAHDI/35-1'
   -- Executing [71@phones:1] Dial("DAHDI/35-1", "DAHDI/32r1") in new stack
   -- Called 32r1
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Starting simple switch on 'DAHDI/37-1'
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Detecting post-CID distinctive ring
   -- DAHDI/32-1 is ringing
[Jul 12 22:25:29] NOTICE[11604]: chan_dahdi.c:1776 my_distinctive_ring: Got event 2 (Ring/Answered)...
   -- Detected ring pattern: 247,337,277
   -- Checking 247,337,277
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 237 to 257
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 327 to 347
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 267 to 287
   -- Distinctive Ring matched context internal1
   -- Executing [s@internal1:1] NoOp("DAHDI/37-1", "callerid="" <>") in new stack
   -- Executing [s@internal1:2] Wait("DAHDI/37-1", "10") in new stack
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Hanging up on 'DAHDI/32-1'
   -- Hungup 'DAHDI/32-1'
 == Spawn extension (phones, 71, 1) exited non-zero on 'DAHDI/35-1'
   -- Hanging up on 'DAHDI/35-1'
   -- Hungup 'DAHDI/35-1'



By: Alec Davis (alecdavis) 2010-07-12 05:35:11

and correct distinctive ring 3 match console output:

asterix*CLI>
   -- Starting simple switch on 'DAHDI/35-1'
   -- Executing [73@phones:1] Dial("DAHDI/35-1", "DAHDI/32r3") in new stack
   -- Called 32r3
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Starting simple switch on 'DAHDI/37-1'
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Detecting post-CID distinctive ring
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
[Jul 12 22:34:10] NOTICE[11657]: chan_dahdi.c:1776 my_distinctive_ring: Got event 2 (Ring/Answered)...
   -- Detected ring pattern: 97,247,147
   -- Checking 247,337,277
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Checking 247,366,277
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Checking 97,247,147
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 87 to 107
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 237 to 257
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 137 to 157
   -- Distinctive Ring matched context internal3
   -- Executing [s@internal3:1] NoOp("DAHDI/37-1", "callerid="" <>") in new stack
   -- Executing [s@internal3:2] Wait("DAHDI/37-1", "10") in new stack
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Hanging up on 'DAHDI/32-1'
   -- Hungup 'DAHDI/32-1'
 == Spawn extension (phones, 73, 1) exited non-zero on 'DAHDI/35-1'
   -- Hanging up on 'DAHDI/35-1'
   -- Hungup 'DAHDI/35-1'
asterix*CLI>

By: Alec Davis (alecdavis) 2010-07-12 06:27:46

with patch, patterns have changed, but I could probably get them to match again:
have an additional small debug print prefixed with ALEC

   -- Starting simple switch on 'DAHDI/35-1'
   -- Executing [71@phones:1] Dial("DAHDI/35-1", "DAHDI/32r1") in new stack
   -- Called 32r1
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Starting simple switch on 'DAHDI/37-1'
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
   -- Detecting post-CID distinctive ring
   -- DAHDI/32-1 is ringing
[Jul 12 23:21:59] NOTICE[18883]: chan_dahdi.c:1776 my_distinctive_ring: Got event 2 (Ring/Answered)...
   -- ALEC receivedRingT=0 ringt=247
[Jul 12 23:21:59] NOTICE[18883]: chan_dahdi.c:1776 my_distinctive_ring: Got event 18 (Ring Begin)...
   -- ALEC receivedRingT=1 ringt=237
   -- DAHDI/32-1 is ringing
   -- DAHDI/32-1 is ringing
[Jul 12 23:22:00] NOTICE[18883]: chan_dahdi.c:1776 my_distinctive_ring: Got event 2 (Ring/Answered)...
   -- ALEC receivedRingT=2 ringt=187
   -- Detected ring pattern: 247,237,187
   -- Checking 247,337,277
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 237 to 257
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Checking 247,366,277
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 237 to 257
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Checking 97,247,147
   -- Ring pattern check range: 10
   -- Ring pattern check range: 10
   -- Ring pattern matched in range: 237 to 257
   -- Ring pattern check range: 10

By: Jeff Peeler (jpeeler) 2010-07-13 14:50:48

How do the ring timings compare with the patch against 1.6.2? The limited amount that I could test when originally working on this I made sure the timings were the same.

By: Digium Subversion (svnbot) 2010-07-19 09:39:07

Repository: asterisk
Revision: 277837

U   trunk/channels/chan_dahdi.c
U   trunk/channels/sig_analog.c
U   trunk/channels/sig_analog.h

------------------------------------------------------------------------
r277837 | jpeeler | 2010-07-19 09:39:06 -0500 (Mon, 19 Jul 2010) | 12 lines

Fix regression with distinctive ring detection.

The issue here is that passing an array to a function prohibits the ARRAY_LEN
macro from returning the real size. To avoid this the size is now defined and
use of ARRAY_LEN is avoided.

(closes issue ASTERISK-14655)
Reported by: alecdavis
Patches:
     bug15718.patch uploaded by jpeeler (license 325)


------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=277837