[asterisk-dev] [Code Review] chan_dahdi: Add dialtonedetect option

rmudgett reviewboard at asterisk.org
Mon Feb 13 14:55:47 CST 2012


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



trunk/channels/chan_dahdi.c
<https://reviewboard.asterisk.org/r/1737/#comment10108>

    Magic value used here.
    
    You should investigate how p->cidcwexpire operates in terms of number of samples:
    #define CIDCW_EXPIRE_SAMPLES	((500 * 8) / READ_SIZE) /*!< 500 ms */
    



trunk/channels/chan_dahdi.c
<https://reviewboard.asterisk.org/r/1737/#comment10106>

    This code will break the dialtone detection for outgoing calls checked later.  (See code dealing with p->waitingfordt)



trunk/channels/chan_dahdi.c
<https://reviewboard.asterisk.org/r/1737/#comment10105>

    This could be expressed better as:
    if (!strcasecmp(v->value, "always")) {
    	confp->chan.dialtonedetect = -1;
    } else if (ast_true(v->value)) {
    	confp->chan.dialtonedetect = 10000;
    } else if (ast_false(v->value)) {
    	confp->chan.dialtonedetect = 0;
    } else {
    	confp->chan.dialtonedetect = ast_strlen_zero(v->value) ? 0 : atoi(v->value);
    }
    



trunk/configs/chan_dahdi.conf.sample
<https://reviewboard.asterisk.org/r/1737/#comment10109>

    Note that this option is intended for analog lines only.



trunk/configs/chan_dahdi.conf.sample
<https://reviewboard.asterisk.org/r/1737/#comment10104>

    I really would prefer the name to have underbars between words for easier readability: dialtone_detect



trunk/include/asterisk/frame.h
<https://reviewboard.asterisk.org/r/1737/#comment10107>

    Update for new frame control value:
    frame.c:ast_frame_dump()
    func_frame_trace.c:print_frame()
    
    also you need to fix the compile warnings as a result of the new enum value.
    
    Since chan_dahdi is the only channel driver that cares about detecting dialtone, you may want to reconsider adding a control frame that must be handled by code outside of the channel driver.


- rmudgett


On Feb. 13, 2012, 1:33 p.m., Jeremy Pepper wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1737/
> -----------------------------------------------------------
> 
> (Updated Feb. 13, 2012, 1:33 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> chan_dahdi: Add dialtonedetect option
> 
> This adds an option to chan_dahdi.conf called dialtonedetect. This can be set like this:
> 
>     dialtonedetect = yes ; Watch for dialtone for 10 seconds after answer
>     dialtonedetect = always ; Watch for dialtone for the whole call
>     dialtonedetect = 5000 ; Watch for dialtone for 5000ms
> 
> If dialtone is detected on an inbound call, Asterisk will hang up the channel.
> 
> 
> This addresses bug ASTERISK-19316.
>     https://issues.asterisk.org/jira/browse/ASTERISK-19316
> 
> 
> Diffs
> -----
> 
>   trunk/channels/chan_dahdi.c 354459 
>   trunk/configs/chan_dahdi.conf.sample 354459 
>   trunk/include/asterisk/frame.h 354459 
>   trunk/main/dsp.c 354459 
> 
> Diff: https://reviewboard.asterisk.org/r/1737/diff
> 
> 
> Testing
> -------
> 
> This patch has been installed on an Asterisk box connected to another Asterisk box simulating an upstream carrier. Testing was done with dialtonedetect off, set to always, set to yes, and set to a custom value.
> 
> 
> Thanks,
> 
> Jeremy
> 
>

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


More information about the asterisk-dev mailing list