[OpenSIPS-Users] error-handling a parser error

Jeff Pyle jpyle at fidelityvoice.com
Wed Jan 26 17:27:06 CET 2011


Vallimamod,

I already have an error route in there.  Apparently the error is not
severe enough to upheave the regular script processing and put it into
error_route.



Brett,

The function in this case is
  $var(id_num) = $(re{uri.user});

When it doesn't have a uri.user in $re, it coughs a little.  I'm not as
concerned about the log message as I am about being able to detect the
error and handle it properly.

Your suggestion made me realize I've been attacking this the wrong way.
Rather than try to get Opensips to tell me when it's throwing the parser
error and handle that, it does make a lot more sense to do something to
identify the result of the error and deal with it accordingly.  Something
like checking for an empty $var(id_num) after the above function, or
perhaps looking at $(re{uri.user}) before assigning it.

Another I-D-ten-T mystery solved...


- Jeff


On 1/26/11 11:14 AM, "Vallimamod ABDULLAH"
<vallimamod.abdullah at imtelecom.fr> wrote:

>
>On Jan 26, 2011, at 5:04 PM, Jeff Pyle wrote:
>
>> Hello,
>> 
>> I'm seeing errors like these:
>> 
>> /usr/local/sbin/opensips[24330]: ERROR:core:parse_uri: bad char '@' in
>>state 0 parsed: <sip:> (4) / <sip:@66.xx.yy.101> (17)
>> /usr/local/sbin/opensips[24330]: ERROR:core:tr_eval_uri: invalid uri
>>[sip:@66.xx.yy.101]
>> /usr/local/sbin/opensips[24330]: ERROR:core:do_assign: no value in
>>right expression
>> /usr/local/sbin/opensips[24330]: ERROR:core:do_assign: error at line:
>>678
>> 
>> It's because a UAC is sending invalid RPID headers.  When I try to
>>parse it, it doesn't go so well.
>> 
>> Is there a way to handle these errors somehow so that I might reply
>>with a 400 Bad Request?
>
>Have you tried to use error_route ?
>Have a look at http://www.opensips.org/Resources/DocsCoreRoutes#toc5
>
>Regards,
>Vallimamod Abdullah
>.
>
>
>_______________________________________________
>Users mailing list
>Users at lists.opensips.org
>http://lists.opensips.org/cgi-bin/mailman/listinfo/users




More information about the Users mailing list