[asterisk-dev] [Code Review]: get_pai function doesnt work correct, using reqresp_parser functions solves this problem

schmidts reviewboard at asterisk.org
Tue Jan 17 06:42:27 CST 2012



> On Jan. 17, 2012, 6:17 a.m., wdoekes wrote:
> > team/schmidts/unleash-the-beast/channels/chan_sip.c, line 14871
> > <https://reviewboard.asterisk.org/r/1673/diff/2/?file=23195#file23195line14871>
> >
> >     I haven't looked at the code, but why is a call to is_shrinkable needed before doing the shrinking?
> >     
> >     (And is cid_num guaranteed to be set? Or can it still be NULL?)

i only have checked the code of ast_shrink_phone_number shortly do know what this function does, and imho if there are no invalid characters in there there is no need to shrink it. 

get_name_and_number will return -1 if cid_num is not set. cid_name could be NULL but not the cid_num.


> On Jan. 17, 2012, 6:17 a.m., wdoekes wrote:
> > team/schmidts/unleash-the-beast/channels/chan_sip.c, line 14859
> > <https://reviewboard.asterisk.org/r/1673/diff/2/?file=23195#file23195line14859>
> >
> >     s/praser/parser/
> >     
> >     .. and remove the comment about 'doing it wrong'. Use those comments to the svn:log instead.
> >     
> >     Future readers of this code will not be interested in the fact that it was once broken.

thx


- schmidts


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


On Jan. 17, 2012, 5:56 a.m., schmidts wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/1673/
> -----------------------------------------------------------
> 
> (Updated Jan. 17, 2012, 5:56 a.m.)
> 
> 
> Review request for Asterisk Developers and wdoekes.
> 
> 
> Summary
> -------
> 
> the get_pai function in chan_sip.c fails to parse a PAI header with a display name set but without ". There are also some wrong char pointer initialisations used.
> By replacing the self made header parsing functions by reqresp_parser functions everything works fine.
> 
> 
> Diffs
> -----
> 
>   team/schmidts/unleash-the-beast/channels/chan_sip.c 350974 
> 
> Diff: https://reviewboard.asterisk.org/r/1673/diff
> 
> 
> Testing
> -------
> 
> tested several different P-Asserted-Identity Headers with display name or without.
> 
> 
> Thanks,
> 
> schmidts
> 
>

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


More information about the asterisk-dev mailing list