See the end of quoted log. It tries to resolve ```sip:s7t25aae@r2r3d4o15av3.invalid;transport=ws``` as traditional SIP URI, and fails. Need support of WS and WSS URIs.
``` Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: cnxcc [cnxcc_check.c:87]: check_calls_by_money(): CID [kqBcNZPwNa], start_timestamp [1423857429], seconds alive [9], consumed credit [10.000000] Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: INFO: cnxcc [cnxcc_check.c:96]: check_calls_by_money(): ec=0.000000, ca=10.000000, ca2=9.000000 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: cnxcc [cnxcc_check.c:109]: check_calls_by_money(): Client [customer_name] | Ended-Calls-Credit-Spent: 0.000000 TotalCredit/MaxCredit: 10.000000/10.000000 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: cnxcc [cnxcc_mod.c:894]: terminate_all_calls(): Killing call with CID [kqBcNZPwNa] Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: cnxcc [cnxcc_mod.c:967]: terminate_call(): Got kill signal for call [kqBcNZPwNa] client [customer_name] h_id [4713] h_entry [335]. Dropping it now Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_req_within.c:492]: mi_terminate_dlg(): h_entry 335 h_id 4713 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_hash.c:633]: dlg_lookup(): ref dlg 0x7ff48c38bde8 with 1 -> 3 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_hash.c:635]: dlg_lookup(): dialog id=4713 found on entry 335 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_req_within.c:347]: send_bye(): sending BYE to caller Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: tm [uac.c:249]: t_uac_prepare(): DEBUG:tm:t_uac: next_hop=sip:1000@195.138.73.151:1904 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: tm [uac.c:150]: dlg2hash(): DEBUG: dlg2hash: 61830 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_req_within.c:380]: send_bye(): BYE sent to caller Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_req_within.c:347]: send_bye(): sending BYE to callee Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: tm [uac.c:249]: t_uac_prepare(): DEBUG:tm:t_uac: next_hop=sip:s7t25aae@r2r3d4o15av3.invalid;transport=ws Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: ERROR: <core> [resolve.c:1693]: sip_hostport2su(): could not resolve hostname: "r2r3d4o15av3.invalid" Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: ERROR: tm [ut.h:319]: uri2dst2(): failed to resolve "r2r3d4o15av3.invalid" Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: ERROR: tm [uac.c:272]: t_uac_prepare(): t_uac: no socket found Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: ERROR: dialog [dlg_req_within.c:374]: send_bye(): failed to send the BYE request Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: DEBUG: dialog [dlg_hash.c:851]: dlg_unref(): unref dlg 0x7ff48c38bde8 with 1 -> 2 Feb 13 19:57:18 vmwrtc /usr/local/sbin/kamailio[12467]: ERROR: cnxcc [cnxcc_mod.c:1013]: terminate_call(): Error executing dlg_end_dlg command. Return code was [500] ``` I'm trying to fix this in code by myself, but any guidance and help is appreciated, as I'm not experienced in Kamailio internals.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85
What version are you using? Have you used set_contact_alias() for the initial invite + 200ok?
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74319426
``` # git describe 3.0_pre1-8035-g2d6d34b ``` No, I don't have ```set_contact_alias()``` anywhere in routing config. Going to google how I'm supposed to use it.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74319987
kamailio -V to get the version.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74320295
``` # kamailio -V version: kamailio 4.3.0-dev4 (x86_64/linux) 2d6d34 flags: STATS: Off, USE_TCP, USE_TLS, 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: 2d6d34 compiled on 14:55:23 Feb 13 2015 with gcc 4.8.2 ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74320349
I have two ```add_contact_alias()``` entries, my config is based on https://github.com/caruizdiaz/kamailio-ws/blob/master/kamailio-ws.cfg
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74321086
Cnxcc is actually sending the BYE correctly but the destination is unreachable, and that's a routing problem.
As Daniel mentioned, make sure you are using contact alias.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74321261
Cnxcc is actually sending the BYE correctly
Actually it is NOT sending BYE because it fails to resolve the destination.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74321542
Could anybody recommend a good place and a good codeline to insert to this config for that? https://github.com/caruizdiaz/kamailio-ws/blob/master/kamailio-ws.cfg
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74321972
Procedurally speaking, it is. The module delivers the instruction to the networking layer which is the one responsible for sending it and reporting failures. Cnxcc assumes every piece of data is correct and acts on that basis.
The config you are using is outdated, check the logs and try to change it according to your network topology. I will try to update it during the weekend.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74322625
Carlos is right about cnxcc doing the right thing, the bye is anyhow sent effectively by the tm module, but it doesn't have the proper destination details, because when dialog was created the contact address was left only the one set by the browser. In webrtc, the contact address is an 'invalid' value.
Replace add_contact_alias() with set_contact_alias().
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74322860
Closed #85.
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#event-235656654
@caruizdiaz sorry for that stupid comment :) Would be very interesting to check your updated config, and thank you for the config you have already shared.
Thanks a lot @miconda! Now it works. ``` Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: cnxcc [cnxcc_mod.c:967]: terminate_call(): Got kill signal for call [ut5OuRS9cO] client [customer_name] h_id [66] h_entry [1881]. Dropping it now Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_req_within.c:492]: mi_terminate_dlg(): h_entry 1881 h_id 66 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_hash.c:633]: dlg_lookup(): ref dlg 0x7f3490150928 with 1 -> 3 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_hash.c:635]: dlg_lookup(): dialog id=66 found on entry 1881 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [dset.c:892]: uri_restore_rcv_alias(): decoded sip:1000@195.138.73.151:1904;alias=195.138.73.151~1904~1 => [sip:1000@195.138.73.151:1904] [sip:195.138.73.151:1904] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_req_within.c:347]: send_bye(): sending BYE to caller Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: tm [uac.c:249]: t_uac_prepare(): DEBUG:tm:t_uac: next_hop=sip:195.138.73.151:1904 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: tm [uac.c:150]: dlg2hash(): DEBUG: dlg2hash: 63376 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_req_within.c:380]: send_bye(): BYE sent to caller Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [dset.c:892]: uri_restore_rcv_alias(): decoded sip:sqvnd5ke@3nk2afm1fqss.invalid;transport=ws;alias=195.138.73.151~19101~5 => [sip:sqvnd5ke@3nk2afm1fqss.invalid;transport=ws] [sip:195.138.73.151:19101;transport=ws] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_req_within.c:347]: send_bye(): sending BYE to callee Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: tm [uac.c:249]: t_uac_prepare(): DEBUG:tm:t_uac: next_hop=sip:195.138.73.151:19101;transport=ws Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: tm [uac.c:150]: dlg2hash(): DEBUG: dlg2hash: 11225 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_conn.c:431]: wsconn_get(): wsconn_get for id [3] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_conn.c:439]: wsconn_get(): wsconn_get returns wsc [0x7f349014ee30] refcnt [2] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_frame.c:753]: ws_frame_transmit(): Tx message:#012BYE sip:sqvnd5ke@3nk2afm1fqss.invalid;transport=ws SIP/2.0#015#012Via: SIP/2.0/WS vmwrtc.intersog.com:10060;branch=z9hG4bK9db2.48d55d64000000000000000000000000.0#015#012To: sip:1001@vmwrtc.intersog.com;tag=3b2vk2bh7k#015#012From: sip:1000@vmwrtc.intersog.com;tag=cSuHqPRcg#015#012CSeq: 21 BYE#015#012Call-ID: ut5OuRS9cO#015#012Content-Length: 0#015#012User-Agent: kamailio (4.3.0-dev4 (x86_64/linux))#015#012Max-Forwards: 70#015#012#015#012 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_frame.c:152]: encode_and_send_ws_frame(): encoding WebSocket frame Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_frame.c:183]: encode_and_send_ws_frame(): supported non-control frame: 0x1 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2208]: tcpconn_send_put(): tcp connection found (0x7f3490135400), acquiring fd Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15937]: DEBUG: <core> [tcp_main.c:3473]: handle_ser_child(): read response= 7f3490135400, 2, fd -1 from 11 (15922) Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2218]: tcpconn_send_put(): c=0x7f3490135400, n=16 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2248]: tcpconn_send_put(): after receive_fd: c= 0x7f3490135400 n=8 fd=10 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2427]: tcpconn_do_send(): sending... Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2461]: tcpconn_do_send(): after real write: c= 0x7f3490135400 n=389 fd=10 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: <core> [tcp_main.c:2462]: tcpconn_do_send(): buf=#012<81>~#001<81>BYE sip:sqvnd5ke@3nk2afm1fqss.invalid;transport=ws SIP/2.0#015#012Via: SIP/2.0/WS vmwrtc.intersog.com:10060;branch=z9hG4bK9db2.48d55d64000000000000000000000000.0#015#012To: sip:1001@vmwrtc.intersog.com;tag=3b2vk2bh7k#015#012From: sip:1000@vmwrtc.intersog.com;tag=cSuHqPRcg#015#012CSeq: 21 BYE#015#012Call-ID: ut5OuRS9cO#015#012Content-Length: 0#015#012User-Agent: kamailio (4.3.0-dev4 (x86_64/linux))#015#012Max-Forwards: 70#015#012#015#012 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_conn.c:384]: wsconn_put(): wsconn_put start for [0x7f349014ee30] refcnt [2] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: websocket [ws_conn.c:417]: wsconn_put(): wsconn_put end for [0x7f349014ee30] refcnt [1] Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_req_within.c:380]: send_bye(): BYE sent to callee Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: dialog [dlg_hash.c:851]: dlg_unref(): unref dlg 0x7f3490150928 with 1 -> 2 Feb 13 20:40:40 vmwrtc /usr/local/sbin/kamailio[15922]: DEBUG: cnxcc [cnxcc_mod.c:1005]: terminate_call(): dlg_end_dlg sent to call [ut5OuRS9cO] ```
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74323720
This is the way we give back all we receive from the community @krieger-od.
If you find bugs or have improvements, don't forget to pull-request ;)
--- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/issues/85#issuecomment-74325804