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

Chris Maciejewski chris at wima.co.uk
Sat Mar 28 11:51:47 CET 2009


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



More information about the Users mailing list