[Asterisk-Dev] ast_xxx function..?

Jerris, Michael MI mjerris at ofllc.com
Fri Sep 30 13:43:47 MST 2005


> Kevin P. Fleming
> Sent: Friday, September 30, 2005 4:21 PM
> To: Asterisk Developers Mailing List
> Subject: Re: [Asterisk-Dev] ast_xxx function..?
> 
> Matt Hess wrote:
> > I've run into a problem with head that I'd like to make a patch for 
> > but I need to see first if an ast_ function exists to strip all non 
> > alphanumeric characters from a char.. in this case the 
> nonce variable 
> > in chan_sip. Some sip analog gateways send a nonce improperly and 
> > getting the vendors to fix it has been a real pita 'wait and see' 
> > thing. The example nonce I am working off of looks like: 
> > nonce="7d0ae5ad" ", which is clearly wrong. I would like to ensure 
> > that nonce only has alpha numeric characters in it as I believe it 
> > should not be allowed to contain a quote or space in the 
> value.. all I 
> > really need to see is if asterisk already has a function to 
> do this and return the cleaned string.
> 
> We have functions to strip quotes, whitespace, etc. Look in 
> strings.h. 
> However, we won't put in a patch to do this _always_ if it's 
> non-RFC-conforming, because it will negatively impact 
> performance for all users. If the RFC allows it, though, then 
> the patch will be most welcome :-) 

Is this to say that the UA is giving a nonce of 7d0ae5ad or
7d0ae5ad"<sp> .  From what I have looked at in chan_sip, it appears we
already parse nonce as being from the char after the " to the following
" so that should work, even with the bad data getting sent.  What are
you actually seeing as a result of this?

Mike




More information about the asterisk-dev mailing list