[SR-Users] Kamailio SCTP with CentOS
Hey guys, I've been pulling out my hair for a few days trying to get SCTP with Kamailio working in CentOS 7... with no luck at all. When attempting to start Kamailio via the 'kamctl start' command I get the following error: INFO: Starting Kamailio : ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed When attempting to start Kamailio via the 'systemctl start kamailio' command, I get the following: Job for kamailio.service failed. See 'systemctl status kamailio.service' and 'journalctl -xn' for details. When checking the 'systemctl status kamailio -l' command, I get the following: kamailio.service - SYSV: Kamailio is a fast, reliable and flexible SIP Server. Loaded: loaded (/etc/rc.d/init.d/kamailio) Active: failed (Result: exit-code) since Thu 2015-08-13 00:42:51 AEST; 14s ago Process: 19229 ExecStart=/etc/rc.d/init.d/kamailio start (code=exited, status=1/FAILURE) Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: rr [rr_mod.c:174]: mod_init(): outbound module not available Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: usrloc [hslot.c:51]: ul_init_locks(): locks array size 1024 Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: ctl [init_socks.c:115]: init_unix_sock(): ERROR: init_unix_sock: bind: No such file or directory [2] Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: ctl [ctl.c:273]: mod_init(): ERROR: ctl: mod_init: init ctrl. sockets failed Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: core [sr_module.c:945]: init_mod(): Error while initializing module ctl (/usr/lib64/kamailio/modules/ctl.so) Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: core [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized Aug 13 00:42:51 Elastix5.workgroup kamailio[19229]: Starting kamailio: Aug 13 00:42:51 Elastix5.workgroup systemd[1]: kamailio.service: control process exited, code=exited status=1 Aug 13 00:42:51 Elastix5.workgroup systemd[1]: Failed to start SYSV: Kamailio is a fast, reliable and flexible SIP Server.. Aug 13 00:42:51 Elastix5.workgroup systemd[1]: Unit kamailio.service entered failed state. So I started to think there was an issue with the SCTP config or whether SCTP was enabled in CentOS. However, everything looks fine: # cat /proc/modules sctp 217455 2 - Live 0xa03ed000 # /sbin/lsmod | grep sctp sctp 217455 2 libcrc32c 12644 2 xfs,sctp # more /proc/sys/net/sctp/addip_enable 1 # checksctp SCTP supported SCTP modules installed properly: Package lksctp-tools-devel-1.0.13-3.el7.x86_64 already installed and latest version Package lksctp-tools-doc-1.0.13-3.el7.x86_64 already installed and latest version Package lksctp-tools-1.0.13-3.el7.x86_64 already installed and latest version Running the ' sctp_test' command between two servers, SCTP is working fine... I can capture SCTP packets between the servers. I've left the Kamailio.cfg file as is... with the only modification being made to enable the SCTP module to start: enable_sctp = 1 Checking 'kamailio -v' USE_SCTP is enabled: # kamailio -v version: kamailio 4.3.1 (x86_64/linux) f38e67 flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: f38e67 compiled on 18:17:56 Jul 20 2015 with gcc 4.8.2 I've tried installing Kamailio with the precompiled rpms for CentOS 7, and I also followed some guides on installing in via GIT compiling it myself... however the issue still remains. Any help would be greatly appreciated as I've completely run out of ideas, and there isn't much info on the web about Kamailio SCTP. Thanks, Rob ___ 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
Re: [SR-Users] sdp manipulation in connection with rtpengine_offer/answer calls
On 10/08/15 09:49, Juha Heinanen wrote: Daniel-Constantin Mierla writes: iirc, based on what was discussed on the mailing list, at least in some cases, the full sdp is sent to rtpengine and then full sdp would be returned. That is clear, but which full sdp: the original one or the one changed by previous sdpops calls? I expect to be the originial one. It doesn't do any use of sdpops module. That is clear too. You should use msg_apply_changes() in between them in order to have previous changes visible for further processing. Do you mean that msg_apply_changes() needs to be called between each sdpops call? I thought that the changes made by sdpops calls are cumulative. Some of the sdpops functions were added by others, but I expect they still use the lump mechanism as those I did, so the changes are not immediately visible. You don't need to do msg_apply_changes() after each sdpops change, unless you want that preview change to be visible for next operations. For example, you can call the function to remove a codec twice, once for g711 and once for g729 without msg_apply_change() and all should be fine. However, if you want to remove video media stream and then call rtpengine/rtpproxy, then the msg_apply_changes() would be required in order for rtp relay application not to see the video stream. Cheers, Daniel -- Daniel-Constantin Mierla http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com ___ 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
Re: [SR-Users] Kamailio SCTP with CentOS
Hello, this is likely to be the issue with the default path to ctl socket set in the packaging. Edit your config file, look for the lines: # - mi_fifo params - #modparam(mi_fifo, fifo_name, /var/run/kamailio/kamailio_fifo) # - ctl params - #modparam(ctl, binrpc, unix:/var/run/kamailio/kamailio_ctl) and uncomment the two lines with modparam. Cheers, Daniel On 12/08/15 17:12, Mellow Yellow wrote: Hey guys, I've been pulling out my hair for a few days trying to get SCTP with Kamailio working in CentOS 7... with no luck at all. When attempting to start Kamailio via the /'kamctl start' /command I get the following error: INFO: Starting Kamailio : ERROR: PID file /var/run/kamailio.pid does not exist -- Kamailio start failed When attempting to start Kamailio via the /'systemctl start kamailio' /command, I get the following: Job for kamailio.service failed. See 'systemctl status kamailio.service' and 'journalctl -xn' for details. When checking the 'systemctl status kamailio -l' command, I get the following: kamailio.service - SYSV: Kamailio is a fast, reliable and flexible SIP Server. Loaded: loaded (/etc/rc.d/init.d/kamailio) Active: failed (Result: exit-code) since Thu 2015-08-13 00:42:51 AEST; 14s ago Process: 19229 ExecStart=/etc/rc.d/init.d/kamailio start (code=exited, status=1/FAILURE) Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: rr [rr_mod.c:174]: mod_init(): outbound module not available Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: usrloc [hslot.c:51]: ul_init_locks(): locks array size 1024 Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: ctl [init_socks.c:115]: init_unix_sock(): ERROR: init_unix_sock: bind: No such file or directory [2] Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: ctl [ctl.c:273]: mod_init(): ERROR: ctl: mod_init: init ctrl. sockets failed Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: ERROR: core [sr_module.c:945]: init_mod(): Error while initializing module ctl (/usr/lib64/kamailio/modules/ctl.so) Aug 13 00:42:51 Elastix5.workgroup /usr/sbin/kamailio[19242]: INFO: core [sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized Aug 13 00:42:51 Elastix5.workgroup kamailio[19229]: Starting kamailio: Aug 13 00:42:51 Elastix5.workgroup systemd[1]: kamailio.service: control process exited, code=exited status=1 Aug 13 00:42:51 Elastix5.workgroup systemd[1]: Failed to start SYSV: Kamailio is a fast, reliable and flexible SIP Server.. Aug 13 00:42:51 Elastix5.workgroup systemd[1]: Unit kamailio.service entered failed state. So I started to think there was an issue with the SCTP config or whether SCTP was enabled in CentOS. However, everything looks fine: # cat /proc/modules sctp 217455 2 - Live 0xa03ed000 # /sbin/lsmod | grep sctp sctp 217455 2 libcrc32c 12644 2 xfs,sctp # more /proc/sys/net/sctp/addip_enable 1 # checksctp SCTP supported SCTP modules installed properly: Package lksctp-tools-devel-1.0.13-3.el7.x86_64 already installed and latest version Package lksctp-tools-doc-1.0.13-3.el7.x86_64 already installed and latest version Package lksctp-tools-1.0.13-3.el7.x86_64 already installed and latest version Running the ' sctp_test' command between two servers, SCTP is working fine... I can capture SCTP packets between the servers. I've left the Kamailio.cfg file as is... with the only modification being made to enable the SCTP module to start: enable_sctp = 1 Checking 'kamailio -v' USE_SCTP is enabled: # kamailio -v version: kamailio 4.3.1 (x86_64/linux) f38e67 flags: STATS: Off, USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, USE_MCAST, DNS_IP_HACK, SHM_MEM, SHM_MMAP, PKG_MALLOC, F_MALLOC, DBG_F_MALLOC, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLACKLIST, HAVE_RESOLV_RES ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB poll method support: poll, epoll_lt, epoll_et, sigio_rt, select. id: f38e67 compiled on 18:17:56 Jul 20 2015 with gcc 4.8.2 I've tried installing Kamailio with the precompiled rpms for CentOS 7, and I also followed some guides on installing in via GIT compiling it myself... however the issue still remains. Any help would be greatly appreciated as I've completely run out of ideas, and there isn't much info on the web about Kamailio SCTP. Thanks, Rob ___ 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://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda Book: SIP Routing With Kamailio - http://www.asipto.com
[SR-Users] RTPProxy incorrect port 0 in reply from rtp proxy
Hello, I've been load testing kamailio(4.2) with rtpproxy(2.0) using sipp, and when I hit 50+ CPS I start getting the following error: incorrect port 0 in reply from rtp proxy. I'm running 4 instances of rtpproxy on the same instance as kamailio. Could somebody tell me why I'm receiving this error? Do I need to run more instances of rtpproxy? # #--RTPPROXY Parameters--# modparam(rtpproxy, rtpproxy_sock, udp:127.0.0.1:7721 udp:127.0.0.1:7722 udp:127.0.0.1:7723 udp:127.0.0.1:7724) In request_route: if (is_method(INVITE)) { record_route(); if (has_body(application/sdp)) { rtpproxy_manage(); } } In onreply_route: if (has_body(application/sdp)) { rtpproxy_manage(); } rtpproxy -s udp:127.0.0.1:7721 -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy.pid -l 10.0.0.1 rtpproxy -s udp:127.0.0.1:7722 -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy1.pid -l 10.0.0.1 rtpproxy -s udp:127.0.0.1:7723 -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy2.pid -l 10.0.0.1 rtpproxy -s udp:127.0.0.1:7724 -u rtpproxy rtpproxy -p /var/run/rtpproxy/rtpproxy3.pid -l 10.0.0.1 Regards, Grant ___ 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
Re: [SR-Users] sdp manipulation in connection with rtpengine_offer/answer calls
Camille Oudot writes: i've created a merge request on the master branch to add the rtpengine input SDP pv. I'm not sure if modifying sdpops to work also on variables would be straightforward, but anyway, most operations can be done using transformations. thanks. yes, i looked at some sdpops functions and they operate heavily on message and lumps. -- juha ___ 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
Re: [SR-Users] Help with sip balancer
Thankyou Alexandru for your suggestions. I'll give it a try tomorrow and will report my progress here. It seems that i'm not so far from the result! Bruno Il giorno mar 11 ago 2015 alle 23:44 Alexandru Covalschi 568...@gmail.com ha scritto: Also, take a look at kamailio-advanced.cfg, there is PSTN GW route already included. Also you can use LCR for routing calls to different providers, a simple guide can be found here http://dopensource.com/least-cost-routing-with-kamailio-v4-1/ 2015-08-12 0:41 GMT+03:00 Alexandru Covalschi 568...@gmail.com: First of all I'd suggest to use http://kb.asipto.com/asterisk:realtime:kamailio-4.0.x-asterisk-11.3.0-astdb guide in combination with http://saevolgo.blogspot.com/2011/11/how-to-increasing-voip-services.html But, assuming your platform is behind NAT, you need: 1st. Use rtpengine instead of rtpproxy. You can read about how to advertise your external public adress on rtpengine git page. 2nd. In Kamailio configuration when you define listen, you should use listen - advertise construction ( http://www.kamailio.org/wiki/cookbooks/4.0.x/core#listen). 3d. Be sure to leave secret column empty on asterisk database, otherwise all users registered on asterisks won't have OK status, what can cause problems with queues etc. 2015-08-12 0:19 GMT+03:00 Bruno d4rks...@gmail.com: Hello, i'm on my first try with kamailio. I need to build a SIP balancer that should keep SIP registration from VoIP provider and route the calls to the asterisk boxes where an IVR will take care to answer. Here's my network topology: +--- [asterisk1] [public_ip] |10.50.10.131 [router] ---NAT--- [kamailio] ---+ 10.50.10.110.50.10.120| +--- [asterisk2] 10.50.10.132 In my setup i planned to use UAC and DISPATCHER modules. I started from the kamailio-basic.cfg and added some extra lines to handle UAC and DISPATCHER. All is working fine when i do a test call from a softphone inside network 10.50.10.0/24. When a call is coming from the sip carrier, troubles occurs because asterisk boxes are sending their internal ip in SDP. I understand that i need to rewrite SDP in that case, but i actually don't know how/where. I've attached kamailio configuration and a sip trace taken with sngrep where the problem is visible. For security reasons, i would like to force the RTP through RTPProxy. I'm missing something, and need your help me to understand my errors. Best Regards, Bruno ___ 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 -- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/ -- Alexandru Covalschi ABRISS-Solutions VoIP engineer and system administrator phone: +37367398493 web: http://abs-telecom.com/ ___ 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
[SR-Users] XCap Server + Postgre
Hi! I'm experience really strange behavior of Kamailio. Right now it's using postgre database When trying to implement XCAP server capabilities, according to http://kamailio.org/docs/modules/4.3.x/modules/xcap_server.html#idp76784 on a block if (!www_authorize(xcap, subscriber)) { www_challenge(xcap, 0); exit; } While trying to test it via browser (user test, pass test) I've got these errors in log Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: db_postgres [km_dbase.c:247]: db_postgres_submit_query(): 0x7f3fb0660b10 PQsendQuery Error: ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012 Query: select password from subscriber where extension='test' AND user_context='xcap' Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: core [db_query.c:132]: db_do_query_internal(): error while submitting query Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: auth_db [authorize.c:175]: get_ha1(): failed to query database Without this block, I don't get user auth. Is it a bug or it's mine misconfiguration? -- Best regards, Igor ___ 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
Re: [SR-Users] XCap Server + Postgre
Sure I have. But no field 'extension' in it среда, 12 августа 2015 г. пользователь Asgaroth 00asgarot...@gmail.com написал: Hi Igor, I personally don’t use the xcap module, but looking at that error message, it seems to me that Kamailio cannot find the subscriber table which it will use to lookup the authentication details. Are you sure you have your Kamailio database and Kamailio database related settings setup properly? Cheers *From:* sr-users [mailto:sr-users-boun...@lists.sip-router.org javascript:_e(%7B%7D,'cvml','sr-users-boun...@lists.sip-router.org');] *On Behalf Of *Igor Olhovskiy *Sent:* Wednesday 12 August 2015 11:37 *To:* sr-users@lists.sip-router.org javascript:_e(%7B%7D,'cvml','sr-users@lists.sip-router.org'); *Subject:* [SR-Users] XCap Server + Postgre Hi! I'm experience really strange behavior of Kamailio. Right now it's using postgre database When trying to implement XCAP server capabilities, according to http://kamailio.org/docs/modules/4.3.x/modules/xcap_server.html#idp76784 on a block if (!www_authorize(xcap, subscriber)) { www_challenge(xcap, 0); exit; } While trying to test it via browser (user test, pass test) I've got these errors in log Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: db_postgres [km_dbase.c:247]: db_postgres_submit_query(): 0x7f3fb0660b10 PQsendQuery Error: ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012 Query: select password from subscriber where extension='test' AND user_context='xcap' Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: core [db_query.c:132]: db_do_query_internal(): error while submitting query Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: auth_db [authorize.c:175]: get_ha1(): failed to query database Without this block, I don't get user auth. Is it a bug or it's mine misconfiguration? -- Best regards, Igor -- Best regards, Igor ___ 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
Re: [SR-Users] XCap Server + Postgre
Hi Igor, I personally don’t use the xcap module, but looking at that error message, it seems to me that Kamailio cannot find the subscriber table which it will use to lookup the authentication details. Are you sure you have your Kamailio database and Kamailio database related settings setup properly? Cheers From: sr-users [mailto:sr-users-boun...@lists.sip-router.org] On Behalf Of Igor Olhovskiy Sent: Wednesday 12 August 2015 11:37 To: sr-users@lists.sip-router.org Subject: [SR-Users] XCap Server + Postgre Hi! I'm experience really strange behavior of Kamailio. Right now it's using postgre database When trying to implement XCAP server capabilities, according to http://kamailio.org/docs/modules/4.3.x/modules/xcap_server.html#idp76784 on a block if (!www_authorize(xcap, subscriber)) { www_challenge(xcap, 0); exit; } While trying to test it via browser (user test, pass test) I've got these errors in log Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:235]: db_postgres_submit_query(): postgres result check failed with code 7 (PGRES_FATAL_ERROR) Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: WARNING: db_postgres [km_dbase.c:239]: db_postgres_submit_query(): postgres query command failed, connection status 0, error [ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012] Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: db_postgres [km_dbase.c:247]: db_postgres_submit_query(): 0x7f3fb0660b10 PQsendQuery Error: ERROR: relation subscriber does not exist#012LINE 1: select password from subscriber where extension='test' AND u...#012 ^#012 Query: select password from subscriber where extension='test' AND user_context='xcap' Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: core [db_query.c:132]: db_do_query_internal(): error while submitting query Aug 12 12:34:57 sip01 /usr/sbin/kamailio[7655]: ERROR: auth_db [authorize.c:175]: get_ha1(): failed to query database Without this block, I don't get user auth. Is it a bug or it's mine misconfiguration? -- Best regards, Igor ___ 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
Re: [SR-Users] kamailio as SIP Agent
Hi, Can you please tell me under which route i need keep those values. Whether in the RELAY route or ASTERISK rotue? Regards, Sandeep Warm Regards, Sandeep Chakravarthi. On Tue, Aug 11, 2015 at 11:03 PM, SamyGo govoi...@gmail.com wrote: 1 - Take a look at the Kamailio transformations and psuedo-variable page. change the $td to the IP of the MSC; modify the $ru as $rU + @ 172.22.12.100:5060 where this is IP of MSC side. 2 - Wireshark guys could've said it SIP-3 - point is it doesnt matter at this point since you know your MSC is replying back and talking to you. On Tue, Aug 11, 2015 at 1:16 PM, Sandeep Chakravarthi ivschakravar...@gmail.com wrote: Yes, You are right and done the changes as you suggested. Kamailio server is forwarding the call to MSC. But two issues are there. 1 .In the INVITE packet which is being sent from kamailio server to MSC, it is coming Request-Line: INVITE sip:0730092190@*172.22.14.12* That is my kamailio server IP and it should be MSC IP(172.28.0.68) and as of now call is failing as MSC is sending 404 error. 2. Other issue is , in the pcap file it is coming SIP/SDP as protocol and it is not coming SIP-I. Please find the latest attached pcap. Regards, Sandeep Warm Regards, Sandeep Chakravarthi. On Tue, Aug 11, 2015 at 9:47 PM, SamyGo govoi...@gmail.com wrote: Thats because your configuration file is not sending packet out (RELAY) to MSC instead it is only doing a Loadbalancer / destination lookup in TOASTERISK route and comes out of it, processes the following routes in order route(SIPOUT); route(PRESENCE); route(REGISTRAR); route(PSTN); route(LOCATION); Where finally in LOCATION route it tries to find the destination user 0730092190 online locally on Kamailio, which it can't find and says 404 Not Found. You should modify your TOASTERISK route as follow: route[TOASTERISK] { if(ds_is_from_list(2)) { #Call from Telco Should goto Asterisk pool in Loadbalanced mode if(!ds_select_dst(1, 4)) { sl_send_reply(500, Service Unavailable); xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations available for $rd \n); exit; } route(RELAY); }if(ds_is_from_list(1)) { #Call from Asterisk servers pool, send it to telco using LoadBalancer if(!ds_select_dst(2, 4)) { sl_send_reply(500, Service Unavailable); xlog(L_INFO,[$fU@$si:$sp]{$rm} No destinations available for $rd \n); exit; } route(RELAY); } } This will immediately route the packet out towards the new $du after the loadbalancer function ds_select_dst(...) On Tue, Aug 11, 2015 at 10:48 AM, Sandeep Chakravarthi ivschakravar...@gmail.com wrote: Hi, Kamailio is sending 404 Response and its not MSC. If you see the pcap file , Kamailio has to forward the SIP invite packet to MSC which it got from Asterisk server. But it is not happening. I am attaching the pcap one more time for your reference. In my pcap, below are the server details 172.22.14.12 - Kamailio server 172.22.14.17 - Asterisk server 172.22.0.68 - MSC Regards, Sandeep Warm Regards, Sandeep Chakravarthi. On Tue, Aug 11, 2015 at 7:10 PM, SamyGo govoi...@gmail.com wrote: Hi Sandeep, what is the problem here ? Kamailio just sends a 404 on its own or is really sending calls to MSC and MSC is replying with 404 ? On Mon, Aug 10, 2015 at 12:33 PM, Sandeep Chakravarthi ivschakravar...@gmail.com wrote: Hi , Sorry for the delayed reply. I have configured my Asterisk and kamailio server, but when i initiate one outbound call from my asterisk server to kamailio server, kamailio server is initiating the call to MSC. Please find the attached pcap details for your reference. Below is my kamailio debug log and kamailio.cfg file. Please check the pcap and below cfg file and log file and let me know whether to change anything in cfg file or not. request_route { # per request initial checks route(REQINIT); # NAT detection route(NATDETECT); # CANCEL processing if (is_method(CANCEL)) { if (t_check_trans()) { route(RELAY); } exit; } # handle requests within SIP dialogs route(WITHINDLG); ### only initial requests (no To tag) t_check_trans(); # authentication route(AUTH); # record routing for dialog forming requests (in case they are routed) # - remove preloaded route headers remove_hf(Route); if (is_method(INVITE|SUBSCRIBE)) record_route(); # account only INVITEs if (is_method(INVITE)) {