<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>
<div>Hello together,</div>

<div>currently i'm trying to configure a freeswitch to setup a sip-trunk for direct-routing with Microsoft Teams.<br/>
So far i had no luck to get a registed sip-trunk.<br/>
Does anyone has so far a working config for a registed sip-trunk with MS-Teams ?</div>

<div> </div>

<div>On two websited with a Sample-Configuration with a diffrent-system:<br/>
https://skalatan.de/en/blog/kamailio-sbc-teams<br/>
https://blog.opensips.org/2019/09/16/opensips-as-ms-teams-sbc/<br/>
they talk about two header-settings that are not correct in my config or are missing</div>

<div> </div>

<div>1. Microsoft needs a contact header in form of:<br/>
--<br/>
Contact: <sip:FQDN-SERVER:5061;transport=tls><br/>
--<br/>
my contact-header looks like:<br/>
Contact: <sip:FQDN-SERVER@IP-SERVER:5061;tport=tcp;transport=tls;gw=ms-teams><br/>
--<br/>
How do i get rid of "@IP-SERVER" and ";gw=ms-teams" from the contact-header in freeswitch ?</div>

<div><br/>
2. there is a "record-route-header" missing in the format:<br/>
--<br/>
"FQDN-SERVER:5061;transport=tls", "IP-SERVER:5060"<br/>
--<br/>
How do i set this record-route-header in freeswitch ?</div>

<div> </div>

<div> </div>

<div> </div>

<div> </div>

<div>here is my config so far:<br/>
--<br/>
<profile name="teams"><br/>
  <gateways><br/>
  <gateway name="ms-teams"><br/>
        <param name="realm" value="sip.pstnhub.microsoft.com:5061"/><br/>
        <param name="from-domain" value="FQDN-SERVER"/><br/>
        <param name="contact-host" value="FQDN-SERVER"/><br/>
        <param name="extension-in-contact" value="true"/><br/>
        <param name="register" value="false"/><br/>
        <param name="register-transport" value="tls"/><br/>
        <param name="caller-id-in-from" value="true"/><br/>
        <param name="contact-in-ping" value="true"/><br/>
        <param name="retry-seconds" value="3600"/><br/>
        <param name="username" value="testuser"/><br/>
  <domains><br/>
    <domain name="all" alias="false" parse="false"/><br/>
  </domains></div>

<div>  <settings><br/>
        <param name="debug" value="0"/><br/>
        <param name="sip-trace" value="no"/><br/>
        <param name="rfc2833-pt" value="101"/><br/>
        <param name="sip-port" value="5060"/><br/>
        <param name="dialplan" value="XML"/><br/>
        <param name="context" value="teams"/><br/>
        <param name="apply-inbound-acl" value="microsoft"/><br/>
        <param name="codec-prefs" value="PCMA"/><br/>
        <param name="inbound-codec-negotiation" value="greedy"/><br/>
        <param name="inbound-late-negotiation" value="true"/><br/>
        <param name="disable-transfer" value="true"/><br/>
        <param name="disable-hold" value="true"/><br/>
        <param name="dtmf-duration" value="100"/><br/>
        <param name="use-rtp-timer" value="true"/><br/>
        <param name="rtp-timer-name" value="soft"/><br/>
        <param name="media_timeout" value="300"/><br/>
        <param name="media_hold_timeout" value="1800"/><br/>
        <param name="tls" value="true"/><br/>
        <param name="tls-only" value="true"/><br/>
        <param name="tls-bind-params" value="transport=tls"/><br/>
        <param name="tls-sip-port" value="5061"/><br/>
        <param name="tls-cert-dir" value="/etc/freeswitch/tls"/><br/>
        <param name="tls-version" value="tlsv1.2"/><br/>
        <param name="tls-passphrase" value="PASSWORD-FROM-CERT"/><br/>
        <param name="rtp-ip" value="PUBLIC-IP-SERVER"/><br/>
        <param name="sip-ip" value="PUBLIC-IP-SERVER"/><br/>
        <param name="ext-rtp-ip" value="PUBLIC-IP-SERVER"/><br/>
        <param name="ext-sip-ip" value="PUBLIC-IP-SERVER"/><br/>
        <param name="sip-invite-record-route" value="sip:testuser@FQDN-SERVER:5061;transport=tls"/><br/>
  </settings><br/>
</profile><br/>
--<br/>
as fas as i could see everything including the exchange of the public-certificate works fine, but afterwards i get a timeout for that trunk.<br/>
 </div>

<div>Thanks, Andreas</div>
</div></div></body></html>