[Asterisk-Dev] ast_xxx function..?
Matt Hess
mhess at livewirenet.com
Fri Sep 30 14:00:43 MST 2005
Jerris, Michael MI wrote:
>>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
>
The latter example you asked about is being sent as the value for nonce.
I am getting rejects on register messages with a 'stale nonce' message.
In looking at the traces (sip debugs) it looks like nonce is modifying
properly (not really stale) however, I am under the belief that the
improper value may be the culprit.. I'm working on a little test code
right now to see if I can help the naughty vendor situation.
> _______________________________________________
> Asterisk-Dev mailing list
> Asterisk-Dev at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-dev
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-dev
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mhess.vcf
Type: text/x-vcard
Size: 288 bytes
Desc: not available
Url : http://lists.digium.com/pipermail/asterisk-dev/attachments/20050930/bc9aaf20/mhess.vcf
More information about the asterisk-dev
mailing list