[SR-Users] MSRP over Websockets

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 24 15:22:40 CEST 2015


Hello,

the first log messages indicate that the tls connect failed. Are the two
msrp clients connected to the msrp relay, because for websocket the
server cannot connect further as a client.

Cheers,
Daniel

On 24/09/15 14:23, vamsi wrote:
>
>
> Hi,
>
> I am trying to configure MSRP over websocket and using Crocodilr-msrp
> client i am ablento connect but when I try to transfer any file it
> gives me the below error.
>
> Any thoughts is appreciated.
>
> I am able to do audio, video and messaging using SIP-JSSIP client and
> working fine.
>
> Error - Log
> --------------
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: tls
> [tls_server.c:208]: tls_complete_init(): Using initial TLS domain
> TLSc<default> (dom 0x7f35500d4858 ctx 0x7f355013d620 sn [])
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: tls
> [tls_domain.c:701]: sr_ssl_ctx_info_callback(): SSL handshake started
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: ERROR: <core>
> [tcp_main.c:2654]: tcpconn_1st_send(): connect10.205.64.24:8084
> <http://10.205.64.24:8084> failed (RST) Connection refused
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: ERROR: <core>
> [tcp_main.c:2664]: tcpconn_1st_send():10.205.64.24:8084
> <http://10.205.64.24:8084>: connect & send  for 0x7f35501bca20 failed:
> Connection refused (111)
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: <core>
> [tcp_main.c:2858]: tcpconn_chld_put(): destroying connection
> 0x7f35501bca20 (24, -1) flags 0060
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: ERROR: msrp
> [msrp_netio.c:178]: msrp_relay(): forwarding frame failed
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: exec: ***
> cfgtrace:request_route=[DEFAULT_EVENT]
> c=[/usr/local/etc/kamailio/kamailio.cfg] l=1202 a=2 n=exit
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: <core>
> [tcp_read.c:1153]: ws_process_msg(): WebSocket Message:
> [[>>>#012??#011?i#036'?$Mu?Ik#022?#001,I?#005>t?'Z*?=q#012?#010jO?IsT?#031m#035?F/#027?[.#022?_*#011?]$#037?Q*#010?G/#027?\&#011?G+#021?]*#020?^*#034?#012n#007?#032lW?S1#010?Y0#025?\0#021?G,#023?Q.#037?Fm#011?Y*#022?G)#011?P)#021?\(#021?RjD?IsT?#031$#010?<<<]]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_conn.c:429]: wsconn_get(): wsconn_get for id [22]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_conn.c:437]: wsconn_get(): wsconn_get returns wsc [0x7f3550140930]
> refcnt [2]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_frame.c:415]: decode_and_validate_ws_frame(): decoding WebSocket frame
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_frame.c:456]: decode_and_validate_ws_frame(): supported
> non-control frame: 0x2
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_frame.c:555]: decode_and_validate_ws_frame(): Rx (decoded): MSRP
> u5xh2ntl SEND#015#012To-Path:
> msrps://10.205.64.24:8084/s.10458.4.561447274;tcp
> <http://10.205.64.24:8084/s.10458.4.561447274;tcp>
> msrps://10.205.64.24:8084/s.10453.7.297645663;tcp
> <http://10.205.64.24:8084/s.10453.7.297645663;tcp>
> msrp://i64fn3tc.invalid:2855/g14o60krz6;ws#015#012From-Path:
> msrp://grtsrfd0.invalid:2855/505z40k5b1;ws#015#012Message-ID:
> 3652053096.cr4l1e1q#015#012Success-Report: yes#015#012Failure-Report:
> yes#015#012Byte-Range: 2049-4096/68240#015#012Content-Type:
> application/vnd.openxmlformats-officedocument.wordprocessingml.document#015#012#015#012
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_frame.c:671]: ws_frame_receive(): Rx MSRP frame:#012MSRP u5xh2ntl
> SEND#015#012To-Path: msrps://10.205.64.24:8084/s.10458.4.561447274;tcp
> <http://10.205.64.24:8084/s.10458.4.561447274;tcp>
> msrps://10.205.64.24:8084/s.10453.7.297645663;tcp
> <http://10.205.64.24:8084/s.10453.7.297645663;tcp>
> msrp://i64fn3tc.invalid:2855/g14o60krz6;ws#015#012From-Path:
> msrp://grtsrfd0.invalid:2855/505z40k5b1;ws#015#012Message-ID:
> 3652053096.cr4l1e1q#015#012Success-Report: yes#015#012Failure-Report:
> yes#015#012Byte-Range: 2049-4096/68240#015#012Content-Type:
> application/vnd.openxmlformats-officedocument.wordprocessingml.document#015#012#015#012
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_conn.c:382]: wsconn_put(): wsconn_put start for [0x7f3550140930]
> refcnt [2]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: websocket
> [ws_conn.c:415]: wsconn_put(): wsconn_put end for [0x7f3550140930]
> refcnt [1]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:171]: msrp_parse_fline(): MSRP FLine: [1] [MSRP]
> [u5xh2ntl] [SEND] [1] []
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c0d1b8) [To-Path] [2]
> [msrps://10.205.64.24:8084/s.10458.4.561447274;tcp
> <http://10.205.64.24:8084/s.10458.4.561447274;tcp>
> msrps://10.205.64.24:8084/s.10453.7.297645663;tcp
> <http://10.205.64.24:8084/s.10453.7.297645663;tcp>
> msrp://i64fn3tc.invalid:2855/g14o60krz6;ws]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c0c918) [From-Path] [1]
> [msrp://grtsrfd0.invalid:2855/505z40k5b1;ws]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c0ed80) [Message-ID] [4] [3652053096.cr4l1e1q]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c0ee10) [Success-Report] [7] [yes]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c1a868) [Failure-Report] [0] [yes]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c0c9a8) [Byte-Range] [5] [2049-4096/68240]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:327]: msrp_parse_headers(): MSRP Header:
> (0x7f3558c107d8) [Content-Type] [8]
> [application/vnd.openxmlformats-officedocument.wordprocessingml.document]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_parser.c:356]: msrp_parse_headers(): MSRP Body: [2050] [[#012#012]]
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: msrp
> [msrp_mod.c:468]: msrp_frame_received(): executing
> event_route[msrp:frame-in] (3)
>
> Sep 23 23:11:36 ip-10-205-64-24 kamailio[10460]: DEBUG: <core>
> [parser/msg_par
>
> ***********
> Kamailio.cfg
> ****************
>
>                 #!ifdef WITH_MSRP
>
> event_route[msrp:frame-in] {
>
>         msrp_reply_flags("1");
>
>         if ((($Rp == MY_WS_PORT || $Rp == MY_WSS_PORT)
>
>                 && !(proto == WS || proto == WSS)) && $Rp !=
> MY_MSRP_PORT) {
>
>                 xlog("L_WARN", "MSRP request received on $Rp\n");
>
>                 msrp_reply("403", "Action-not-allowed");
>
>                 exit;
>
>         }
>
>         if (msrp_is_reply()) {
>
>                 msrp_relay();
>
>         } else if($msrp(method)=="AUTH") {
>
>                 if($msrp(nexthops)>0) {
>
>                         msrp_relay();
>
>                         exit;
>
>                 }
>
>                 if (!www_authenticate("MY_DOMAIN", "subscriber",
>
>                                         "$msrp(method)")) {
>
>                         if (auth_get_www_authenticate("MY_DOMAIN", "1",
>
>                                                         "$var(wauth)")) {
>
>                                 msrp_reply("401", "Unauthorized",
>
>                                                         "$var(wauth)");
>
>                         } else {
>
>                                 msrp_reply("500", "Server Error");
>
>                         }
>
>                         exit;
>
>                 }
>
>                 
>
>                 if ($hdr(Expires) != $null) {
>
>                         $var(expires) = (int) $hdr(Expires);
>
>                         if ($var(expires) < MSRP_MIN_EXPIRES) {
>
>                                 msrp_reply("423", "Interval
> Out-of-Bounds",
>
>                                         "Min-Expires:
> MSRP_MIN_EXPIRES\r\n");
>
>                                 exit;
>
>                         } else if ($var(expires) > MSRP_MAX_EXPIRES) {
>
>                                 msrp_reply("423", "Interval
> Out-of-Bounds",
>
>                                         "Max-Expires:
> MSRP_MAX_EXPIRES\r\n");
>
>                                 exit;
>
>                         }
>
>                 } else {
>
>                         $var(expires) = MSRP_MAX_EXPIRES;
>
>                 }
>
>                 $var(cnt) = $var(cnt) + 1;
>
>                 pv_printf("$var(sessid)",
> "s.$(pp).$(var(cnt)).$(RANDOM)");
>
>                 $sht(msrp=>$var(sessid)::srcaddr) = $msrp(srcaddr);
>
>                 $sht(msrp=>$var(sessid)::srcsock) = $msrp(srcsock);
>
>                 $shtex(msrp=>$var(sessid)) = $var(expires) + 5;
>
>                 # - Use-Path: the MSRP address for server + session id
>
>                 $var(hdrs) = "Use-Path: msrps://MY_IP_ADDR:MY_MSRP_PORT/"
>
>                                         + $var(sessid) + ";tcp\r\n"
>
>                                         + "Expires: " + $var(expires)
> + "\r\n";
>
>                 msrp_reply("200", "OK", "$var(hdrs)");
>
>         } else if ($msrp(method)=="SEND" || $msrp(method)=="REPORT") {
>
>                 if ($msrp(nexthops)>1) {
>
>                         if ($msrp(method)!="REPORT") {
>
>                                 msrp_reply("200", "OK");
>
>                         }
>
>                         msrp_relay();
>
>                         exit;
>
>                 }
>
>                 $var(sessid) = $msrp(sessid);
>
>                 if ($sht(msrp=>$var(sessid)::srcaddr) == $null) {
>
>                         # one more hop, but we don't have address in
> htable
>
>                         msrp_reply("481", "Session-does-not-exist");
>
>                         exit;
>
>                 } else if ($msrp(method)!="REPORT") {
>
>                         msrp_reply("200", "OK");
>
>                 }
>
>                 msrp_relay_flags("1");
>
>                 msrp_set_dst("$sht(msrp=>$var(sessid)::srcaddr)",
>
>                                 "$sht(msrp=>$var(sessid)::srcsock)");
>
>                 msrp_relay();
>
>         } else {
>
>                 msrp_reply("501", "Request-method-not-understood");
>
>         }
>
> }
>
> Thanks,
> Vamsi
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at 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
Kamailio Advanced Training, Sep 28-30, 2015, in Berlin - http://asipto.com/u/kat

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150924/29a7a2dd/attachment.html>


More information about the sr-users mailing list