<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
<tt>Hello,<br>
<br>
</tt><tt>Please keep the mailing list as CC'ed.<br>
<br>
there is no such function in 1.7, but try to use an error_route in
your script to catch and remove bogus messages asap - see <br>
<a class="moz-txt-link-freetext" href="http://www.opensips.org/Documentation/Script-Routes-1-7#toc5">http://www.opensips.org/Documentation/Script-Routes-1-7#toc5</a><br>
<br>
Regards,<br>
</tt>
<pre class="moz-signature" cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<br>
On 10/21/2013 01:56 PM, Pratik Tank wrote:
<blockquote
cite="mid:CALrAmOP==oVk2Du4RjFZJid=n2ikSpyz2yYtY57ThpRr2B58jQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>Hello bogdan-andrei lancu,<br>
<br>
Thank you very much for your reply.<br>
</div>
I am using version 1.7, is there support for function like<code
class=""> </code><code class="">sipmsg_validate?</code>
<p>
Or is there anyother way to do it for v1.7?</p>
<p><br>
</p>
<p>Thanks and regards,<br>
</p>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Mon, Oct 21, 2013 at 3:59 PM,
Bogdan-Andrei Iancu <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:bogdan@opensips.org"
target="_blank">bogdan@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div text="#000000" bgcolor="#ffffff"> <tt>Hello Pratik,<br>
<br>
In the very beginning of the script route use the
sipmsg_validate() function (see <a
moz-do-not-send="true"
href="http://www.opensips.org/html/docs/modules/1.10.x/sipmsgops.html#id294004"
target="_blank">http://www.opensips.org/html/docs/modules/1.10.x/sipmsgops.html#id294004</a>)
to check your message - you can do an exit there if the
message is not valid.<br>
<br>
Regards,<br>
</tt>
<pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a moz-do-not-send="true" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
<div>
<div class="h5"> <br>
On 10/11/2013 12:27 PM, Pratik Tank wrote: </div>
</div>
<blockquote type="cite">
<div>
<div class="h5">
<div dir="ltr">Hello all,<br>
<br>
<br>
I want to drop the sip packets which have <strong>to</strong>
and <strong>contact</strong> field empty.<br>
<br>
<pre><code><i>INVITE <a moz-do-not-send="true">sip:*******************</a> SIP/2.0
Record-Route:
Via: SIP/2.0/UDP *********;branch=z9hG4bK0e44.f7bd2db2.0
Via: SIP/2.0/UDP ************:5060;received=*********;branch=z9hG4bK78f0df76;rport=1122
Max-Forwards: 69
From: "1014" ;tag=as2fff3730
To:
Contact:
Call-ID: **********@*********
CSeq: 103 INVITE
User-Agent: Asterisk PBX 1.6.2.9-2ubuntu2.1
Date: Wed, 09 Oct 2013 15:16:20 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 311 </i>
<b>
</b></code><b>How can I identify such packets and drop them?
</b></pre>
<pre><b>logs for opensips:</b>
</pre>
<pre><i><code>Oct 9 17:16:00 voip /usr/local/sbin/opensips[32325]: ERROR:core:parse_first_line: bad request first line
Oct 9 17:16:00 voip /usr/local/sbin/opensips[32325]: ERROR:core:parse_first_line: at line 0 char 42:
Oct 9 17:16:00 voip /usr/local/sbin/opensips[32325]: ERROR:core:parse_first_line: parsed so far: INVITE <a moz-do-not-send="true">sip:***********************:5060</a>
Oct 9 17:16:00 voip /usr/local/sbin/opensips[32325]: INFO:core:parse_first_line: bad message
> sendrecv 0-16lephone-event/8000 *************SUBSCRIBE, NOTIFY, INFOg: message=<INVITE <a moz-do-not-send="true">sip:*************:5060</a> SIP/2.0
Oct 9 17:16:00 voip /usr/local/sbin/opensips[32325]: ERROR:core:receive_msg: parse_msg failed
Oct 9 17:16:04 voip /usr/local/sbin/opensips[32303]: ERROR:core:parse_first_line: bad request first line
Oct 9 17:16:04 voip /usr/local/sbin/opensips[32303]: ERROR:core:parse_first_line: at line 0 char 42:
Oct 9 17:16:04 voip /usr/local/sbin/opensips[32303]: ERROR:core:parse_first_line: parsed so far: INVITE <a moz-do-not-send="true">sip:****************:5060</a>
Oct 9 17:16:04 voip /usr/local/sbin/opensips[32303]: INFO:core:parse_first_line: bad message
> sendrecv 0-16lephone-event/*******************SUBSCRIBE, NOTIFY, INFOg: message=<INVITE <a moz-do-not-send="true">sip:*****************:5060</a> SIP/2.0
Oct 9 17:16:04 voip /usr/local/sbin/opensips[32303]: ERROR:core:receive_msg: parse_msg failed</code>
</i></pre>
<br>
</div>
</div>
</div>
<pre><fieldset></fieldset>
_______________________________________________
Devel mailing list
<a moz-do-not-send="true" href="mailto:Devel@lists.opensips.org" target="_blank">Devel@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
</blockquote>
</div>
</blockquote>
</div>
<br>
<br clear="all">
<br>
-- <br>
<div dir="ltr">
<div>Pratik Tank<br>
</div>
Jr. Software Developer<br>
Ecosmob Technologies Pvt. Ltd.<br>
</div>
</div>
</blockquote>
</body>
</html>