<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle19
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
span.EmailStyle20
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1750881185;
        mso-list-type:hybrid;
        mso-list-template-ids:1963474882 1911200736 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:\F0B7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:\F0A7;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">I am new to OpenSIPS and I am trying to configure it as SBC between MS Teams (with TLS connection) and a FreePBX/Asterisk server (with UDP connection) with a private IP address.<o:p></o:p></p>
<p class="MsoNormal">In order for MS Teams to send the ACK to 200 OK reply through the same TLS connection it used to send INVITE request I have to configure OpenSIPS to send Contact header with URI containing its FQDN instead of its IP address. Unfortunately
 topology_hiding module sets IP address, so MS Teams tries to create a new TLS connection and most probably refuses the certificate, because it contains FQDN, not IP address.<o:p></o:p></p>
<p class="MsoNormal">I tried several approaches with configuring OpenSIPS:<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]>changed socket to be with FQDN and alias with IP address – topology hiding still sets IP address in Contact header<o:p></o:p></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="mso-list:Ignore">-<span style="font:7.0pt "Times New Roman"">         
</span></span><![endif]>tried to add manually second contact header – it was not recognized by MS Teams (it still used the first one and tries to create a new TLS connection) and I could not add thinfo parameter, needed by topology_hiding module<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Is there another module in OpenSIPS which allows modifying Contact URI only of a reply?<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Also I think that I have to add record-route header in my 200 OK reply, according to OpenSIP how-to:<o:p></o:p></p>
<p class="MsoListParagraph" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">
<b><span style="font-size:12.0pt;font-family:"Times New Roman",serif">UPDATE:</span></b><span style="font-size:12.0pt;font-family:"Times New Roman",serif"> Starting from 01.07.2020 Microsoft requires Route headers with SBC_FQDN in SIP replies too. Instead of
 simple record_route() for SIP request from MS servers OpenSIPS should add FQDN, but in different order:<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt;font-family:"Courier New"">record_route_preset("LAN_IP:5060", "SBC_FQDN:5061;transport=tls");<o:p></o:p></span></p>
<p class="MsoListParagraph"><span style="font-size:10.0pt;font-family:"Courier New"">add_rr_param(";r2=on");<o:p></o:p></span></p>
<p class="MsoNormal">I tried to add it in the main route script before calling topology_hiding() in order for it to be restored on replies, but this didn’t work:<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#5B9BD5">record_route_preset("sbc.tbgit.com:5067;transport=tls");<o:p></o:p></span></p>
<p class="MsoNormal">I noticed that topology_hiding creates a branch, so I tried to add the same record_route_preset in the branch_route also, but this didn’t help – I just receive:<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#5B9BD5">ERROR:rr:w_record_route_preset: Double attempt to record-route<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Any help is welcome.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Peter<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p></p>
<div style="”background-color:#FFFFFF;" width:100%;="" border-style:="" solid;="" border-color:#ffffff;="" border-width:1pt;="" padding:2pt;="" font-size:10pt;="" line-height:12pt;="" font-family:?Calibri?;="" color:Black;="" text-align:="" left;?="">
Data Classification: <b>Confidential </b></div>
<br>
<p></p>
</body>
</html>