Hi.
Asterisk users are fine.
Register subscribers Kamailio is my problem.
#!ifdef WITH_ASTERISK
if (!auth_check("$fd", "sipusers", "1")) { ##### OK Asterisk Users are no problem
#!else ##### But if the user is no asterisk , simply refuse registration, without Respect the jump to validate users Kamailio
if (!auth_check("$fd", "subscriber", "1")) {
#!endif
#####
Apr 29 10:40:48 labkamailio kamailio[11304]: DEBUG: auth_db [authorize.c:498]: auth_check(): realm [192.168.65.132] table [sipusers] flags [1]
Apr 29 10:40:48 labkamailio kamailio[11304]: DEBUG: auth [api.c:86]: pre_auth(): auth:pre_auth: Credentials with realm '192.168.65.132' not found
Apr 29 10:40:48 labkamailio kamailio[11304]: DEBUG: auth_db [authorize.c:264]: digest_authenticate_hdr(): no credentials
Apr 29 10:40:48 labkamailio kamailio[11304]: DEBUG: auth [challenge.c:127]: get_challenge_hf(): build_challenge_hf: realm='192.168.65.132'
Apr 29 10:40:48 labkamailio kamailio[11304]: DEBUG: auth [challenge.c:269]: get_challenge_hf(): auth: 'WWW-Authenticate: Digest realm="192.168.65.132", nonce="VUDgjFVA32CFnv6lYnT/fxOzv3M7Mw7n"#015#012'
Thanks.
De: sr-users [mailto:sr-users-bounces@lists.sip-router.org] En nombre de SamyGo Enviado el: jueves, 30 de abril de 2015 4:39 Para: Kamailio (SER) - Users Mailing List Asunto: Re: [SR-Users] [SR_USers] Authenticate asterisk-kamailio
Hi,
The important thing to consider here is this line.
#!define WITH_ASTERISK
so if you've defined this on the very top of your kamailio.cfg then it will go and check username/passwords from the sipusers table from the Database defined by this: DBASTURL
if (!auth_check("$fd", "sipusers", "1")) {
Make sure you've the same user defined and username and passwords are defined in these columns:
modparam("auth_db", "user_column", "name")
modparam("auth_db", "password_column", "sippasswd")
the sipasswd column is text based so dont use encrypted PASSWORD() in there.
Once you follow these steps your user should get registered.
On Thursday 30 April 2015 13:23:25 Mauricio Tejeda wrote:
#!ifdef WITH_ASTERISK
if (!auth_check("$fd", "sipusers", "1"))
{ ##### OK Asterisk Users are no problem
#!else ##### But if the user is no asterisk , simply refuse registration, without Respect the jump to validate users Kamailio
if (!auth_check("$fd", "subscriber", "1"))
{
#!endif
I think you missed a fundamental part of the configuration and its parsing. Above #!ifdef/#!else/#!endif structure is not a conditional in the configuration file during runtime. It is a conditional during parsing.
If you define WITH_ASTERISK the used config during runtime is: if (!auth_check("$fd", "sipusers", "1")) Otherwise it is if (!auth_check("$fd", "subscriber", "1"))
I guess you are looking for something like:
if(is_in_subnet($si, "10.1.2.3/32")) { if(!auth_check("$fd", "sipusers", "1")) { #... } } else { if (!auth_check("$fd", "subscriber", "1")) { #... } }
Where 10.1.2.3 is the ipadres of your asterisk server. But as ever: timtowtdi You could use $si==10.1.2.3 of the adress table or whatever.
Front of my eyes and I did not see it.
Thank you very much.
-----Mensaje original----- De: sr-users [mailto:sr-users-bounces@lists.sip-router.org] En nombre de Daniel Tryba Enviado el: jueves, 30 de abril de 2015 13:44 Para: sr-users@lists.sip-router.org Asunto: Re: [SR-Users] [SR_USers] Authenticate asterisk-kamailio
On Thursday 30 April 2015 13:23:25 Mauricio Tejeda wrote:
#!ifdef WITH_ASTERISK
if (!auth_check("$fd", "sipusers", "1"))
{ ##### OK Asterisk Users are no problem
#!else
##### But if the user is no
asterisk , simply refuse registration, without Respect the jump to validate users Kamailio
if (!auth_check("$fd", "subscriber", "1"))
{
#!endif
I think you missed a fundamental part of the configuration and its parsing. Above #!ifdef/#!else/#!endif structure is not a conditional in the configuration file during runtime. It is a conditional during parsing.
If you define WITH_ASTERISK the used config during runtime is: if (!auth_check("$fd", "sipusers", "1")) Otherwise it is if (!auth_check("$fd", "subscriber", "1"))
I guess you are looking for something like:
if(is_in_subnet($si, "10.1.2.3/32")) { if(!auth_check("$fd", "sipusers", "1")) { #... } } else { if (!auth_check("$fd", "subscriber", "1")) { #... } }
Where 10.1.2.3 is the ipadres of your asterisk server. But as ever: timtowtdi You could use $si==10.1.2.3 of the adress table or whatever.