<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-15">
</head>
<body bgcolor="#ffffff" text="#000000">
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>
<i>osipsconsole
<br>
address add 0 192.168.1.19 255.255.255.0 UDP 5060
<br>
</i>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") &amp;&amp; is_from_local()) <br>
        {
<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
</body>
</html>