[OpenSIPS-Users] sip_msg_validate()

Bogdan-Andrei Iancu bogdan at opensips.org
Tue Feb 26 16:19:49 CET 2013


I would suggest to spit -1 even more... or we can make the function to 
populate a kind of strerror :) - to return in a pvar the description of 
the failure....just exploring here :)

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 02/26/2013 05:16 PM, Nick Altmann wrote:
> Now we have:
>
>    *
>
>       /1/ - the message is RFC3261 compliant and has been successfully
>       validated.
>
>    *
>
>       /-1/ - the message is not RFC3261 compliant.
>
>    *
>
>       /-2/ - signals a parsing error.
>
>    *
>
>       /-3/ - invalid SDP body.
>
>    *
>
>       /-4/ - invalid headers body.
>
>    *
>
>       /-5/ - invalid R-URI.
>
>    *
>
>       /-6/ - invalid R-URI domain.
>
>    *
>
>       /-255/ - undefined errors.
>
> "-1" can be:
> - message doesn't have callid
> - message doesn't have Content Length header for proto %d
> - PATH header supported only for REGISTERs
> - Cseq not parsed properly
> - invalid body - content length %ld different then actual body %d
>
> Maybe increase log level for "-1" only?
> But now I think I just can increase debug level before 
> sip_msg_validate() and lower it after. :-)
>
> --
> Nick
>
>
> 2013/2/26 Bogdan-Andrei Iancu <bogdan at opensips.org 
> <mailto:bogdan at opensips.org>>
>
>     In this case, it means the function has to report something more
>     than -1....like: -1 no MF hdr, -2 missing body, -3 missing TO, etc...
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>     OpenSIPS Founder and Developer
>     http://www.opensips-solutions.com
>
>
>     On 02/26/2013 03:32 PM, Nick Altmann wrote:
>>     Bogdan,
>>
>>     I'm second time deal with problem when I receive "-1" from script
>>     and to understand what is not okay I should compare message with
>>     source code. :-)
>>     Of course I receive and interpret this codes, but "-1" is not
>>     fully informative sometimes. Especially when sdp length is not
>>     okay. :-)
>>
>>     --
>>     Nick
>>
>>
>>     2013/2/26 Bogdan-Andrei Iancu <bogdan at opensips.org
>>     <mailto:bogdan at opensips.org>>
>>
>>         Hi Nick,
>>
>>         Such a change may induce a self-spaming effect on your logs
>>         :). I would rather interpret the return code from script and
>>         let the script writer the decision if he wants to log that or
>>         not...(depending on the failed check, maybe if local
>>         subscriber or not, etc).
>>
>>         At least these are my 2 cents on the matter :)
>>
>>         Regards,
>>
>>         Bogdan-Andrei Iancu
>>         OpenSIPS Founder and Developer
>>         http://www.opensips-solutions.com
>>
>>
>>         On 02/26/2013 01:01 PM, Nick Altmann wrote:
>>>         Hello!
>>>
>>>         What about to change DBG messages in sip_msg_validate() to
>>>         ERR or INFO? It will help to understand the reason of
>>>         reject. Especially for -1 return (the message is not RFC3261
>>>         compliant).
>>>
>>>         --
>>>         Nick
>>>
>>>
>>>         _______________________________________________
>>>         Users mailing list
>>>         Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>>>         http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130226/71d073b1/attachment.htm>


More information about the Users mailing list