[OpenSIPS-Users] authentication is not working

Anton Zagorskiy a.zagorskiy at oyster-telecom.ru
Thu Feb 3 10:27:17 CET 2011


Hi Toyima.

I see 200 OK reply. What is wrong? =)


From: users-bounces at lists.opensips.org
[mailto:users-bounces at lists.opensips.org] On Behalf Of Toyima Dias
Sent: Thursday, February 03, 2011 11:32 AM
To: OpenSIPS users mailling list
Subject: [OpenSIPS-Users] authentication is not working

Hello my friends, 
 
I'm trying to configure authentication on my OpenSIPS and is not working at
all :(
 
I've added the following to the script to make it work: (but it doesn't)
 
...
loadmodule "auth.so"
loadmodule "auth_db.so"
...
modparam("usrloc", "db_url",
                        "mysql://opensips:opensipsrw@localhost/opensips")
modparam("auth_db", "calculate_ha1", yes)
modparam("auth_db", "password_column", "password")
modparam("auth_db", "db_url",
                        "mysql://opensips:opensipsrw@localhost/opensips")
modparam("auth_db", "load_credentials", "")
...
        if (!(method=="REGISTER") && from_uri==myself) /*no multidomain
version*/
        {
                if (!proxy_authorize("", "subscriber")) {
                        proxy_challenge("", "0");
                        exit;
                }
                if (!db_check_from()) {
                        sl_send_reply("403","Forbidden auth ID");
                        exit;
                }
                consume_credentials();
        }
...

        if (is_method("REGISTER"))
        {
                # authenticate the REGISTER requests (uncomment to enable
auth)
                if (!www_authorize("", "subscriber"))
                {
                        www_challenge("", "0");
                        exit;
                }
                ##
                if (!db_check_to())
                {
                        sl_send_reply("403","Forbidden auth ID");
                        exit;
                }
                if (!save("location"))
                        sl_reply_error();
                exit;
        }
 
But is not working at all...take a look:
 
#
U 2011/02/03 09:31:04.402891 172.30.140.22:48752 -> 172.30.140.8:5060
REGISTER sip:172.30.140.8 SIP/2.0
Via: SIP/2.0/UDP
172.30.140.22:48752;branch=z9hG4bK-d87543-9a54af22967ae417-1--d87543-;rport
Max-Forwards: 70
Contact: <sip:1000 at 172.30.140.22:48752;rinstance=fcade2df86ce0ab8>
To: "1000"<sip:1000 at 172.30.140.8>
From: "1000"<sip:1000 at 172.30.140.8>;tag=cd3e2323
Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc.
CSeq: 1 REGISTER
Expires: 3600
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, NOTIFY, MESSAGE, SUBSCRIBE,
INFO
User-Agent: X-Lite release 1011s stamp 41150
Content-Length: 0

#
U 2011/02/03 09:31:04.404039 172.30.140.8:5060 -> 172.30.140.22:48752
SIP/2.0 200 OK
Via: SIP/2.0/UDP
172.30.140.22:48752;branch=z9hG4bK-d87543-9a54af22967ae417-1--d87543-;rport=
48752
To: "1000"<sip:1000 at 172.30.140.8>;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
From: "1000"<sip:1000 at 172.30.140.8>;tag=cd3e2323
Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc.
CSeq: 1 REGISTER
Contact:
<sip:1000 at 172.30.140.22:48752;rinstance=fcade2df86ce0ab8>;expires=3600
Server: OpenSIPS (1.6.4-2-notls (i386/linux))
Content-Length: 0
Am i missing something in my configuration?
 
Thanks in advance!!!
 
 
 
 
 
 
 
 





More information about the Users mailing list