<div dir="ltr">I have configured websocket usage using this module description <a href="https://kamailio.org/docs/modules/devel/modules/websocket.html">https://kamailio.org/docs/modules/devel/modules/websocket.html</a><br><br>Added registrar and usrloc modules<br>Registration saved using this block<br><div><font face="monospace" color="#0000ff">route[REGISTRAR] {   </font></div><div><font face="monospace" color="#0000ff">    if(!is_method("REGISTER"))  </font></div><div><font face="monospace" color="#0000ff">       return;                 </font></div><div><font face="monospace" color="#0000ff"> </font></div><div><font face="monospace" color="#0000ff">    if (!save("location")) {                                           </font></div><div><font face="monospace" color="#0000ff">        xlog("L_INFO", "Location save error\n");</font></div><div><font face="monospace" color="#0000ff">        sl_reply_error();                                                </font></div><div><font face="monospace" color="#0000ff">    }                                                                 </font></div><div><span style="font-family:monospace"><font color="#0000ff">}</font></span><br></div><div><br></div><div><div>Now in database i can see WebRTC client registration<br><div><font face="monospace" color="#0000ff">{</font></div><div><font face="monospace" color="#0000ff">  "jsonrpc":  "2.0",</font></div><div><font face="monospace" color="#0000ff">  "result": {</font></div><div><font face="monospace" color="#0000ff">    "Domains":  [{</font></div><div><font face="monospace" color="#0000ff">        "Domain": {</font></div><div><font face="monospace" color="#0000ff">          "Domain": "location",</font></div><div><font face="monospace" color="#0000ff">          "Size": 1024,</font></div><div><font face="monospace" color="#0000ff">          "AoRs": [{</font></div><div><font face="monospace" color="#0000ff">              "Info": {</font></div><div><font face="monospace" color="#0000ff">                "AoR":  "1000",</font></div><div><font face="monospace" color="#0000ff">                "HashID": 924766747,</font></div><div><font face="monospace" color="#0000ff">                "Contacts": [{</font></div><div><font face="monospace" color="#0000ff">                    "Contact":  {</font></div><div><font face="monospace" color="#0000ff">                      "Address":  "sips:1000@df7jal23ls0d.invalid;rtcweb-breaker=no;transport=wss",</font></div><div><font face="monospace" color="#0000ff">                      "Expires":  155,</font></div><div><font face="monospace" color="#0000ff">                      "Q":  -1,</font></div><div><font face="monospace" color="#0000ff">                      "Call-ID":  "0c818ac1-5e77-bd4c-b7fe-a135d6c6a4bf",</font></div><div><font face="monospace" color="#0000ff">                      "CSeq": 61442,</font></div><div><font face="monospace" color="#0000ff">                      "User-Agent": "IM-client/OMA1.0 sipML5-v1.2016.03.04",</font></div><div><font face="monospace" color="#0000ff">                      "Received": "[not set]",</font></div><div><font face="monospace" color="#0000ff">                      "Path": "[not set]",</font></div><div><font face="monospace" color="#0000ff">                      "State":  "CS_SYNC",</font></div><div><font face="monospace" color="#0000ff">                      "Flags":  0,</font></div><div><font face="monospace" color="#0000ff">                      "CFlags": 0,</font></div><div><font face="monospace" color="#0000ff">                      "Socket": "tls:<a href="http://192.168.2.10:7443">192.168.2.10:7443</a>",</font></div><div><font face="monospace" color="#0000ff">                      "Methods":  -1,</font></div><div><font face="monospace" color="#0000ff">                      "Ruid": "uloc-5c643a67-4b56-1",</font></div><div><font face="monospace" color="#0000ff">                      "Instance": "[not set]",</font></div><div><font face="monospace" color="#0000ff">                      "Reg-Id": 0,</font></div><div><font face="monospace" color="#0000ff">                      "Server-Id":  0,</font></div><div><font face="monospace" color="#0000ff">                      "Tcpconn-Id": 2,</font></div><div><font face="monospace" color="#0000ff">                      "Keepalive":  0,</font></div><div><font face="monospace" color="#0000ff">                      "Last-Keepalive": 1550074434,</font></div><div><font face="monospace" color="#0000ff">                      "Last-Modified":  1550074434</font></div><div><font face="monospace" color="#0000ff">                    }</font></div><div><font face="monospace" color="#0000ff">                  }]</font></div><div><font face="monospace" color="#0000ff">              }</font></div><div><font face="monospace" color="#0000ff">            }</font></div><div><font face="monospace" color="#0000ff">  ],</font></div><div><font face="monospace" color="#0000ff">          "Stats":  {</font></div><div><font face="monospace" color="#0000ff">            "Records":  1,</font></div><div><font face="monospace" color="#0000ff">            "Max-Slots":  1</font></div><div><font face="monospace" color="#0000ff">          }</font></div><div><font face="monospace" color="#0000ff">        }</font></div><div><font face="monospace" color="#0000ff">      }]</font></div><div><font face="monospace" color="#0000ff">  },</font></div><div><font face="monospace" color="#0000ff">  "id": 19493</font></div><div><font face="monospace" color="#0000ff">}</font></div></div><div><br></div><div>Now I try deliver call to WebRTC client. Kamailio receives message<br></div></div><div><div><font face="monospace" color="#0000ff">   INVITE <a href="mailto:sip%3A1001@192.168.30.2">sip:1001@192.168.30.2</a> SIP/2.0</font></div><div><font face="monospace" color="#0000ff">   Via: SIP/2.0/UDP 192.168.30.2:45060;rport;branch=z9hG4bK5gaK3B38egZQH</font></div><div><font face="monospace" color="#0000ff">   Route: <sip:192.168.2.10></font></div><div><font face="monospace" color="#0000ff">   Max-Forwards: 70</font></div><div><font face="monospace" color="#0000ff">   From: "" <<a href="mailto:sip%3A0000000000@192.168.30.2">sip:0000000000@192.168.30.2</a>>;tag=8e7Za8pD6pcKg</font></div><div><font face="monospace" color="#0000ff">   To: <<a href="mailto:sip%3A1001@192.168.30.2">sip:1001@192.168.30.2</a>></font></div><div><font face="monospace" color="#0000ff">   Call-ID: 989274f0-aa4d-1237-08a1-94b86deaeed5</font></div><div><font face="monospace" color="#0000ff">   CSeq: 483510 INVITE</font></div><div><font face="monospace" color="#0000ff">   Contact: <<a href="http://sip:mod_sofia@192.168.30.2:45060">sip:mod_sofia@192.168.30.2:45060</a>></font></div><div><font face="monospace" color="#0000ff">   User-Agent: FreeSWITCH-mod_sofia/1.8.4+git-20181228T070140Z~a0377e9677~64bit</font></div><div><font face="monospace" color="#0000ff">   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE</font></div><div><font face="monospace" color="#0000ff">   Supported: timer, path, replaces</font></div><div><font face="monospace" color="#0000ff">   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer</font></div><div><font face="monospace" color="#0000ff">   Content-Type: application/sdp</font></div><div><font face="monospace" color="#0000ff">   Content-Disposition: session</font></div><div><font face="monospace" color="#0000ff">   Content-Length: 621</font></div><div><font face="monospace" color="#0000ff">   X-FS-Support: update_display,send_info</font></div><div><font face="monospace" color="#0000ff">   Remote-Party-ID: <<a href="mailto:sip%3A0000000000@192.168.30.2">sip:0000000000@192.168.30.2</a>>;party=calling;screen=yes;privacy=off</font></div></div><div><br></div><div>Expected that Kamailio using follow config block route message to WEbRTC client via websocket.<br><div><font color="#0000ff" face="monospace">route[FROM_FS] {                        </font></div><div><font color="#0000ff" face="monospace">        record_route();</font></div><div><font color="#0000ff" face="monospace">        if (!lookup("location")) {                                     </font></div><div><font color="#0000ff" face="monospace">                $var(rc) = $rc;</font></div><div><font color="#0000ff" face="monospace">                t_newtran();                                             </font></div><div><font color="#0000ff" face="monospace">                switch ($var(rc)) {                                   </font></div><div><font color="#0000ff" face="monospace">                        case -1:</font></div><div><font color="#0000ff" face="monospace">                        case -3:                                           </font></div><div><font color="#0000ff" face="monospace">                                send_reply("404", "Not Found");</font></div><div><font color="#0000ff" face="monospace">                                exit;</font></div><div><font color="#0000ff" face="monospace">                        case -2:</font></div><div><font color="#0000ff" face="monospace">                                send_reply("405", "Method Not Allowed");</font></div><div><font color="#0000ff" face="monospace">                                exit;</font></div><div><font color="#0000ff" face="monospace">                }                                             </font></div><div><font color="#0000ff" face="monospace">        }                                                                     </font></div><div><font color="#0000ff" face="monospace"> </font></div><div><font color="#0000ff" face="monospace">        route(RELAY);</font></div><div><font color="#0000ff" face="monospace">        exit; </font></div><div><font color="#0000ff" face="monospace">}</font></div></div><div><br></div><div>But really Kamailio try resolve "sips:1000@df7jal23ls0d.invalid" URI via DNS and deliver for non locally connected device<br><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/usr/local/etc/kamailio/kamailio.cfg] l=238 a=16 n=if</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/usr/local/etc/kamailio/kamailio.cfg] l=231 a=41 n=isflagset</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[DEFAULT_ROUTE] c=[/usr/local/etc/kamailio/kamailio.cfg] l=232 a=5 n=route</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[FROM_FS] c=[/usr/local/etc/kamailio/kamailio.cfg] l=266 a=24 n=record_route</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[FROM_FS] c=[/usr/local/etc/kamailio/kamailio.cfg] l=281 a=16 n=if</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[FROM_FS] c=[/usr/local/etc/kamailio/kamailio.cfg] l=267 a=25 n=lookup</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: registrar [lookup.c:255]: lookup_helper(): contact for [1000] found by address</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[FROM_FS] c=[/usr/local/etc/kamailio/kamailio.cfg] l=281 a=5 n=route</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[RELAY] c=[/usr/local/etc/kamailio/kamailio.cfg] l=289 a=16 n=if</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[RELAY] c=[/usr/local/etc/kamailio/kamailio.cfg] l=286 a=24 n=t_relay</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_lookup.c:1326]: t_newtran(): msg id=2 , global msg id=2 , T on entrance=0</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_lookup.c:483]: t_lookup_request(): start searching: hash=7468, isACK=0</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_lookup.c:441]: matching_3261(): RFC3261 transaction matching failed - via branch [z9hG4bK72v4614F91BXr]</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_lookup.c:666]: t_lookup_request(): no transaction found</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_hooks.c:348]: run_reqin_callbacks_internal(): trans=0x7fbb0b1d0d40, callback type 1, id 0 entered</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/md5utils.c:67]: MD5StringArray(): MD5 calculated: 07ad473ba02a6d3a4f8753a378c102e8</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_funcs.c:324]: t_relay_to(): new INVITE</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_reply.c:596]: _reply_light(): reply sent out. buf=0x7fbb0f256750: SIP/2.0 100 trying -..., shmem=0x7fbb0b1e75d8: SIP/2.0 100 trying -</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_reply.c:607]: _reply_light(): finished</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:527]: _dns_hash_find(): (_sips._tcp.df7jal23ls0d.invalid(31), 33), h=232</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/resolve.c:967]: get_record(): skipping 1 NS (p=0x561007b83e71, end=0x561007b83ebc)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/resolve.c:980]: get_record(): parsing 0 ARs (p=0x561007b83ebc, end=0x561007b83ebc)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:761]: dns_cache_mk_bad_entry(): (_sips._tcp.df7jal23ls0d.invalid, 33, 60, 1)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:701]: dns_cache_add(): adding _sips._tcp.df7jal23ls0d.invalid(31) 33 (flags=1) at 232</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:527]: _dns_hash_find(): (df7jal23ls0d.invalid(20), 1), h=139</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/resolve.c:967]: get_record(): skipping 1 NS (p=0x561007b83e66, end=0x561007b83eb1)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/resolve.c:980]: get_record(): parsing 0 ARs (p=0x561007b83eb1, end=0x561007b83eb1)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:761]: dns_cache_mk_bad_entry(): (df7jal23ls0d.invalid, 1, 60, 1)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/dns_cache.c:701]: dns_cache_add(): adding df7jal23ls0d.invalid(20) 1 (flags=1) at 139</font></div><div><font color="#0000ff" face="monospace"> 3(19341) ERROR: <core> [core/resolve.c:1698]: sip_hostport2su(): could not resolve hostname: "df7jal23ls0d.invalid"</font></div><div><font color="#0000ff" face="monospace"> 3(19341) ERROR: tm [ut.h:309]: uri2dst2(): failed to resolve "df7jal23ls0d.invalid"</font></div><div><font color="#0000ff" face="monospace"> 3(19341) ERROR: tm [t_fwd.c:1735]: t_forward_nonack(): failure to add branches</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_funcs.c:334]: t_relay_to(): t_forward_nonack returned error -478 (-478)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_funcs.c:352]: t_relay_to(): -478 error reply generation delayed </font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[RELAY] c=[/usr/local/etc/kamailio/kamailio.cfg] l=287 a=24 n=sl_reply_error</font></div><div><font color="#0000ff" face="monospace"> 3(19341) ERROR: sl [sl_funcs.c:372]: sl_reply_error(): stateless error reply used: Unresolvable destination (478/SL)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) exec: *** cfgtrace:request_route=[RELAY] c=[/usr/local/etc/kamailio/kamailio.cfg] l=289 a=2 n=exit</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: <core> [core/receive.c:353]: receive_msg(): request-route executed in: 12632 usec</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_lookup.c:1490]: t_unref(): delayed error reply generation(-478)</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_reply.c:1650]: cleanup_uac_timers(): RETR/FR timers reset</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_reply.c:596]: _reply_light(): reply sent out. buf=0x7fbb0f2571f0: SIP/2.0 478 Unresolv..., shmem=0x7fbb0b1e7860: SIP/2.0 478 Unresolv</font></div><div><font color="#0000ff" face="monospace"> 3(19341) DEBUG: tm [t_reply.c:607]: _reply_light(): finished</font></div><div><br></div></div><div>Looks I missed some thing in message routing, But cannot find what.<br></div><div>Please point me how to properly route call for this case.</div></div>