Re: [SR-Users] Kamailio+Asterisk - Kamailio doesn't forward INVITE to 2nd Kamailio
Hello Daniel, > yes, if you partitioned the users and you know by first digit where it should > be registered, then all is fine -- update > the r-uri and then you can relay > to the other server. I do it (update the $ur with the right destination IP) for all calls (INVITEs). If a SIP client registered on Kamailio1 calls a client registered on Kamailio2 then it functions. If an other client calls through an Asterisk (which is registered on Kamailio) then it doesn't function! Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk gets 'Busy'!Please see my test cases bellow: 3 of them function, 1 of them doesn't function! Asterisk obviously doesn't send some part of the INVITE message which is needed to call another Kamailio. Can you give me some advise how to solve it? Which other variable should be set to relay the INVITE to the 2nd Kamailio? Thank youRegardsMarko From: Daniel-Constantin Mierla <mico...@gmail.com> To: Marko Tirs <marko.t...@yahoo.com>; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org> Sent: Wednesday, June 14, 2017 10:43 AM Subject: Re: [SR-Users] Kamailio+Asterisk - Kamailio doesn't forward INVITE to 2nd Kamailio Hello, On 13.06.17 14:35, Marko Tirs wrote: Hi all, I have here: Kamailio 1: 192.168.0.11 Kamailio 2: 192.168.0.21 Asterisk 1: 192.168.0.12 Asterisk1 is registered on Kamailio1 as User 100. Asterisk1 shouldn't be registered on Kamailio2. User 111 registered on Kamailio1 User 211 registered on Kamailio2 User 121 registered on Asterisk1 Test cases: - 111 calls 211 - OK 211 calls 111 - OK 121 calls 111 - OK 121 calls 211 - Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk gets 'Busy' !? Is the approach just to replace destination IP-address in $ru, depending from 1st digit, right? yes, if you partitioned the users and you know by first digit where it should be registered, then all is fine -- update the r-uri and then you can relay to the other server. Cheers, Daniel If not, what is the right approach to reach the remote users from Asterisk, which are registered on remote Kamailio and not on the local Kamailio? Thank you Regards Marko My changes in kamailio.cfg in both kamailios (based on kamailio-basic.cfg) : -- kamailio1.bindip = "192.168.0.11" kamailio2.bindip = "192.168.0.21" ... route { if (is_method("INVITE")) { if($rU=~"^1[0-9][0-9]$") { $ru = "sip:" + $rU + "@" + $sel(cfg_get.kamailio1.bindip) + ":5060"; } else if($rU=~"^2[0-9][0-9]$") { $ru = "sip:" + $rU + "@" + $sel(cfg_get.kamailio2.bindip) + ":5060"; } } ... sip.conf in Asterisk1: -- register => 100:abc@192.168.0.124:5060/100 [100] type=friend host=192.168.0.11 secret=abc context=kamailio [121] type=friend secret=abc host=dynamic context=kamailio extensions.conf --- [kamailio] exten => _[1-4]XX,1,Dial(SIP/100/${EXTEN},30) exten => _[1-4]XX,n,Hangup() ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - www.asipto.com Kamailio World Conference - www.kamailioworld.com ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] REDIS load problem - Kamailio 5.0.1 - db_redis not found
Hello Daniel,ok, no db_redis module yet. How about accounting with Redis, is there any example how to use Redis for authentication and accounting?Thank youRegardsMarko - Forwarded Message - From: Daniel-Constantin Mierla <mico...@gmail.com> To: Marko Tirs <marko.t...@yahoo.com>; Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org> Sent: Thursday, June 1, 2017 5:04 PM Subject: Re: [SR-Users] REDIS load problem - Kamailio 5.0.1 - db_redis not found Hello, at this moment there is no db_redis module in Kamailio, some people are working on it: - https://github.com/kamailio/kamailio/issues/1137 ndb_redis cannot be used as a db driver, in the way you try. If you need to fetch the password for authentication from redis, then use ndb_redis to get it and auth module to do authentication -- see pv_auth_check(...) functions. Cheers, Daniel On 31.05.17 18:19, Marko Tirs wrote: Hi all, I'm trying to use the Redis database for authentication and later for accounting. I installed Redis on the server, I compiled Kamailio with ndb_redis and the module exists. When I try to start Kamailio I get following errors: 0(16737) ERROR: [db.c:203]: db_bind_mod(): Module db_redis not found. Missing loadmodule? 0(16737) ERROR: auth_db [auth_db_mod.c:175]: mod_init(): unable to bind to a database driver 0(16737) ERROR: [core/sr_module.c:968]: init_mod(): Error while initializing module auth_db (/usr/local/lib64/kamailio/modules/auth_db.so) ERROR: error while initializing modules Bellow are the relevant parts from config files. Is there any example of kamailio.cfg with Redis configuration and commands for authentication and accounting? Please help me to use Kamailio with Redis. Thank you Regards Marko kamctlrc - DBENGINE=DBTEXT kamailio.cfg - #!define WITH_REDIS #!define WITH_AUTH #!ifdef WITH_REDIS #!define DBURL "redis://localhost:6379/" #!endif #!ifdef WITH_AUTH loadmodule "auth.so" loadmodule "auth_db.so" #!endif #!ifdef WITH_REDIS loadmodule "ndb_redis.so" #!endif # - ndb_redis params - modparam("ndb_redis", "server", "name=srv1;addr=127.0.0.1;port=6379;db=1") # - auth_db params - #!ifdef WITH_AUTH modparam("auth_db", "db_url", DBURL) modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("auth_db", "load_credentials", "") modparam("auth_db", "use_domain", MULTIDOMAIN) #!endif | | Virenfrei. www.avast.com | ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users -- Daniel-Constantin Mierla www.twitter.com/miconda -- www.linkedin.com/in/miconda Kamailio Advanced Training - www.asipto.com Kamailio World Conference - www.kamailioworld.com ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Kamailio+Asterisk - Kamailio doesn't forward INVITE to 2nd Kamailio
Hi all, I have here:Kamailio 1: 192.168.0.11Kamailio 2: 192.168.0.21Asterisk 1: 192.168.0.12 Asterisk1 is registered on Kamailio1 as User 100. Asterisk1 shouldn't be registered on Kamailio2. User 111 registered on Kamailio1User 211 registered on Kamailio2User 121 registered on Asterisk1 Test cases:-111 calls 211 - OK211 calls 111 - OK121 calls 111 - OK121 calls 211 - Kamailio1 doesn't forward INVITE to Kamailio2, Asterisk gets 'Busy' !? Is the approach just to replace destination IP-address in $ru, depending from 1st digit, right? If not, what is the right approach to reach the remote users from Asterisk, which are registered on remote Kamailio and not on the local Kamailio? Thank youRegardsMarko My changes in kamailio.cfg in both kamailios (based on kamailio-basic.cfg) :--kamailio1.bindip = "192.168.0.11" kamailio2.bindip = "192.168.0.21" ...route { if (is_method("INVITE")) { if($rU=~"^1[0-9][0-9]$") { $ru = "sip:" + $rU + "@" + $sel(cfg_get.kamailio1.bindip) + ":5060"; } else if($rU=~"^2[0-9][0-9]$") { $ru = "sip:" + $rU + "@" + $sel(cfg_get.kamailio2.bindip) + ":5060"; }} ... sip.conf in Asterisk1:-- register => 100:abc@192.168.0.124:5060/100 [100] type=friend host=192.168.0.11 secret=abc context=kamailio [121] type=friend secret=abc host=dynamic context=kamailio extensions.conf---[kamailio] exten => _[1-4]XX,1,Dial(SIP/100/${EXTEN},30) exten => _[1-4]XX,n,Hangup() ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] REDIS load problem - Kamailio 5.0.1 - db_redis not found
Hi all, I'm trying to use the Redis database for authentication and later for accounting. I installed Redis on the server, I compiled Kamailio with ndb_redis and the module exists. When I try to start Kamailio I get following errors: 0(16737) ERROR: [db.c:203]: db_bind_mod(): Module db_redis not found. Missing loadmodule? 0(16737) ERROR: auth_db [auth_db_mod.c:175]: mod_init(): unable to bind to a database driver 0(16737) ERROR: [core/sr_module.c:968]: init_mod(): Error while initializing module auth_db (/usr/local/lib64/kamailio/modules/auth_db.so) ERROR: error while initializing modules Bellow are the relevant parts from config files. Is there any example of kamailio.cfg with Redis configuration and commands for authentication and accounting? Please help me to use Kamailio with Redis. Thank youRegardsMarko kamctlrc - DBENGINE=DBTEXT kamailio.cfg - #!define WITH_REDIS #!define WITH_AUTH #!ifdef WITH_REDIS #!define DBURL "redis://localhost:6379/" #!endif #!ifdef WITH_AUTH loadmodule "auth.so" loadmodule "auth_db.so" #!endif #!ifdef WITH_REDIS loadmodule "ndb_redis.so" #!endif # - ndb_redis params - modparam("ndb_redis", "server", "name=srv1;addr=127.0.0.1;port=6379;db=1") # - auth_db params - #!ifdef WITH_AUTH modparam("auth_db", "db_url", DBURL) modparam("auth_db", "calculate_ha1", yes) modparam("auth_db", "password_column", "password") modparam("auth_db", "load_credentials", "") modparam("auth_db", "use_domain", MULTIDOMAIN) #!endif | | Virenfrei. www.avast.com | ___ Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[SR-Users] Fw: Kamailio 5.0 doesn't forward Authorization (Digest username) to Asterisk
Hi Daniel, yes I want to register my SIP clients twice to have full media path through Asterisk. Now I register eg. clients 31 & 32 on Kamailio and when I try to call 31->32 then my call reaches Asterisk but it doesn't find the callee because it isn't registered in Asterisk. Am I right that Kamailio cuts a part of register message header (Authorisation - Digest name) which it receives from SIP-client and forward just such shortened message to Asterisk or there is an other problem? Is there any better approach for above requirement (full media path through Asterisk for all calls and for all users registered by Kamailio)? Thank youRegardsMarko - Forwarded Message - From: Daniel-Constantin Mierla <mico...@gmail.com> To: Marko Tirs <marko.t...@yahoo.com>; Kamailio (SER) - Users Mailing List <sr-us...@lists.sip-router.org> Sent: Thursday, April 6, 2017 11:25 AM Subject: Re: [SR-Users] Kamailio 5.0 doesn't forward Authorization (Digest username) to Asterisk Hello, I am not sure I got the proper picture of what do you want to achieve. Do you want to authenticate the registration twice, once by kamailio and second by asterisk? Cheers, Daniel On 03.04.17 01:05, Marko Tirs wrote: Hello all, I am trying to use Kamailio 5.0 with Asterisk (separate IP addresses, both port 5060), but Asterisk doesn't register the SIP clients which comes through Kamailio. If I register the same user directly to the Asterisk then it works! 1st REGISTER is also without Authorization (Digest name) but in the 2nd REGISTER it exists and registration goes OK. How to use Kamailio with Asterisk in the way the SIP client is registered on both of them? Thank you Marko SIP-CLIENT DIRECTLY TO ASTERISK: --- 1 2017-04-01 15:20:48.331806 192.168.0.12 192.168.0.2 SIP 544 Request: REGISTER sip:192.168.0.2 (1 binding) | 2 2017-04-01 15:20:48.332998 192.168.0.2 192.168.0.12 SIP 626 Status: 401 Unauthorized | 3 2017-04-01 15:20:48.333814 192.168.0.12 192.168.0.2 SIP 700 Request: REGISTER sip:192.168.0.2 (1 binding) | 4 2017-04-01 15:20:48.335975 192.168.0.2 192.168.0.12 SIP 647 Status: 200 OK (1 binding) | Frame 3: 700 bytes on wire (5600 bits), 700 bytes captured (5600 bits) on interface 0 Ethernet II, Src: AsrockIn_0a:0b:46 (70:85:c2:0a:0b:46), Dst: Raspberr_a1:fd:f7 (b8:27:eb:a1:fd:f7) Internet Protocol Version 4, Src: 192.168.0.12, Dst: 192.168.0.2 User Datagram Protocol, Src Port: 64369, Dst Port: 5060 Session Initiation Protocol (REGISTER) Request-Line: REGISTER sip:192.168.0.2 SIP/2.0 Message Header Via: SIP/2.0/UDP192.168.0.12:64369;rport;branch=z9hG4bKPj9f8759c0537b4834bb411358d0b0a2ff Max-Forwards: 70 From: "33" <sip:33@192.168.0.2>;tag=4c586be1fcf842359e7d429abcb0b213 To: "33" <sip:33@192.168.0.2> Contact:<sip:74081936@192.168.0.12:64369>;+sip.instance="" Call-ID: d3c240808c934b77a9bbcb8bd4c1bd8c CSeq: 2 REGISTER Expires: 600 Supported: gruu User-Agent: Blink 3.0.0 (Windows) Authorization: Digest username="33", realm="asterisk", nonce="76ca37d8", uri="sip:192.168.0.2", response="19fc1a634abc72c41dcb516470c34fc2", algorithm=MD5 Authentication Scheme: Digest Username: "33" Realm: "asterisk" Nonce Value: "76ca37d8" Authentication URI: "sip:192.168.0.2" Digest Authentication Response: "19fc1a634abc72c41dcb516470c34fc2" Algorithm: MD5 Content-Length: 0 SIP-CLIENT TO KAMAILIO WITH FORWARD TO ASTERISK: -- 11 2017-04-01 15:21:06.806347 192.168.0.13 192.168.0.2 SIP 459 Request: REGISTER sip:192.168.0.2:5060 (1 binding) | 12 2017-04-01 15:21:06.807514 192.168.0.2 192.168.0.13 SIP 608 Status: 401 Unauthorized | 13 2017-04-01 15:21:06.814819 192.168.0.13 192.168.0.2 SIP 456 Request: REGISTER sip:192.168.0.2:5060 (remove 1 binding) | 14 2017-04-01 15:21:06.815712 192.168.0.2 192.168.0.13 SIP 608 Status: 401 Unauthorized | 15 2017-04-01 15:21:06.821125 192.168.0.13 192.168.0.2 SIP 459 Request: REGISTER sip:192.168.0.2:5060 (1 binding) | 16 2017-04-01 15:21:06.821910 192.168.0.2 192.168.0.13 SIP 608 Status: 401 Unauthorized | Frame 15: 459 bytes on wire (3672 bits), 459 bytes captured (3672 bits) on interface 0 Ethernet II, Src: Micro-St_de:b2:3a (00:24:21:de:b2:3a), Dst: Raspberr_a1:fd:f7 (b8:27:eb:a1:fd:f7) Internet Protocol V