Thanks, will try it and get back to you.<div><br></div><div>james<br><br><div class="gmail_quote">On Fri, Oct 8, 2010 at 5:10 PM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi James,<br>
<br>
use the domain module to list in DB all your local domains and check in<br>
script if the domain in RURI is local or not. Use<br>
       <a href="http://www.opensips.org/html/docs/modules/1.6.x/domain.html#id227177" target="_blank">http://www.opensips.org/html/docs/modules/1.6.x/domain.html#id227177</a><br>
<br>
If the domain is not local, reject the registration<br>
<br>
Regards,<br>
Bogdan<br>
<div class="im"><br>
James Mbuthia wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Am having a problem with someone trying to use my opensips to relay<br>
&gt; calls. Below is a snippet of my log file<br>
&gt;<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_msg: SIP Request:<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_msg:  method:  &lt;REGISTER&gt;<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_msg:  uri:     &lt;sip:<a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a><br>
</div>&gt; &lt;<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>&gt;&gt;<br>
<div><div></div><div class="h5">&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_msg:  version: &lt;SIP/2.0&gt;<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: flags=2<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_via_param: found param type 232, &lt;branch&gt; =<br>
&gt; &lt;z9hG4bK29073721&gt;; state=6<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_via_param: found param type 235, &lt;rport&gt; = &lt;n/a&gt;; state=17<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_via: end of header reached, state=5<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: via found, flags=2<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: this is the first via<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:receive_msg: After parse_msg...<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:receive_msg: preparing to run routing scripts...<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: flags=100<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_to: end of header reached, state=10<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_to: display={}, ruri={<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div></div>&gt; &lt;mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>&gt;}<br>
<div class="im">&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:get_hdr_field: &lt;To&gt; [34]; uri=[<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>&gt;]<br>
<div class="im">&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:get_hdr_field: to body [&lt;<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>&gt;&gt;<br>
<div><div></div><div class="h5">&gt;  ]<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:get_hdr_field: cseq &lt;CSeq&gt;: &lt;22695&gt; &lt;REGISTER&gt;<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:maxfwd:is_maxfwd_present: value = 70<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:uri:has_totag: no totag<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: flags=78<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:tm:t_lookup_request: start searching: hash=51210, isACK=0<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:tm:matching_3261: RFC3261 transaction matching failed<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:tm:t_lookup_request: no transaction found<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:parse_headers: flags=200<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:get_hdr_field: content_length=0<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:get_hdr_field: found end of header<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:rr:find_first_route: No Route headers found<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:rr:loose_route: There is no Route HF<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:grep_sock_info: checking if host==us: 20==13 &amp;&amp;<br>
</div></div>&gt;  [<a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a> &lt;<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>&gt;] == [72.55.133$<br>
<div class="im">&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:grep_sock_info: checking if port 5060 matches port 5060<br>
&gt; Oct  8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
&gt; DBG:core:check_self: host != me<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; As you can see am getting Register requests<br>
&gt; from <a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>&gt; &lt;mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>&gt;. What I wanted to know, how<br>
<div class="im">&gt; do I block all requests from <a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a><br>
</div>&gt; &lt;<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>&gt;? Do I use the userblacklist module? I<br>
<div class="im">&gt; tried doing that but my problem is that the database entry requires a<br>
&gt; prefix, since I want to block all requests from that specific domain<br>
&gt; how do I go around it? Or conversely how do I make a configuration<br>
&gt; that only allows requests from a specific domain? Any help would be<br>
&gt; highly appreaciated.<br>
&gt;<br>
&gt; regards,<br>
&gt; James<br>
&gt;<br>
&gt; .<br>
</div>&gt; ------------------------------------------------------------------------<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Users mailing list<br>
&gt; <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
&gt; <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
&gt;<br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
OpenSIPS Bootcamp<br>
15 - 19 November 2010, Edison, New Jersey, USA<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br></div>