<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">OK.  On the Freeswitch side there is a double transport=tls but I can’t find out where that’s happening so I’ll remove it in the Opensips script
<div class=""><br class="">
</div>
<div class="">Here’s what Opensips sees from Freeswitch</div>
    <br>
    <p style="font-family: Open Sans,sans-serif;">
    <b><span style="font-family: Open Sans,sans-serif; font-size:10.0pt;color:#888888">James Hogbin</span></b>
    <b><span style="font-family: Open Sans,sans-serif;font-size:8.0pt;color:#888888;"><br>Director</span></b>
    </p>
    <table border="0" cellspacing="0" cellpadding="0"><tr><td><a href="http://ip-sentinel.com"><IMG border="0" alt="IP Sentinel Logo" src="cid:120051123441600233@uk-mta-136.uk.mimecast.lan" ></A></td></tr></table>
                <span style="font-family: Open Sans,sans-serif;font-size:8.0pt;color:#222222;"><br>t. <a href="tel:+442030114150" target="_blank">+44 (0)20 3011 4150</a><br></span><span style="font-family: Open Sans,sans-serif;font-size:8.0pt;color:#222222;">m. +44 7786910895<br></span><span style="font-family: Open Sans,sans-serif;font-size:8.0pt;color:#222222">w. <a href="https://www.ip-sentinel.com/" target="_blank">https://www.ip-sentinel.com</a><br></span><table>
                <tbody><tr>
                        </tr>
                <tr>
                        
                </tr>
                <tr>
                        
                </tr>
                <tr>
                        
                </tr>
    </tbody></table>
    <br>
    

<div class=""><br class="">
</div>
<div class="">
<div class=""><font face="Menlo" class="">INVITE <a href="sip:08435577721@sbc.ip-sentinel.com:5091;transport=tls" class="">sip:08435577721@sbc.ip-sentinel.com:5091;transport=tls</a> SIP/2.0</font></div>
<div class=""><font face="Menlo" class="">Via: SIP/2.0/TLS 13.80.245.144:5081;rport;branch=z9hG4bKK90SUgZ4ZmN1D</font></div>
<div class=""><font face="Menlo" class="">Max-Forwards: 68</font></div>
<div class=""><font face="Menlo" class="">From: "James Hogbin" <<a href="sip:+442030114146@13.80.245.144" class="">sip:+442030114146@13.80.245.144</a>>;tag=t4ce3rS0Fy3ga</font></div>
<div class=""><font face="Menlo" class="">To: <<a href="sip:08435577721@sbc.ip-sentinel.com:5091" class="">sip:08435577721@sbc.ip-sentinel.com:5091</a>></font></div>
<div class=""><font face="Menlo" class="">Call-ID: 86371d7b-0e76-1239-bdba-000d3aada04e</font></div>
<div class=""><font face="Menlo" class="">CSeq: 20063606 INVITE</font></div>
<div class=""><font face="Menlo" class="">Contact: <<a href="sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9" class="">sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9</a>></font></div>
<div class=""><font face="Menlo" class="">User-Agent: FreeSWITCH</font></div>
<div class=""><font face="Menlo" class="">Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY</font></div>
<div class=""><font face="Menlo" class="">Supported: timer, path, replaces</font></div>
<div class=""><font face="Menlo" class="">Allow-Events: talk, hold, conference, refer</font></div>
<div class=""><font face="Menlo" class="">Content-Type: application/sdp</font></div>
<div class=""><font face="Menlo" class="">Content-Disposition: session</font></div>
<div class=""><font face="Menlo" class="">Content-Length: 1317</font></div>
<div class=""><font face="Menlo" class="">X-FS-Support: update_display,send_info</font></div>
<div class=""><font face="Menlo" class="">Remote-Party-ID: "James Hogbin" <<a href="sip:+442030114146@13.80.245.144" class="">sip:+442030114146@13.80.245.144</a>>;party=calling;screen=yes;privacy=off</font></div>
<div class="">
<div class=""><font face="Menlo" class="">v=0</font></div>
<div class=""><font face="Menlo" class="">o=FreeSWITCH 1589217436 1589217437 IN IP4 13.80.245.144</font></div>
<div class=""><font face="Menlo" class="">s=FreeSWITCH</font></div>
<div class=""><font face="Menlo" class="">c=IN IP4 13.80.245.144</font></div>
<div class=""><font face="Menlo" class="">t=0 0</font></div>
<div class=""><font face="Menlo" class="">m=audio 17360 RTP/SAVP 9 0 8 101 13</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:9 G722/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:0 PCMU/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:8 PCMA/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:101 telephone-event/8000</font></div>
<div class=""><font face="Menlo" class="">a=fmtp:101 0-16</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:13 CN/8000</font></div>
<div class=""><font face="Menlo" class="">a=crypto:1 {removed]</font></div>
<div class=""><font face="Menlo" class="">a=ptime:20</font></div>
<div class=""><font face="Menlo" class="">m=audio 17360 RTP/AVP 9 0 8 101 13</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:9 G722/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:0 PCMU/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:8 PCMA/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:101 telephone-event/8000</font></div>
<div class=""><font face="Menlo" class="">a=fmtp:101 0-16</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:13 CN/8000</font></div>
<div class=""><font face="Menlo" class="">a=ptime:20</font></div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">Here is my script.  I’m not fixing FROM or TO.  I am fixing the number, the Record_Route & the duplicated transport=tls in the CONTACT</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font face="Menlo" class="">if (is_method("INVITE") && !has_totag() && check_source_address(0)) {</font></div>
<div class=""><font face="Menlo" class="">                xlog("[ROUTE]Incoming call to MS: RURI=$ruri, SI=$si, M=$rm\n");</font></div>
<div class=""><font face="Menlo" class="">                trace("tid");</font></div>
<div class=""><font face="Menlo" class="">                strip(1);</font></div>
<div class=""><font face="Menlo" class="">                prefix("+44");</font></div>
<div class=""><font face="Menlo" class="">               </font></div>
<div class=""><font face="Menlo" class=""><span class="Apple-tab-span" style="white-space: pre;"></span>$rd="<a href="http://sip.pstnhub.microsoft.com" class="">sip.pstnhub.microsoft.com</a>";</font></div>
<div class=""><font face="Menlo" class="">                $rp=5061;</font></div>
<div class=""><font face="Menlo" class=""><br class="">
</font></div>
<div class=""><font face="Menlo" class="">                $var(reg_input) = $ct;</font></div>
<div class=""><font face="Menlo" class="">                $var(reg)= "/transport=tls;transport=tls;/transport=tls;/g";</font></div>
<div class=""><font face="Menlo" class="">                xlog("[WARNING]Applying reg exp $var(reg) to $var(reg_input)");</font></div>
<div class=""><font face="Menlo" class="">                $var(reg_output) = $(var(reg_input){re.subst,$var(reg)});</font></div>
<div class=""><font face="Menlo" class="">                remove_hf("Contact");</font></div>
<div class=""><font face="Menlo" class="">                append_hf("Contact: $var(reg_output)");</font></div>
<div class=""><font face="Menlo" class=""><br class="">
</font></div>
<div class=""><font face="Menlo" class="">                record_route_preset("<a href="http://sbc.ip-sentinel.com:5091" class="">sbc.ip-sentinel.com:5091</a>;transport=tls");</font></div>
<div class=""><font face="Menlo" class=""><br class="">
</font></div>
<div class=""><font face="Menlo" class="">                route(relay);</font></div>
</div>
<div class=""><br class="">
</div>
<div class="">The RTP_Proxy seems to be updating the SDP correctly</div>
<div class=""><br class="">
</div>
<div class="">And here is the invite to teams</div>
<div class=""><br class="">
</div>
<div class="">
<div class=""><font face="Menlo" class="">INVITE <a href="sip:+448435577721@sip.pstnhub.microsoft.com:5061;transport=tls" class="">sip:+448435577721@sip.pstnhub.microsoft.com:5061;transport=tls</a> SIP/2.0</font></div>
<div class=""><font face="Menlo" class="">Record-Route: <<a href="sip:sbc.ip-sentinel.com:5091;transport=tls;ftag=t4ce3rS0Fy3ga;lr;vsf=TxoZShEfAAYCAwMBAAUFBQJ2cUBMWx5HQhlGS19AXW5lbC5jb206NTA5MT4-;vst=TxoZSgoTAAcNAQQCAgUGd0FTI10AAAMDFhoaARsHQkMKDB9VRl9fRS5jb20+" class="">sip:sbc.ip-sentinel.com:5091;transport=tls;ftag=t4ce3rS0Fy3ga;lr;vsf=TxoZShEfAAYCAwMBAAUFBQJ2cUBMWx5HQhlGS19AXW5lbC5jb206NTA5MT4-;vst=TxoZSgoTAAcNAQQCAgUGd0FTI10AAAMDFhoaARsHQkMKDB9VRl9fRS5jb20+</a>></font></div>
<div class=""><font face="Menlo" class="">Via: SIP/2.0/TLS 137.117.136.143:5091;branch=z9hG4bK9915.ccfe3523.0;i=ae435223</font></div>
<div class=""><font face="Menlo" class="">Via: SIP/2.0/TLS 13.80.245.144:5081;received=13.80.245.144;rport=36423;branch=z9hG4bKK90SUgZ4ZmN1D</font></div>
<div class=""><font face="Menlo" class="">Max-Forwards: 68</font></div>
<div class=""><font face="Menlo" class="">From: "James Hogbin" <<a href="sip:+442030114146@sbc.ip-sentinel.com:5091" class="">sip:+442030114146@sbc.ip-sentinel.com:5091</a>>;tag=t4ce3rS0Fy3ga</font></div>
<div class=""><font face="Menlo" class="">To: <<a href="sip:+448435577721@sip.pstnhub.microsoft.com" class="">sip:+448435577721@sip.pstnhub.microsoft.com</a>></font></div>
<div class=""><font face="Menlo" class="">Call-ID: 86371d7b-0e76-1239-bdba-000d3aada04e</font></div>
<div class=""><font face="Menlo" class="">CSeq: 20063606 INVITE</font></div>
<div class=""><font face="Menlo" class="">User-Agent: FreeSWITCH</font></div>
<div class=""><font face="Menlo" class="">Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY</font></div>
<div class=""><font face="Menlo" class="">Supported: timer, path, replaces</font></div>
<div class=""><font face="Menlo" class="">Allow-Events: talk, hold, conference, refer</font></div>
<div class=""><font face="Menlo" class="">Content-Type: application/sdp</font></div>
<div class=""><font face="Menlo" class="">Content-Disposition: session</font></div>
<div class=""><font face="Menlo" class="">Content-Length: 1339</font></div>
<div class=""><font face="Menlo" class="">X-FS-Support: update_display,send_info</font></div>
<div class=""><font face="Menlo" class="">Remote-Party-ID: "James Hogbin" <<a href="sip:+442030114146@13.80.245.144" class="">sip:+442030114146@13.80.245.144</a>>;party=calling;screen=yes;privacy=off</font></div>
<div class=""><font face="Menlo" class="">Contact: <<a href="sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9" class="">sip:gw+c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9@13.80.245.144:5081;transport=tls;gw=c6ff36e8-d3de-4fe0-9f1b-9da2888c43a9</a>></font></div>
<div class="">
<div class=""><font face="Menlo" class="">v=0</font></div>
<div class=""><font face="Menlo" class="">o=FreeSWITCH 1589217436 1589217437 IN IP4 137.117.136.143</font></div>
<div class=""><font face="Menlo" class="">s=FreeSWITCH</font></div>
<div class=""><font face="Menlo" class="">c=IN IP4 137.117.136.143</font></div>
<div class=""><font face="Menlo" class="">t=0 0</font></div>
<div class=""><font face="Menlo" class="">m=audio 10124 RTP/SAVP 9 0 8 101 13</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:9 G722/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:0 PCMU/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:8 PCMA/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:101 telephone-event/8000</font></div>
<div class=""><font face="Menlo" class="">a=fmtp:101 0-16</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:13 CN/8000</font></div>
<div class=""><font face="Menlo" class="">a=crypto:1 {removed}</font></div>
<div class=""><font face="Menlo" class="">a=ptime:20</font></div>
<div class=""><font face="Menlo" class="">m=audio 19352 RTP/AVP 9 0 8 101 13</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:9 G722/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:0 PCMU/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:8 PCMA/8000</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:101 telephone-event/8000</font></div>
<div class=""><font face="Menlo" class="">a=fmtp:101 0-16</font></div>
<div class=""><font face="Menlo" class="">a=rtpmap:13 CN/8000</font></div>
<div class=""><font face="Menlo" class="">a=ptime:20</font></div>
<div class=""><font face="Menlo" class="">a=nortpproxy:yes</font></div>
</div>
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">I don’t even get a response from Teams now so I think I’m now going backwards even though I think I’ve implemented all the parts of the advice I’ve been given throughout this thread.</div>
<div class=""><br class="">
</div>
<div class=""><font face="Menlo" class="">   0.00 Freeswitch => INVITE => Opensips</font></div>
<div class=""><font face="Menlo" class="">   0.01 Freeswitch <=   100  <= Opensips</font></div>
<div class=""><font face="Menlo" class="">   0.01                         Opensips => INVITE => MSTeams</font></div>
<div class=""><font face="Menlo" class="">30.0    Freeswitch <=   408  <= Opensips</font></div>
<div class=""><font face="Menlo" class="">30.0    Freeswitch =>   ACK  => Opensips</font></div>
<div class=""><span class="" style="font-family: Menlo;">31.4    Freeswitch =>   ACK  => Opensips</span></div>
<div class=""><span class="" style="font-family: Menlo;"><br class="">
</span></div>
<div class="">James</div>
</div>



    <p style="font-family: Open Sans, Arial, sans-serif;padding: 5px;background:#D5EAFF">
    <span style="font-family: Open Sans,sans-serif;font-size:8.0pt;color:red">IP Sentinel Disclaimer <br></span>
    <span style="font-family: Open Sans,sans-serif;font-size:6.0pt;color:black">The information contained in this e-mail, and any attachment, is confidential and is intended solely for the use of the intended recipient. Access, copying or re-use of the e-mail or any attachment, or any information contained therein, by any other person is not authorized. Unintended recipients are prohibited from taking action on the basis of information in this e-mail. If you are not the intended recipient or have received this email in error, please notify the sender immediately by return email and delete the email from your computer.
E-mail messages may contain computer viruses or other defects, may not be accurately replicated on other systems, or may be intercepted, deleted or interfered with without the knowledge of the sender or the intended recipient. We do not guarantee that either are virus-free and accept no liability for any damage sustained as a result of computer viruses or other defects. 
. IP Sentinel Ltd is a limited company registered in England and Wales under Registered Number 08648097. Registered Office: Newnhams Wood, Horsted Keynes, West Sussex, RH17 7BT. </span>
    </p><span style="font-size:1.0pt;color:white">Q3dhRSrm_disclaimer</span>
</body></html>