[SR-Users] authentication is not working

Danny Dias ing.diasdanny at gmail.com
Thu Feb 3 22:20:08 CET 2011


Thanks Daniel...i appreciate your help, i will let you know if i could solve
the problem!

2011/2/3 Daniel-Constantin Mierla <miconda at gmail.com>

> What version of kamailio are you using? If it is 3.1, then load debugger
> module and enable cfg trace. Then you will see what lines in the
> configuration file are executed.
>
> For older versions (also for 3.1), you can add xlog() lines in your config
> to troubleshoot it.
>
> Cheers,
> Daniel
>
>
> On 2/3/11 3:46 PM, Klaus Darilion wrote:
>
>> 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><
>>> sip%3A1000 at 172.30.140.8 <sip%253A1000 at 172.30.140.8>>>
>>> From: "1000"<sip:1000 at 172.30.140.8 <sip%3A1000 at 172.30.140.8><
>>> sip%3A1000 at 172.30.140.8 <sip%253A1000 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><
>>> sip%3A1000 at 172.30.140.8 <sip%253A1000 at 172.30.140.8>>
>>>
>>>> ;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
>>>>
>>> From: "1000"<sip:1000 at 172.30.140.8 <sip%3A1000 at 172.30.140.8><
>>> sip%3A1000 at 172.30.140.8 <sip%253A1000 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
>>>
>> _______________________________________________
>> 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
>>
>
> --
> Daniel-Constantin Mierla
> http://www.asipto.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20110203/afb113f1/attachment.htm>


More information about the sr-users mailing list