<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks for the quick response Joel.  Yes, I have read the article and I have tested and confirmed that I am correctly appending the contact header (I probably should have left that in the snippet for clarity).  Below is an example of Kamailio setting up the connection.  It is going out port 46245 this time, but it is random.<div class=""><div class=""><div class=""><br class=""></div><div class=""><div class="">07:59:23.572319 IP *my.kamailio.server*.46245 > *ms.teams.server*.sip-tls: Flags [P.], seq 1:518, ack 1, win 502, length 517</div><div class="">07:59:23.802458 IP *ms.teams.server*.sip-tls > *my.kamailio.server*.46245: Flags [P.], seq 1:3767, ack 518, win 2051, length 3766</div><div class=""><br class=""></div><div class="">The TLS connection shows as successful in the logs.</div><div class=""><br class=""></div><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">- Charles </div><div class=""><br class=""></div><div class=""><br class=""></div></div>Date: Thu, 7 Jan 2021 19:12:10 -0800<br class="">From: Joel Serrano <<a href="mailto:joel@textplus.com" class="">joel@textplus.com</a>><br class="">To: "Kamailio (SER) - Users Mailing List"<br class=""><span class="Apple-tab-span" style="white-space: pre;">       </span><<a href="mailto:sr-users@lists.kamailio.org" class="">sr-users@lists.kamailio.org</a>><br class="">Subject: Re: [SR-Users] Source Port on TLS OPTIONS from Dispatcher<br class="">Message-ID:<br class=""><span class="Apple-tab-span" style="white-space: pre;"> </span><<a href="mailto:CAMtXxQnLtEyD=40cwKembxiyj3D778eK=+5JD7sL4CvYbYXF1g@mail.gmail.com" class="">CAMtXxQnLtEyD=40cwKembxiyj3D778eK=+5JD7sL4CvYbYXF1g@mail.gmail.com</a>><br class="">Content-Type: text/plain; charset="utf-8"<br class=""><br class="">Hi Charles,<br class=""><br class="">I don't think your issue is rport, make sure you are setting the Contact<br class="">header correctly.<br class=""><br class="">Have you checked this blog post:<br class=""><a href="https://skalatan.de/en/blog/kamailio-sbc-teams" class="">https://skalatan.de/en/blog/kamailio-sbc-teams</a> ?<br class=""><br class="">There is a specific section that talks about how to tell Kamailio to send<br class="">the OPTIONS like MS Teams wants them.<br class=""><br class="">Good luck,<br class="">Joel.<br class=""><div class=""><div style="font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""></div></div><br class="Apple-interchange-newline">

</div>
<div><br class=""><blockquote type="cite" class=""><div class="">On Jan 7, 2021, at 7:31 PM, Charles Phillips <<a href="mailto:charles@rustybike.com" class="">charles@rustybike.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hello all.  As they say in radio, “long time listener, first time caller”</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Anyway, I am having trouble getting past the following road block and any help would be greatly appreciated.</div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Kamailio version is 5.4.3 </div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div style="font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">When attempting to use dispatcher to send OPTIONS packets to several TLS destinations, the packets are leaving the Kamailio server on random ports.  This is a problem because the servers I am sending the OPTIONS to (MS Teams) are enforcing rport so the responses are returned to a port that Kamailio is not listening on.  I have tried to force the socket in the event route (relevant parts of snippet below) but it does not appear to help.  I should also mention that I am not behind NAT and the TLS socket is specified in the dispatcher attrs. </div><div style="font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; text-align: start; text-indent: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div class="">event_route[tm:local-request] {<br class="">    sip_trace();</div><div class=""><br class=""></div><div class=""><br class="">    $fs = “tls:**ip-address**:5061”;</div><div class=""><br class=""></div><div class=""><br class="">}</div></div></div><div class=""><br class=""></div><div class="">I have used Kamailio as a TLS server for many projects, but this is my first time as a client.  I am sure I am missing something.</div><div class="">
<div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><br class="Apple-interchange-newline">- Charles</div><div class=""><br class=""></div></div><br class="Apple-interchange-newline" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-variant-east-asian: normal; font-variant-position: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br class="Apple-interchange-newline">

</div>
<br class=""></div></div></blockquote></div><br class=""></div></div></div></body></html>