[asterisk-dev] [Code Review] Parsing of reg->username containing @domain

Nick Lewis Nick.Lewis at atltelecom.com
Fri Apr 30 04:55:22 CDT 2010



> On 2010-04-29 12:21:14, David Vossel wrote:
> > trunk/channels/sip/config_parser.c, lines 61-64
> > <https://reviewboard.asterisk.org/r/628/diff/3/?file=9827#file9827line61>
> >
> >     Isn't reorder really only used as a temporary char * later on?  If so it probably doesn't belong in the args list at all.

Agreed


> On 2010-04-29 12:21:14, David Vossel wrote:
> > trunk/channels/sip/config_parser.c, lines 208-213
> > <https://reviewboard.asterisk.org/r/628/diff/3/?file=9827#file9827line208>
> >
> >     I'd just use a temporary char * here to handle the reordering.
> >     
> >     Perhaps add a comment as to why this is necessary as well.

Will do

Reordering needed due to fields being [(:secret[:username]) / (:regdomainport:secret:username)] but parsing being [secret[:username[:regdomainport]]]


> On 2010-04-29 12:21:14, David Vossel wrote:
> > trunk/main/app.c, lines 1194-1204
> > <https://reviewboard.asterisk.org/r/628/diff/3/?file=9829#file9829line1194>
> >
> >     I don't understand why this is necessary.  I thought the args array was initialized during declaration.

I may well have misdiagnosed this but I was certainly sometimes getting a segfault when using the output from AST_NONSTANDARD_RAW_ARGS(user3, user1.authuser , ':');

Any ideas why this might be?


- Nick


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


On 2010-04-29 05:33:57, Nick Lewis wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/628/
> -----------------------------------------------------------
> 
> (Updated 2010-04-29 05:33:57)
> 
> 
> Review request for Asterisk Developers and David Vossel.
> 
> 
> Summary
> -------
> 
> reg->username is parsed for each registration refresh rather than once on sip reload. A previously committed change that addressed this was reverted because it did not cater for registration strings that contained a peer name in the host field. This change does. 
> 
> 
> This addresses bug 14331.
>     https://issues.asterisk.org/view.php?id=14331
> 
> 
> Diffs
> -----
> 
>   trunk/channels/chan_sip.c 258227 
>   trunk/channels/sip/config_parser.c 258227 
>   trunk/channels/sip/include/sip.h 258228 
>   trunk/main/app.c 258227 
> 
> Diff: https://reviewboard.asterisk.org/r/628/diff
> 
> 
> Testing
> -------
> 
> Passes a new unit test for parsing usernames containing domains. Passes existing unit tests. Passes peername functional test with sip.conf snippet
> 
> [general]
> register=nick at quirk
> [quirk]
> fromdomain=10.10.235.48
> 
> 
> Thanks,
> 
> Nick
> 
>




More information about the asterisk-dev mailing list