[asterisk-dev] [Code Review] refactor dsp.c that can no longer detect a quick DTMF sequence.

rmudgett reviewboard at asterisk.org
Thu Aug 30 15:19:03 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2084/#review6979
-----------------------------------------------------------


Looks good.  Only comment is about the possibility to stretch digits as shown for the Start E that I point out.


trunk/main/dsp.c
<https://reviewboard.asterisk.org/r/2084/#comment13583>

    E is stretched here.  Maybe two in a row to Start and two misses to end.



trunk/main/dsp.c
<https://reviewboard.asterisk.org/r/2084/#comment13584>

    Maybe change to make 2 misses end any digit:
    if (s->td.dtmf.lasthit != s->td.dtmf.current_hit) {
    	/* 2 misses of current_hit */
    	if (hit == s->td.dtmf.lasthit) {
    		/* 2 of the same, either a BEGIN or END digit */
    		if (hit) {
    			store_digit(s, hit);
    		}
    		s->td.dtmf.current_hit = hit;
    	} else {
    		/* 2 misses ends current digit */
    		s->td.dtmf.current_hit = 0;
    	}
    }
    


- rmudgett


On Aug. 26, 2012, 2:20 a.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2084/
> -----------------------------------------------------------
> 
> (Updated Aug. 26, 2012, 2:20 a.m.)
> 
> 
> Review request for Asterisk Developers, rmudgett and Jason Parker.
> 
> 
> Summary
> -------
> 
> Use a simpler method to detect changes in DTMF ON/OFF tones.
> 
> Similar method to latest spandsp/dtmf.c
> 
>    We must detect 2 silences for DTMF END.
> 
> 
> Reverts some of 111022 that added DTMF_HITS_TO_BEGIN and DTMF_MISSES_TO_END
> 
> Exisiting dtmf events with;
> /* hits_to_begin = 3, misses to end = 2 */
> /* --------A    hits=1, misses=1, lasthit='A'
>  * -------AA    hits=2
>  * ------AAA    hits=3, store_digit, current_hit='A',	BEGIN A
>  * -----AAA-    hits=1, misses=1, lasthit=' '
>  * ----AAA--    misses=2, current_hit=' ', 		END A
>  * ---AAA--B    hits=1, misses=1, lasthit='B'
>  * --AAA--BB    hits=2
>  * -AAA--BBB    hits=3, store_digit, current_hit='B',	BEGIN B
>  * AAA--BBB-    hits=1, misses=1, lasthit=' '
>  * AA--BBB-B    hits=1, misses=1, lasthit='B'
>  * A--BBB-BB    digitlen += GSIZE
>  *              deal with an interruption
>  * --BBB-BB-    hits=1, misses=1, lasthit=' '
>  * -BBB-BB-B    hits=1, misses=1, lasthit='B'
>  * BBB-BB-BB    digitlen += GSIZE
>  *              deal with no interdigit pause
>  * BB-BB-BBC    hits=1, misses=1, lasthit='C'
>  * B-BB-BBCC    current_hit=' ',			END B
>  * -BB-BBCCC    hits=2
>  * BB-BBCCCC    hits=3, store_digit, current_hit='C',	BEGIN C
>  */
> 
> 
> How it would be without, hits_to_begin, and misses_to_end
> 
> /*  ------AA    Begin A
>  *  -----AA-    no change
>  *  ----AA--    End A
>  *  ---AA--B    no change
>  *  --AA--BC    no change
>  *  -AA--BCC    Start C
>  *  AA--BCCD    no change
>  *  A--BCCDD    Start D
>  *  --BCCDD-    no change
>  *  -BCCDD-E    no change
>  *  BCCDD-EE    Start E
>  *  CCDD-EE-    no change
>  *  CDD-EE-F    no change
>  *  DD-EE-F-    no change
>  *  D-EE-F--    End E
>  */
> 
> 
> This addresses bugs ASTERISK-17493 and ASTERISK-19610.
>     https://issues.asterisk.org/jira/browse/ASTERISK-17493
>     https://issues.asterisk.org/jira/browse/ASTERISK-19610
> 
> 
> Diffs
> -----
> 
>   trunk/main/dsp.c 371649 
> 
> Diff: https://reviewboard.asterisk.org/r/2084/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120830/93b5ed8b/attachment-0001.htm>


More information about the asterisk-dev mailing list