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@172.30.140.22:48752;rinstance=fcade2df86ce0ab8 To: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8> From: "1000"<sip:1000@172.30.140.8 sip%3A1000@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@172.30.140.8 sip%3A1000@172.30.140.8
;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
From: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8>;tag=cd3e2323 Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc. CSeq: 1 REGISTER Contact: sip:1000@172.30.140.22:48752 ;rinstance=fcade2df86ce0ab8;expires=3600 Content-Length: 0
Am i missing something in my configuration?
Thanks in advance!!!
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@172.30.140.22:48752;rinstance=fcade2df86ce0ab8 To: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8> From: "1000"<sip:1000@172.30.140.8 sip%3A1000@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@172.30.140.8 sip%3A1000@172.30.140.8
;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
From: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8>;tag=cd3e2323 Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc. CSeq: 1 REGISTER Contact: sip:1000@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
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@172.30.140.22:48752;rinstance=fcade2df86ce0ab8 To: "1000"<sip:1000@172.30.140.8sip%3A1000@172.30.140.8> From: "1000"<sip:1000@172.30.140.8sip%3A1000@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@172.30.140.8sip%3A1000@172.30.140.8
;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
From: "1000"<sip:1000@172.30.140.8sip%3A1000@172.30.140.8>;tag=cd3e2323 Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc. CSeq: 1 REGISTER Contact:sip:1000@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@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Thanks Daniel...i appreciate your help, i will let you know if i could solve the problem!
2011/2/3 Daniel-Constantin Mierla miconda@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@172.30.140.22:48752;rinstance=fcade2df86ce0ab8 To: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8< sip%3A1000@172.30.140.8 sip%253A1000@172.30.140.8>> From: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8< sip%3A1000@172.30.140.8 sip%253A1000@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@172.30.140.8 sip%3A1000@172.30.140.8< sip%3A1000@172.30.140.8 sip%253A1000@172.30.140.8>
;tag=c97b4d1cb1f3d0da549e06a8d482ef63.34dc
From: "1000"<sip:1000@172.30.140.8 sip%3A1000@172.30.140.8< sip%3A1000@172.30.140.8 sip%253A1000@172.30.140.8>>;tag=cd3e2323 Call-ID: MmU0YjM1NThiNTg0ZjhiNGM4ODA4ZmU1YWFiYjBmNTc. CSeq: 1 REGISTER Contact:sip:1000@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@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@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
-- Daniel-Constantin Mierla http://www.asipto.com
El Thu, 3 Feb 2011 11:12:30 +0100 Danny Dias ing.diasdanny@gmail.com escribió:
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)
.
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
Why would you do that? Toyima Dias? Really?
El Thu, 3 Feb 2011 19:50:23 +0100 Jon Bonilla (Manwe) manwe@aholab.ehu.es escribió:
El Thu, 3 Feb 2011 11:12:30 +0100 Danny Dias ing.diasdanny@gmail.com escribió:
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)
.
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
Forgot to attach. This is not the only one.
http://lists.opensips.org/pipermail/users/2011-February/016551.html
2011/2/3 Jon Bonilla manwe@aholab.ehu.es
El Thu, 3 Feb 2011 11:12:30 +0100 Danny Dias ing.diasdanny@gmail.com escribió:
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)
.
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
different emails...what's the problem? i have a doubt and then i ask...thats the purpose of the forum, if you are not going to help, don't answer...
Why would you do that? Toyima Dias? Really?
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list sr-users@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
Am 03.02.2011 22:17, schrieb Danny Dias:
2011/2/3 Jon Bonilla manwe@aholab.ehu.es
El Thu, 3 Feb 2011 11:12:30 +0100 Danny Dias ing.diasdanny@gmail.com escribió:
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)
.
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
different emails...what's the problem? i have a doubt and then i ask...thats the purpose of the forum, if you are not going to help, don't answer...
If you are using opensips -> ask on the opensips mailing list IF you are using kamailio -> ask on the kamailio mailing list
Maybe you are confused using both, and have edited kamailio.cfg although you are using opensips?
2011/2/3 Danny Dias ing.diasdanny@gmail.com:
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
different emails...what's the problem? i have a doubt and then i ask...thats the purpose of the forum, if you are not going to help, don't answer...
You are showing same config file (just replaced "kamailio" with "opensips") and exactly same SIP traces. So please clarify if you are using Kamailio or OpenSIPS since they are different. If you are using Kamailio and report a problem in OpenSIPS maillist (or vice versa) then you are providing not valid information (both projects are not the same, even more in newer versions).
So what are you using and which exact version?
Cheers.
Hello,
2011/2/4 Iñaki Baz Castillo ibc@aliax.net
2011/2/3 Danny Dias ing.diasdanny@gmail.com:
Are you asking the same questions in both kamailio and opensips accounts with different aliases?
different emails...what's the problem? i have a doubt and then i
ask...thats
the purpose of the forum, if you are not going to help, don't answer...
You are showing same config file (just replaced "kamailio" with "opensips") and exactly same SIP traces. So please clarify if you are using Kamailio or OpenSIPS since they are different.
oooh...different? both are proxys or not? now i'm lost...it's the same trace, it happened with OpenSIPS, i'm using Kamailio and Opensips, but the problem was with Opensips (not problem of the application, the problem was in my hands, bad configuration, etc...), as i said before, i wont ask the same questions to different lists again...but i thought that they would have the exactly behavior in my problem...
If you are using Kamailio and report a problem in OpenSIPS maillist (or vice versa) then you are providing not valid information (both projects are not the same, even more in newer versions).
So what are you using and which exact version?
For Kamailio 1.5 and for OpenSIPS 1.6.3 (right now Just for testing scenarios...)
Cheers.
-- Iñaki Baz Castillo ibc@aliax.net
2011/2/4 Danny Dias ing.diasdanny@gmail.com:
different emails...what's the problem? i have a doubt and then i ask...thats the purpose of the forum, if you are not going to help, don't answer...
You are showing same config file (just replaced "kamailio" with "opensips") and exactly same SIP traces. So please clarify if you are using Kamailio or OpenSIPS since they are different.
oooh...different? both are proxys or not?
YXA [*] is also a SIP proxy (written in Erlang language). Would a question about YXA make sense in this maillist just because YXA is a SIP proxy? :)
[*] http://www.stacken.kth.se/project/yxa/
now i'm lost...it's the same trace, it happened with OpenSIPS, i'm using Kamailio and Opensips, but the problem was with Opensips (not problem of the application, the problem was in my hands, bad configuration, etc...), as i said before, i wont ask the same questions to different lists again...but i thought that they would have the exactly behavior in my problem...
Maybe, but the recipes you will get in each mailist (so different projects) could be different. This is, somebody in this maillist could try to help you but what he suggests could be invalid for OpenSIPS (newest versions of both projects differ much more than their 1.5.X version).
If you are using Kamailio and report a problem in OpenSIPS maillist (or vice versa) then you are providing not valid information (both projects are not the same, even more in newer versions).
So what are you using and which exact version?
For Kamailio 1.5 and for OpenSIPS 1.6.3 (right now Just for testing scenarios...)
But the reported problem occurs with your OpenSIPS installation, and provided configuration and SIP traces are taken using OpenSIP, am I right? If so, I strongly suggest you to just ask in OpenSIPS maillist due to the explained above. The help you'll get there would be "more" valid for you.
Cheers.
2011/2/3 Danny Dias ing.diasdanny@gmail.com:
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; }
Ensure that this block is being executed in your test. For that, add some xlog here and there. Most probably there is some part of your script that makes the above work not to be executed for your request.