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"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></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>
> Hi,<br>
><br>
> Am having a problem with someone trying to use my opensips to relay<br>
> calls. Below is a snippet of my log file<br>
><br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_msg: SIP Request:<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_msg: method: <REGISTER><br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_msg: uri: <sip:<a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a><br>
</div>> <<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>>><br>
<div><div></div><div class="h5">> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_msg: version: <SIP/2.0><br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: flags=2<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_via_param: found param type 232, <branch> =<br>
> <z9hG4bK29073721>; state=6<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_via_param: found param type 235, <rport> = <n/a>; state=17<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_via: end of header reached, state=5<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: via found, flags=2<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: this is the first via<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:receive_msg: After parse_msg...<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:receive_msg: preparing to run routing scripts...<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: flags=100<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_to: end of header reached, state=10<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_to: display={}, ruri={<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div></div>> <mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>>}<br>
<div class="im">> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:get_hdr_field: <To> [34]; uri=[<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>> <mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>>]<br>
<div class="im">> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:get_hdr_field: to body [<<a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>> <mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>>><br>
<div><div></div><div class="h5">> ]<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:get_hdr_field: cseq <CSeq>: <22695> <REGISTER><br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:maxfwd:is_maxfwd_present: value = 70<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:uri:has_totag: no totag<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: flags=78<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:tm:t_lookup_request: start searching: hash=51210, isACK=0<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:tm:matching_3261: RFC3261 transaction matching failed<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:tm:t_lookup_request: no transaction found<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:parse_headers: flags=200<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:get_hdr_field: content_length=0<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:get_hdr_field: found end of header<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:rr:find_first_route: No Route headers found<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:rr:loose_route: There is no Route HF<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:grep_sock_info: checking if host==us: 20==13 &&<br>
</div></div>> [<a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a> <<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>>] == [72.55.133$<br>
<div class="im">> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:grep_sock_info: checking if port 5060 matches port 5060<br>
> Oct 8 08:50:32 CL-T020-483CL /usr/local/sbin/opensips[4680]:<br>
> DBG:core:check_self: host != me<br>
><br>
><br>
><br>
> As you can see am getting Register requests<br>
> from <a href="mailto:sip%3A49102@sip.persiantools.com">sip:49102@sip.persiantools.com</a><br>
</div>> <mailto:<a href="mailto:sip%253A49102@sip.persiantools.com">sip%3A49102@sip.persiantools.com</a>>. What I wanted to know, how<br>
<div class="im">> do I block all requests from <a href="http://sip.persiantools.com" target="_blank">sip.persiantools.com</a><br>
</div>> <<a href="http://sip.persiantools.com" target="_blank">http://sip.persiantools.com</a>>? Do I use the userblacklist module? I<br>
<div class="im">> tried doing that but my problem is that the database entry requires a<br>
> prefix, since I want to block all requests from that specific domain<br>
> how do I go around it? Or conversely how do I make a configuration<br>
> that only allows requests from a specific domain? Any help would be<br>
> highly appreaciated.<br>
><br>
> regards,<br>
> James<br>
><br>
> .<br>
</div>> ------------------------------------------------------------------------<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>
><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>