[OpenSIPS-Users] How to catch a "bad URI"?

Bogdan-Andrei Iancu bogdan at voice-system.ro
Tue Mar 31 12:09:15 CEST 2009


Hi Chris,

that is true - the problem is that along the RURI, the TO URI is also 
broken. And OpenSIPS is not able to construct the reply as it need the 
mirror the FROM, TO, CSEQ and CALLID headers.

As a generic way of catching parsing error , you can use the "error_route":
    http://www.opensips.org/index.php?n=Resources.DocsCoreRoutes#toc5

Regards,
Bogdan

Chris Maciejewski wrote:
> Hi,
>
> I am trying to catch "bad" URIs like sip:!"@some.domain.com, but despite having:
>
> ----------
>   if (!uri=~"^sip:[0-9]{1,15}@.*")
>   {
>     sl_send_reply("403", "403 Forbidden");
>     exit;
>   }
> -----------
>
> in the beginning of my main route, when sending "INVITE
> sip:!"@some.domain.com" to my OpenSips I can see the following in the
> logs:
>
> ----------
> ERROR:core:parse_to: unexpected char ["] in status 6: <<<sip:!>> .
> ERROR:core:get_hdr_field: bad to header
> INFO:core:parse_headers: bad header field
> ERROR:core:parse_from_header: bad msg or missing FROM header
> ERROR:core:pv_get_from_attr: cannot parse From header
> ERROR:core:parse_to: unexpected char ["] in status 6: <<<sip:!>> .
> ERROR:core:get_hdr_field: bad to header
> INFO:core:parse_headers: bad header field
> ERROR:core:pv_get_to_attr: cannot parse To header
> ERROR:core:parse_to: unexpected char ["] in status 6: <<<sip:!>> .
> ERROR:core:get_hdr_field: bad to header
> INFO:core:parse_headers: bad header field
> ERROR:core:parse_to: unexpected char ["] in status 6: <<<sip:!>> .
> ERROR:core:get_hdr_field: bad to header
> INFO:core:parse_headers: bad header field
> ERROR:core:build_res_buf_from_sip_req: parse_headers failed
> ERROR:sl:sl_send_reply_helper: response building failed
> ---------
>
> and reply is never sent out.
>
> Is there any way to achieve this?
>
> Thanks and best regards,
> Chris
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   




More information about the Users mailing list