[Asterisk-Dev] ast_xxx function..?

Kevin P. Fleming kpfleming at digium.com
Fri Sep 30 13:20:43 MST 2005


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 :-)



More information about the asterisk-dev mailing list