[asterisk-dev] [Code Review]: dsp.c: dtmf_detect, Fix multiple issues when no-interdigit delay is present.

Alec Davis reviewboard at asterisk.org
Tue Sep 4 21:17:45 CDT 2012



> On Sept. 4, 2012, 2:26 p.m., rmudgett wrote:
> > trunk/main/dsp.c, line 813
> > <https://reviewboard.asterisk.org/r/2085/diff/6/?file=31134#file31134line813>
> >
> >     You can unconditionally set this to 1 here.

However to be strictly as the original r349249 was, it allowed hits_to_begin to be as low as 1.
So this is required, the double setting of 'hits' only happens when a new digit is started.

                if (hit != s->td.dtmf.lasthit) {
                        s->td.dtmf.lasthit = hit;
                        s->td.dtmf.hits = 0;  << this presetting setting of 'hits' is perhaps unavoidable 
                }
                if (hit && hit != s->td.dtmf.current_hit) {
                        s->td.dtmf.hits++;
                        if (s->td.dtmf.hits == s->td.dtmf.hits_to_begin) {
                                store_digit(s, hit);
                                s->td.dtmf.current_hit = hit;
                                s->td.dtmf.misses = 0;
                        }
                }


- Alec


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


On Sept. 1, 2012, 2:59 a.m., Alec Davis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2085/
> -----------------------------------------------------------
> 
> (Updated Sept. 1, 2012, 2:59 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> Document DTMF events for different sequences.
> 
> * Fix extra hit required when new DIGIT is sent without any interdigit delay.
> * Fix when DTMF_HITS_TO_BEGIN = 2, and no interdigit gap, that BEGIN is posted. 
> * Fix situation where a flakey detect, would clear the current_hit (indicating an END), which may not have been the case.
> 
> 
> Diffs
> -----
> 
>   trunk/main/dsp.c 371689 
> 
> Diff: https://reviewboard.asterisk.org/r/2085/diff
> 
> 
> Testing
> -------
> 
> On production box for 24 hours. 888 digit's now received.
> 
> The change here doesn't affect normal tone on/tone off, it changes the case when no interdigit pause is received between 2 digits, now the 2 digit has the same detect time as if there had been an interdigit pause before hand.
> 
> 
> Thanks,
> 
> Alec
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120905/4d10ee5a/attachment.htm>


More information about the asterisk-dev mailing list