<div dir="ltr">The problem seems to that the kamailio is trying to route it over UDP port using WSS transport, which will never work.<div><br></div><div>You are creating a transport bridge (UDP <-> WSS i.e. stateless transport <-> stateful transport) as well media bridge (RTP <-> SRTP), so it is going to be tricky. I strongly discourage it since things get messy for sequential requests. But you can try the following,</div><div><br></div><div>Here are some PATH module parameters and functions, you will need to setup.</div><div><br></div><div>1. You will need to enable "use_received" parameter to ensure connection tracking.</div><div>2. It seems you may have enabled "received_format", so you make sure you do NAT detection and use "handle_ruri_alias" for initial requests.</div><div>3. You must also enabled "enable_r2", but with caution, since both ends (i.e. UAC and UAS) can be using same kamailio (proxy) socket for in/out.</div><div>4. Make sure to use "add_path_received" instead of "add_path".</div><div>5. If using OUTBOUND module then make sure it is loaded BEFORE the PATH module.</div><div><br></div><div>Thank you.</div><div><br></div><div>--</div><div>Muhammad Shahzad Shafi</div><div>Burraq Technologies</div><div>Tel: +49 176 99 83 10 85</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jun 26, 2021 at 12:47 AM Peter Manley <<a href="mailto:peter.manley@kombea.com">peter.manley@kombea.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_-7629384940836585346WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m working on building an RTP Proxy which will allow both regular SIP to SIP transactions and WebRTC to SIP transactions to an Asterisk Server.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">SIP UAC < ---UDP/SIP --- > Kamailio/RTPEngine Proxy < ---UDP/SIP----- > Asterisk Server<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">AND<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">WebRTC UAC < ---WSS--- > Kamailio/RTPEngine Proxy < ---UDP/SIP----- > Asterisk Server<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The Kamailio/RTPEngine Proxy is stateless (does not use the tm or registerer modules), and uses the Path module to replace the Route header with a Path header.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It works grep for SIP/UDP to SIP/UDP transactions.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">HOWEVER… It only partially works for WSS to SIP/UDP transactions. The REGISTER/401(Unauthorized), REGISTER/200(OK) transaction works well.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">When the Asterisk server sends a SIP Options message, I get the following error:<u></u><u></u></p>
<p class="MsoNormal">Jun 25 15:47:03 VRTPENGINE kamailio[4953]: INFO: <script>: => OPTIONS <
<a>sip:l4umfumh@192.0.2.97;transport=ws;alias=209.141.117.212~59751~6</a> -> <null> (IP:172.16.0.48:sp)<u></u><u></u></p>
<p class="MsoNormal">Jun 25 15:47:03 VRTPENGINE kamailio[4953]: WARNING: <core> [core/msg_translator.c:2815]: via_builder(): TCP/TLS connection (id: 0) for WebSocket could not be found<u></u><u></u></p>
<p class="MsoNormal">Jun 25 15:47:03 VRTPENGINE kamailio[4953]: ERROR: <core> [core/msg_translator.c:2003]: build_req_buf_from_sip_req(): could not create Via header<u></u><u></u></p>
<p class="MsoNormal">Jun 25 15:47:03 VRTPENGINE kamailio[4953]: ERROR: <core> [core/forward.c:550]: forward_request(): building failed<u></u><u></u></p>
<p class="MsoNormal">Jun 25 15:47:03 VRTPENGINE kamailio[4953]: WARNING: <core> [core/receive.c:425]: receive_msg(): error while trying script<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">It appears that the WebSocket corresponding to the WSS leg cannot be located when the request is initiated from the Asterisk Server.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Any thoughts on how I can get this to work in the other direction (Asterisk to Kamailio)? I’ve been looking at the WebRTC to SIP Client and Server (<a href="https://github.com/havfo/WEBRTC-to-SIP" target="_blank">https://github.com/havfo/WEBRTC-to-SIP</a>),
 but that doesn’t quite do what I want it to do (i.e. it appears to act as a registrar server and doesn’t forward REGISTER requests on to another registrar).<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks and regards,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><b><span style="color:rgb(47,84,150)">Peter H. Manley, Ph.D.</span></b><span style="color:rgb(68,114,196)">
</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(104,97,60)">Chief Software Architect</span><b><span style="font-size:10pt"><u></u><u></u></span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(104,97,60)">Kom</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">Bea</span><span style="font-size:10pt;font-family:Arial,sans-serif;color:rgb(104,97,60)"> Corporation</span><span style="font-size:12pt;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(33,33,33)"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__maps.google.com_-3Fq-3D3400-2BNorth-2BAshton-2BBlvd-2C-2BSuite-2B470-2B-250D-250A-2BLehi-2C-2BUtah-2B84043-26entry-3Dgmail-26source-3Dg&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=C4toC0HQ2JwHKiamawbqvdjdidlwyhCP0XVneFagwkY&e=" title="https://urldefense.proofpoint.com/v2/url?u=https-3A__maps.google.com_-3Fq-3D3400-2BNorth-2BAshton-2BBlvd-2C-2BSuite-2B470-2B-250D-250A-2BLehi-2C-2BUtah-2B84043-26entry-3Dgmail-26source-3Dg&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeW" target="_blank"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(17,85,204)">3400
 North Ashton Blvd, Suite 470</span></a></span><span style="font-size:12pt;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(33,33,33)"><a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__maps.google.com_-3Fq-3D3400-2BNorth-2BAshton-2BBlvd-2C-2BSuite-2B470-2B-250D-250A-2BLehi-2C-2BUtah-2B84043-26entry-3Dgmail-26source-3Dg&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=C4toC0HQ2JwHKiamawbqvdjdidlwyhCP0XVneFagwkY&e=" target="_blank"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(17,85,204)">Lehi,
 Utah 84043</span></a><u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:rgb(33,33,33)"><a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.kombea.com_&d=DwMF-g&c=aXfg9j-An5sFdflqnjAj_USiCjXm5xEBIX8lTgWEt0U&r=ykVOlDeeWPn-JjTs8avieNrFskQ3kNzjf6_Jn_wG5HLeLIRsvzCN4-dJx6BFR4el&m=MMSIepRfj2CXVMH3CH8SghyPAoonRISMH__5bcNFPLM&s=ocueS1ZL34IN6qr14M-aItGjeJGQ2km5U2zpzO4Fyqw&e=" target="_blank"><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(31,73,125)">www.kombea.com</span></a></span><span style="font-size:12pt;color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:gray"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:gray">Office:+1.801.610.5808<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:gray">Mobile +1.801.243.7773<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>

__________________________________________________________<br>
Kamailio - Users Mailing List - Non Commercial Discussions<br>
  * <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
Important: keep the mailing list in the recipients, do not reply only to the sender!<br>
Edit mailing list options or unsubscribe:<br>
  * <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</blockquote></div>