Hello,
you have an explicit set of $fs, which is setting the send socket. You have to do then when receiving from WS, not when going to WS.
In 5.1, you can try to enable:
- https://www.kamailio.org/docs/modules/stable/modules/path.html#path.p.enable_r2
and then let kamailio do all about send socket (remove the assignments to $fs).
Cheers,
Daniel
Hi,
Im new to Kamailio so im sorry if some of my questions will sound a bit wierd :=)
i have a setup like this: (Kamailio version 5.1)
UA > Kamailio > Freeswitch
Kamailio forwards registration to freeswitch without saving location.
I have configured sip over websockets and im able to register to Freeswitcha via kamailio.Also, i use add_path_received() so kamailio adds a path header to register messages
recv 945 bytes from udp/[192.168.50.60]:5060 at 22:38:07.283809:------------------------------------------------------------------------REGISTER sip:192.168.50.60 SIP/2.0Via: SIP/2.0/UDP 192.168.50.60;branch=z9hG4bKa929.0f66d60c4333f4a3a9d83d41a63295d9.0Via: SIP/2.0/WSS 192.0.2.110;rport=63296;received=192.168.200.77;branch=z9hG4bK6931435Max-Forwards: 69To: <sip:1001@192.168.50.60>From: <sip:1001@192.168.50.60>;tag=vq30modpgdCall-ID: dlnrna9o4ngn25fb9d1vi2CSeq: 196 REGISTERAuthorization: Digest algorithm=MD5, username="1001", realm="192.168.50.60", nonce="744aaa14-4a86-4ce3-b6d6-419b0a34ee90", uri="sip:192.168.50.60", response="9b592b874474d4ffe5769f2410baceef", qop=auth, cnonce="sf7ff0fp8tm5", nc=00000001Contact: <sip:1001@192.0.2.110;transport=ws>;reg-id=1;+sip.instance="<urn:uuid:587f4694-7e55-46dc-a858-579a82556a20>";expires=600Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFERSupported: path, gruu, 100rel, outboundUser-Agent: SIP.js/0.7.0 BBContent-Length: 0------------------------------------------------------------------------send 719 bytes to udp/[192.168.50.60]:5060 at 22:38:07.329444:------------------------------------------------------------------------SIP/2.0 200 OKVia: SIP/2.0/UDP 192.168.50.60;branch=z9hG4bKa929.0f66d60c4333f4a3a9d83d41a63295d9.0Via: SIP/2.0/WSS 192.0.2.110;rport=63296;received=192.168.200.77;branch=z9hG4bK6931435From: <sip:1001@192.168.50.60>;tag=vq30modpgdTo: <sip:1001@192.168.50.60>;tag=Spya88DKU9gSQCall-ID: dlnrna9o4ngn25fb9d1vi2CSeq: 196 REGISTERContact: <sip:1001@192.0.2.110;transport=ws>;expires=600Date: Fri, 09 Feb 2018 21:38:07 GMTUser-Agent: FreeSWITCH-mod_sofia/1.6.19+git~20171120T163416Z~b1b21d0695~64bitAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFYSupported: timer, path, replacesPath: <sip:192.168.50.60>;lr;received=192.168.200.77~63296~6Content-Length: 0------------------------------------------------------------------------
Once, registered, im trying to originate a call to the registered endpoint from freeswitch
this results in an invite like this:
send 1757 bytes to udp/[192.168.50.60]:5060 at 22:46:21.252549:------------------------------------------------------------------------INVITE sip:1001@192.0.2.110;transport=ws SIP/2.0Via: SIP/2.0/UDP 192.168.50.65:15060;rport;branch=z9hG4bKXHcX316pDgXZBRoute: <sip:192.168.50.60>;lr;received=192.168.200.77~63296~6Max-Forwards: 70From: "" <sip:1002@192.168.50.65>;tag=tZQ393yprj7BKTo: <sip:1001@192.0.2.110;transport=ws>Call-ID: 8212b700-8885-1236-08b3-000c293ae94eCSeq: 118770326 INVITEContact: <sip:mod_sofia@192.168.50.65:15060>User-Agent: FreeSWITCH-mod_sofia/1.6.19+git~20171120T163416Z~b1b21d0695~64bitAllow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFYSupported: timer, path, replacesAllow-Events: talk, hold, conference, referContent-Type: application/sdpContent-Disposition: sessionContent-Length: 891X-FS-Support: update_display,send_infoRemote-Party-ID: <sip:1002@192.168.50.65>;party=calling;screen=yes;privacy=off
Freeswitch appends a route header to the invite specifying kamailio as route and a received with original uri.
well, here is the issue ... im failing to hit the SIP over websocket client... Kamailio
my RELAY route is like this
route[RELAY] {
# enable additional event routes for forwarded requests# - serial forking, RTP relaying handling, a.s.o.if (is_method("INVITE|BYE|SUBSCRIBE|UPDATE")) {if(!t_is_set("branch_route")) {xlog("L_ALERT", "Its a Branch, go manage that !!! <$ru>\n");t_on_branch("MANAGE_BRANCH");}}if (is_method("INVITE|SUBSCRIBE|UPDATE")) {if(!t_is_set("onreply_route")) {xlog("L_ALERT", "its onreply_route, go manage !!! <$ru>\n");t_on_reply("MANAGE_REPLY");
}}if (is_method("INVITE")) {if(!t_is_set("failure_route")) {xlog("L_ALERT", "Its failure_route, go manage !!! <$ru>\n");t_on_failure("MANAGE_FAILURE");}}
$fs = "udp:192.168.50.60:5060";xlog("L_ALERT", "Trying to rely !!! <$ru>\n");if (!t_relay()) {xlog("L_ALERT", "failed to rely !!! <$ru>\n");sl_reply_error();}exit;}
here is a part of the log:
Feb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: WARNING: <core> [core/forward.c:231]: get_send_socket2(): protocol/port mismatch (forced udp:192.168.50.60:5060, to ws:192.0.2.110:5060)Feb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: DEBUG: <core> [core/msg_translator.c:424]: clen_builder(): content-length: 916 (916)Feb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: WARNING: <core> [core/msg_translator.c:2765]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be foundFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: ERROR: <core> [core/msg_translator.c:1980]: build_req_buf_from_sip_req(): could not create Via headerFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: ERROR: tm [t_fwd.c:476]: prepare_new_uac(): could not build requestFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: ERROR: tm [t_fwd.c:1735]: t_forward_nonack(): failure to add branchesFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: DEBUG: tm [t_funcs.c:334]: t_relay_to(): t_forward_nonack returned error -2 (-2)Feb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: DEBUG: tm [t_funcs.c:352]: t_relay_to(): -2 error reply generation delayedFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: ERROR: *** cfgtrace:request_route=[RELAY] c=[/etc/kamailio/kamailio.cfg] l=744 a=26 n=xlogFeb 9 22:48:48 incfskamtest01 /usr/sbin/kamailio[14896]: ALERT: <script>: failed to rely !!! <sip:1001@192.0.2.110;transport=ws>
is that because i set a $fu before t_relay() ?
any idea how to approach the issue ?
_______________________________________________ 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 - March 5-7, 2018, Berlin - www.asipto.com Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com