[asterisk-dev] [Code Review] National prefix inserted even when caller ID not available

dimas at dataart.com dimas at dataart.com
Mon Apr 13 17:25:27 CDT 2009


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://reviewboard.digium.com/r/220/#review692
-----------------------------------------------------------



/trunk/channels/chan_dahdi.c
<http://reviewboard.digium.com/r/220/#comment1785>

    There are three invocations of this function in the code. The one is already guarded, second is guarded by your patch and the third remains.
    
    The question is: would not it be better if we just modify the function to do 
    
    if (ast_strlen_zero(number)) {
        if (size) {
            *buf = '\0';
        }
        return;
    }
    
    at the very beginning?
    
    This will both fix your case as well as let simplify the first invocation because it lets omitting 
    
    if (!ast_strlen_zero(e->ring.callingani)) {
    ...
    } else {
    pri->pvts[chanpos]->cid_ani[0] = '\0';
    }
    
    
    And the same applies to ss7_apply_plan_to_number and its invocations...


- dimas


On 2009-04-13 12:09:42, David Vossel wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.digium.com/r/220/
> -----------------------------------------------------------
> 
> (Updated 2009-04-13 12:09:42)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> When the caller ID is restricted, the expected behavior is for the caller id to be blank.  In chan_dahdi, the national prefix is placed onto the callers number even if its restricted (empty) causing the caller id to be the national prefix rather than blank.  
> 
> For example. national prefix is 0, caller number is blank, caller id displays '0' rather than nothing.
> log message of issue: [Jul 30 09:07:11] VERBOSE[3843] logger.c:     -- Accepting call from '0' to '1237' on channel 0/1, span 1
> 
> Solution: check to see if callingnum is blank before calling apply_plan_to_number() function which applies the nation_prefix. 
> 
> 
> This addresses bug 13207.
>     http://bugs.digium.com/view.php?id=13207
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_dahdi.c 188070 
> 
> Diff: http://reviewboard.digium.com/r/220/diff
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> David
> 
>




More information about the asterisk-dev mailing list