[SR-Users] authentication is not working

Klaus Darilion klaus.mailinglists at pernau.at
Thu Feb 3 15:46:33 CET 2011


Restart Kamailio. Make sure that it is it really restarts:

/etc/init.d/kamailio stop
ps aux|grep kamailio
# if there are some processes left, kill them
killall kamailio

ps aux|grep kamailio
# if there are still some processes left, kill them harder!
killall -9 kamailio

/etc/init.d/kamailio start


make sure Kamailio is really using your configuration file

klaus


Am 03.02.2011 11:12, schrieb Danny Dias:
> Hello my friends,
> 
> I'm trying to configure authentication on my Kamailio 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://kamailio:kamailiorw@localhost/kamailio")
> modparam("auth_db", "calculate_ha1", yes)
> modparam("auth_db", "password_column", "password")
> modparam("auth_db", "db_url",
>                         "mysql://kamailio:kamailiorw@localhost/kamailio")
> 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 <sip%3A1000 at 172.30.140.8>>
> From: "1000"<sip:1000 at 172.30.140.8 <sip%3A1000 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 <sip%3A1000 at 172.30.140.8>
>> ;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
> From: "1000"<sip:1000 at 172.30.140.8 <sip%3A1000 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
> Content-Length: 0
> 
> Am i missing something in my configuration?
> 
> Thanks in advance!!!
> 
> 
> 
> 
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users



More information about the sr-users mailing list