<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
yes, use the xlog() statement and print whatever you want - it is just
to see (in logs) that the execution got to the source checking:<br>
<br>
if (!(method=="REGISTER") && is_from_local())
<br>
{
<br>
<font color="#ff0000"> </font><font color="#ff0000">xlog("---
before doing check_source_address\n");</font><br>
if (!check_source_address("0"))
<br>
{
<br>
if (!proxy_authorize("", "subscriber"))
<br>
{
<br>
proxy_challenge("", "0");
<br>
exit;
<br>
}
<br>
}
<br>
else if (!db_check_from())
<br>
{
<br>
sl_send_reply("403","Forbidden
auth ID");
<br>
exit;
<br>
}
<br>
<br>
}
<br>
<br>
<br>
Regards,<br>
Bogdan<br>
<br>
Roberto Ovani wrote:
<blockquote cite="mid:4BC45F3C.9070600@gmail.com" type="cite">Il
martedì 13/04/10 14.12, Bogdan-Andrei Iancu ha scritto:
<br>
<blockquote type="cite">maybe your call does not get to the
check_source_address() check - put some xlog to see if the script
execution gets in that part.
<br>
<br>
Regards,
<br>
Bogdan
<br>
<br>
Roberto Ovani wrote:
<br>
<blockquote type="cite">Sorry, there is a mistake in what I wrote:
<br>
<br>
I did:
<br>
osipsconsole
<br>
address add 0 192.168.1.19 255.255.255.*255* UDP 5060 (not
255.255.255.0)
<br>
<br>
and opensips makes the call pass the same, from 192.168.1.20.....
<br>
<br>
I had a look into the db entries: there is something like
address=192.168.1.19 mask = 32 ....
<br>
<br>
Any advice?
<br>
Asterisk tricks?
<br>
Or an opensips problem?
<br>
If you want, I can give you ssh accesses....
<br>
<br>
Roberto
<br>
<br>
<br>
Il martedì 13/04/10 12.08, Bogdan-Andrei Iancu ha scritto:
<br>
<blockquote type="cite">Hello Roberto,
<br>
<br>
I think the problem is with the network mask you used when adding the
IP :
<br>
IP : 192.168.1.19
<br>
Mask: 255.255.255.0
<br>
<br>
This rule will allow 192.168.1.xxx block of IPs - this is why the
second asterisk works too ;)
<br>
<br>
Try using the 255.255.255.255 mask (of course remove the existing
entry)
<br>
<br>
Regards,
<br>
Bogdan
<br>
<br>
Roberto Ovani wrote:
<br>
<blockquote type="cite">I'm using opensips 1.6.1, on Ubuntu
9.10 server (192.168.1.12)
<br>
I configured an asterisk box (192.168.1.19) to for PSTN.
<br>
<br>
I'm trying to restrict access, to prevent false authentication from
unauthorized users except the gateway I set up.
<br>
<br>
from the terminal, i wrote :
<br>
/osipsconsole
<br>
address add 0 192.168.1.19 255.255.255.0 UDP 5060
<br>
/to add the gateway data into the db
<br>
So, i want ONLY that asterisk box to send calls to opensips bypassing
authentication (this is what I found on the book by Gonçalves, about
opensips 1.6, nd it says I can do it).
<br>
<br>
But if itry with another asterisk box, on another Ip address e.g.
192.168.1.20 , opensips makes the call pass, even if I didn't put this
entry in my Db.... I want to restrict access to UN-authenticated calls
ONLY to 192.168.1.19
<br>
<br>
this is a piece of code I found on the book and I used to restric the
access only to 192.168.1.19:
<br>
<br>
if (!(method=="REGISTER") && is_from_local())
<br>
{
<br>
if (!check_source_address("0"))
<br>
{
<br>
if (!proxy_authorize("", "subscriber"))
<br>
{
<br>
proxy_challenge("", "0");
<br>
exit;
<br>
}
<br>
}
<br>
else if (!db_check_from())
<br>
{
<br>
sl_send_reply("403","Forbidden
auth ID");
<br>
exit;
<br>
}
<br>
<br>
}
<br>
<br>
<br>
Is it right?
<br>
What do you think I have to check ?
<br>
Could you please help me ? I can't solve this problem....but i need it
!
<br>
Thanks in advance
<br>
Best regards
<br>
Roberto
<br>
------------------------------------------------------------------------
<br>
<br>
_______________________________________________
<br>
Users mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
<br>
<br>
</blockquote>
What would you write in the xlog statement ?
<br>
<br>
xlog (" ????");
<br>
<br>
any advice ?
<br>
R
<br>
<br>
</blockquote>
<br>
<br>
<pre class="moz-signature" cols="72">--
Bogdan-Andrei Iancu
<a class="moz-txt-link-abbreviated" href="http://www.voice-system.ro">www.voice-system.ro</a>
</pre>
</body>
</html>