<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="">In my implementation I am using a drachtio server (<a href="https://drachtio" class="">https://drachtio</a>.org), more specifically configured as part of the jambonz CPaaS platform I build (<a href="https://docs.jambonz.org/teams/" class="">https://docs.jambonz.org/teams/</a>)<div class=""><br class=""></div><div class="">A Record-Route header only makes sense if you are creating a sip proxy, AFAIC. In my implementation I built a B2BUA so on requests I send to Teams there is no RR. Of course, on responses I preserve their RR headers.</div><div class=""><br class=""></div><div class="">For your scenario, I think I passed on the trace but just in case here is a link to it again: <a href="https://gist.github.com/davehorton/9ea3d79e8eeda3cbb5e2e87209dcfe63" class="">https://gist.github.com/davehorton/9ea3d79e8eeda3cbb5e2e87209dcfe63</a></div><div class=""><br class=""></div><div class="">One question: for the domain you are putting in the Contact header of your 200 OK response, does that resolve to a single server or multiple? I have found in the latter case Teams will gladly send a mid-call request to a different server that heretofore was not involved in the call at all. On the server that initially handled the call, it will simply look like Teams is not being responsive..</div><div class=""><br class=""></div><div class="">Dave<br class=""><div><br class=""><div class="">On Sep 23, 2020, at 3:56 AM, Stefan Kainz <<a href="mailto:s.kainz@wnt.at" class="">s.kainz@wnt.at</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Tahoma; font-size: 14px; font-style: normal; font-variant-caps: 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; text-decoration: none;"><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Thank you for your Answer!<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">May I ask what kind of SBC you are using?<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">We also use Audiocodes SBC’s, which are working great, but even those send Record-Route Headers.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Maybe I need to explain the szenario a little better…<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">In the teams client I dial an external number ( my mobile phone for example )<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">I pick up, and then push hold in the teams client. ( So far so good )<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">When I try to unhold, of course also in teams, it becomes silent on both ends. ( even the moh stops )<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">And then as I said I see a few OK Messages being retransmitted to the Microsoft servers.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Its funny that you say you don’t need Record-Route Headers at all, because without setting those, I cant even make incoming calls work.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">With those headers, everything works perfectly except for the thing explained above.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Even when trying to get incoming calls back from hold on teams. ( PSTN – freeswitch – teams, hold / unhold on teams )<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">I also found a tutorial from kamailio on how to connect it to teams.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">There they also state that the record-route headers a needed.<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><a href="https://skalatan.de/en/blog/kamailio-sbc-teams" style="color: blue; text-decoration: underline;" class="">https://skalatan.de/en/blog/kamailio-sbc-teams</a><o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Thank you again David!<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Regards,<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class="">Stefan<o:p class=""></o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><b class=""><span lang="EN-US" class="">From:</span></b><span lang="EN-US" class=""><span class="Apple-converted-space"> </span>David Horton <<a href="mailto:daveh@drachtio.org" class="">daveh@drachtio.org</a>><span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Montag, 21. September 2020 22:36<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>FreeSWITCH Users Help <<a href="mailto:freeswitch-users@lists.freeswitch.org" class="">freeswitch-users@lists.freeswitch.org</a>><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Stefan Kainz <<a href="mailto:s.kainz@wnt.at" class="">s.kainz@wnt.at</a>><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [Freeswitch-users] Microsoft Teams integration<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">It has not been my experience that Microsoft Teams direct routing requires a Record-Route header on requests / responses you send to it (though their requests will have an RR and you must Route accordingly)<o:p class=""></o:p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">Here is a sip trace showing a successful on-hold / off-hold scenario from one of my servers (not a freeswitch server). This is an on-hold triggered from the MS teams client, not sure if you are trying to do the reverse.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">One thing: make sure the Contact header in your INVITEs resolve to a single server, otherwise (if you have mutiple A records for the DNS name) you will find that MS Teams will gladly respond to a reINVITE to a completely different server than you sent from — this will manifest as not seeing the 200 OK to a re-INVITE you send, or not seeing the ACK when you respond 200 OK to a re-INVITE.<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">daveh<o:p class=""></o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">One thing to make sure of is that <o:p class=""></o:p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class="">On Sep 20, 2020, at 12:05 PM, Stefan Kainz <<a href="mailto:s.kainz@wnt.at" style="color: blue; text-decoration: underline;" class="">s.kainz@wnt.at</a>> wrote:<o:p class=""></o:p></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><o:p class=""> </o:p></div><div class=""><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Hello, <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">we're trying to use Freeswitch as a Microsoft Teams direct routing SBC.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">So far everything works perfectly, except getting the call back from hold on an outbound call. <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">The Problem is that Microsoft expects a Record-Route Header in every Request and every Response.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">I have been able to set/rewrite this Record-Route header with sip_h_ and sip_rh_ in most szenarios, but like i said - unhold on an outgoing call does not work.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">The hold is initiated with a reinvite with a=inactive in sdp, which does work. <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">However, the unhold - also a reinvite with a=sendrecv in sdp does not work correctly.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">In the sip-trace i see that the OK ( in response to the INVITE for unhold ) gets retransmitted a couple of times, because the ACK from microsoft isn't received. <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">This is due to the missing Record-Route Header in the OK Message.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">I have seen this behavior on inbound calls too, when i didnt set the Record-Route Header.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Now my question:<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Is there any way to add the Record-Route Header to every Message on a sip-profile or gateway? <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Or if not, is it possible to handle a reinvite in dialplan so i could set the header manually?<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Maybe there is somebody who already has this working that could point me in the right direction.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">I know freeswitch isn't a SBC, but it would be nice to be able to use freeswitch as a Teams-SBC without Kamailio or something similar.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Any help is very much appreciated<span class="apple-converted-space"> </span></span><span style="font-size: 12pt; font-family: "Segoe UI Emoji", sans-serif;" class="">🙂</span><span style="font-size: 12pt;" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">regards, <o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class="">Stefan<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div class=""><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 12pt;" class=""><o:p class=""> </o:p></span></div></div><div style="margin: 0cm; font-size: 11pt; font-family: Calibri, sans-serif;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">_________________________________________________________________________<br class=""><br class="">The FreeSWITCH project is sponsored by SignalWire<span class="apple-converted-space"> </span></span><a href="https://signalwire.com/" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://signalwire.com</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class="">Enhance your FreeSWITCH install with disruptive priced SMS and PSTN services.<br class="">Build your next product on our scalable cloud platform.<br class=""><br class="">Join our online community to chat in real time<span class="apple-converted-space"> </span></span><a href="https://signalwire.community/" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://signalwire.community</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""><br class="">Professional FreeSWITCH Services<br class=""></span><a href="mailto:sales@freeswitch.com" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">sales@freeswitch.com</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""></span><a href="https://freeswitch.com/" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://freeswitch.com</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""><br class="">Official FreeSWITCH Sites<br class=""></span><a href="https://freeswitch.com/oss" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://freeswitch.com/oss</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""></span><a href="https://freeswitch.org/confluence" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://freeswitch.org/confluence</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""></span><a href="https://cluecon.com/" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://cluecon.com</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""><br class="">FreeSWITCH-users mailing list<br class=""></span><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">FreeSWITCH-users@lists.freeswitch.org</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""></span><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class="">UNSUBSCRIBE:</span><a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">http://lists.freeswitch.org/mailman/options/freeswitch-users</span></a><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class=""><br class=""></span><a href="https://freeswitch.com/" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 10.5pt; font-family: Tahoma, sans-serif;" class="">https://freeswitch.com</span></a></div></div></div></div></div></div></div><br class=""></div></body></html>