%3CLINGO-SUB%20id%3D%22lingo-sub-1968701%22%20slang%3D%22en-US%22%3ETeams%20Direct%20Routing%20and%20Local%20Media%20Optimization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1968701%22%20slang%3D%22en-US%22%3E%3CP%3ETeams%20Phone%20System%20and%20Direct%20Routing%20is%20more%20important%20than%20ever%20because%20it%20helps%20companies%20and%20their%20employees%20to%20stay%20connected%20with%20their%20office%20number%20even%20if%20they%20are%20working%20from%20home.%3CBR%20%2F%3ETo%20gain%20best%20audio%20quality%20in%20a%20PSTN%20phone%20call%20it%20is%20important%20to%20understand%20how%20local%20media%20optimization%20can%20support%20this%20scenario%20and%20how%20to%20configure%20it.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EWith%20Teams%20Phone%20System%20in%20general%20companies%20can%20close%20the%20gap%20between%20working%20from%20anywhere%20and%20still%20stay%20connected%20with%20the%20office%20phone%20number.%20This%20is%20an%20often-underestimated%20scenario.%20Users%20can%20use%20legacy%20technologies%20like%20VPN%20securely%20to%20get%20a%20company%20access%20from%20home.%20They%20can%20use%20Office%20365%20services%20like%20Exchange%20Online%20and%20SharePoint%20Online%20to%20collaborate%20with%20colleagues%20and%20get%20work%20done.%20But%20one%20missing%20piece%20is%20most%20often%20left%20out%3A%20the%20desk%20phone%20in%20the%20office.%20With%20a%20legacy%20PBX%20system%2C%20it%20is%20difficult%20to%20bring%20the%20office%20phone%20number%20at%20home%20to%20the%20user.%20Here%20Microsoft%20Teams%20Phone%20System%20can%20help%20and%20support%20you.%20The%20Microsoft%20Teams%20Client%20will%20be%20extended%20by%20PSTN%20calling%20and%20the%20user%20is%20reachable%20under%20the%20office%20number%20in%20their%20home%20office%20or%20wherever%20they%20like%20to%20work.%3CBR%20%2F%3EBut%20as%20often%3A%20there%20is%20no%20joy%20without%20sorrow.%20The%20network%20part%20and%20especially%20the%20WAN%20connection%20is%20critical.%20If%20the%20roundtrip%20time%20for%20the%20audio%20packages%20in%20the%20network%20is%20not%20optimal%2C%20users%20are%20complaining%20about%20bad%20audio%20quality%20and%20the%20well-intended%20solution%20can%20turn%20into%20a%20fiasco.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ETo%20offer%20the%20best%20experience%20for%20your%20users%2C%20Microsoft%20provides%20several%20techniques%20and%20features%20to%20optimize%20the%20media%20flow%20for%20this%20scenario.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EMedia%20Flow%20in%20Microsoft%20Teams%E2%80%93%20some%20basics%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EIn%20case%20of%20Microsoft%20Teams%2C%20we%20must%20two%20types%20of%20media%20flow.%20The%20first%20scenario%20is%20a%201%3A1%20scenario.%20Microsoft%20Teams%20always%20tries%20to%20use%20the%20shortest%20network%20path%20for%20transmitting%20the%20data%20packages.%20In%20this%201%3A1%20scenario%20this%20is%20a%20direct%20connection%20between%20the%20two%20endpoints.%20To%20optimize%20the%20flow%20even%20further%2C%20Microsoft%20Teams%20will%20try%20to%20establish%20a%20UDP%20connection%20first%20and%20will%20switch%20to%20a%20TCP%20connection%20if%20the%20first%20one%20is%20not%20possible.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%201.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238842i6FA21A9E1C5312D5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%201.png%22%20alt%3D%22Figure%201%20-%20Media%20flow%201%3A1%20call%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%201%20-%20Media%20flow%201%3A1%20call%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20second%20scenario%20is%20the%20Meeting%20scenario.%20A%20meeting%20scenario%20can%20be%20a%20scheduled%20online%20meeting%2C%20but%20also%20when%20you%20start%20a%20one%20on%20one%20conversation%20and%20add%20a%20third%20person%20to%20it%2C%20it%20will%20be%20turned%20into%20a%20meeting.%20And%20in%20case%20of%20a%20meeting%2C%20the%20media%20flow%20is%20always%20to%20the%20Office%20365%20platform%20as%20the%20central%20meeting%20platform.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%202.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238848i07035C20777435FE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%202.png%22%20alt%3D%22Figure%202%20-%20Media%20Flow%20in%20Teams%20Meeting%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%202%20-%20Media%20Flow%20in%20Teams%20Meeting%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20case%20of%20PSTN%20Calling%20with%20Teams%20Direct%20Routing%20a%20session%20border%20controller%20is%20required.%20A%20session%20border%20controller%20(SBC)%20terminates%20the%20PSTN%20connection%20from%20the%20provider%20and%20routes%20inbound%20calls%20to%20the%20Teams%20platform%20and%20vice%20versa.%20Therefor%20the%20media%20flow%20for%20a%20PSTN%20call%20is%20slightly%20different%20because%20there%20is%20at%20least%20one%20more%20hop%3A%20the%20SBC%20itself%20where%20the%20audio%20packages%20will%20be%20routed%20through.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EMedia%20Flow%20and%20Microsoft%20Teams%20Direct%20Routing%20%E2%80%93%20default%20scenario%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EIn%20a%20default%20scenario%20without%20Media%20Optimization%2C%20the%20audio%20packages%20will%20be%20routed%20from%20the%20SBC%20to%20the%20Microsoft%20Teams%20platform%20and%20from%20there%20to%20the%20Teams%20endpoint.%20In%20case%20of%20an%20employee%20inside%20the%20company%2C%20the%20media%20stream%20traverses%20the%20firewall%20twice%3A%20first%20time%20from%20the%20SBC%20to%20Office%20365%20and%20for%20a%20second%20time%20from%20the%20Office%20365%20platform%20to%20the%20user.%20As%20you%20can%20imagine%20this%20costs%20bandwidth%20and%2C%20of%20course%2C%20package%20runtime.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%203.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238851iF22EFCB9501BE4FA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%203.png%22%20alt%3D%22Figure%203%20-%20Default%20Media%20Flow%20with%20Teams%20Direct%20Routing%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%203%20-%20Default%20Media%20Flow%20with%20Teams%20Direct%20Routing%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EHow%20to%20optimize%20Media%20Flow%20with%20Teams%20Direct%20Routing%20%E2%80%93%20Media%20Bypass%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EThe%20first%20step%20to%20optimize%20the%20media%20flow%20is%20a%20well%20know%20technique%20from%20Microsoft%20Lync%20and%20Skype%20for%20Business%20deployments%3A%20Media%20Bypass.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%204.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238854iB700C01D242A393A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%204.png%22%20alt%3D%22Figure%204%20-%20Media%20Flow%20with%20Teams%20Direct%20Routing%20and%20Media%20Bypass%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%204%20-%20Media%20Flow%20with%20Teams%20Direct%20Routing%20and%20Media%20Bypass%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20Microsoft%20Teams%20endpoint%20can%20communicate%20directly%20to%20the%20SBC%20external%20IP%20address%2C%20the%20call%20is%20established%20with%20Media%20Bypass.%20This%20means%20that%20the%20audio%20data%20are%20transmitted%20directly%20between%20the%20Teams%20endpoint%20and%20the%20SBC%20itself.%20The%20audio%20data%20does%20not%20traverse%20the%20firewall%20and%20the%20routing%20is%20optimized.%20Additionally%2C%20you%20have%20the%20option%20to%20prioritize%20Microsoft%20Teams%20audio%20data%20in%20your%20network%20with%20Quality%20of%20Service.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EWith%20a%20current%20firmware%20release%20installed%20on%20the%20SBC%20and%20Local%20Media%20Optimization%2C%20you%20can%20configure%20the%20SBC%20to%20provide%20an%20internal%20facing%20network%20adapter%20to%20use%20for%20Media%20Bypass%2C%20too.%20The%20Teams%20client%20will%20send%20and%20receive%20the%20audio%20packages%20to%20and%20from%20an%20internal%20IP%20address%20of%20the%20SBC%20directly.%3CBR%20%2F%3EIn%20the%20past%2C%20you%20had%20to%20configure%20the%20external%20interface%20with%20the%20public%20IP%20address%20for%20Media%20Bypass%2C%20so%20that%20internal%20clients%20use%20the%20external%20IP%20for%20a%20direct%20connection.%20This%20made%20it%20very%20hard%20and%20complex%20because%20your%20firewall%20had%20to%20support%20this%20scenario.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThe%20advantages%20are%20very%20simple%3A%20the%20media%20flow%20stays%20in%20your%20local%20network%20and%20you%20can%20control%20it%20better%20with%20Quality%20of%20service.%20Also%2C%20the%20firewall%20configuration%20is%20much%20simpler%20for%20this%20scenario.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3ELocal%20Media%20Optimization%20with%20Centralized%20SBC%20for%20Branch%20Offices%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EFor%20your%20branch%20offices%20you%20can%20use%20Media%20Bypass%20as%20a%20centralized%20SBC%2C%20too.%20In%20this%20scenario%20the%20different%20phone%20number%20ranges%20for%20your%20offices%20will%20terminate%20on%20one%20SBC%20in%20your%20datacenter.%20The%20SBC%20will%20do%20the%20routing%20between%20the%20users%20in%20the%20branch%20offices%20and%20the%20Microsoft%20Teams%20platform.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%205.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238855iDFE0E180999C3A3F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%205.png%22%20alt%3D%22Figure%205%20-%20Media%20Flow%20with%20Media%20Bypass%20from%20the%20Branch%20Office%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%205%20-%20Media%20Flow%20with%20Media%20Bypass%20from%20the%20Branch%20Office%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3ELocal%20Media%20Optimization%20with%20Proxy%20SBC%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EA%20second%20option%20for%20your%20branch%20office%20can%20be%20to%20implement%20a%20Proxy%20SBC%20in%20your%20main%20datacenter%20and%20local%20SBC%20systems%20on%20site.%20In%20this%20scenario%2C%20the%20Proxy%20SBC%20is%20used%20for%20the%20central%20communication%20to%20the%20Microsoft%20Teams%20platform.%20The%20SBC%20in%20the%20branch%20site%20is%20responsible%20for%20the%20local%20PSTN%20connection%20and%20will%20route%20calls%20over%20the%20Proxy%20SBC%20to%20Microsoft%20Teams%20and%20vice%20versa.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIn%20this%20scenario%20a%20Proxy%20SBC%20can%20help%20to%20reduce%20the%20requirements%20to%20your%20infrastructure.%20Only%20a%20single%20SBC%20instance%20must%20be%20configured%20to%20work%20with%20Microsoft%20Teams.%20Also%2C%20it%20is%20often%20used%20where%20a%20centralized%20SBC%20is%20not%20possible%20when%20there%20are%20some%20regulatory%20or%20the%20onsite%20SBC%20does%20not%20meet%20the%20technical%20requirements.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%206.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238856i4CE4046F0A1F2F07%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%206.png%22%20alt%3D%22Figure%206%20-%20Proxy%20SBC%20for%20the%20Branch%20Office%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%206%20-%20Proxy%20SBC%20for%20the%20Branch%20Office%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3ECan%20Home%20Office%20users%20participate%20from%20Media%20Bypass%3F%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3EOf%20course%2C%20Media%20Bypass%20and%20local%20Media%20Optimization%20also%20provides%20some%20benefits%20for%20your%20home%20office%20and%20mobile%20users.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EMicrosoft%20provides%20several%20Transport%20Relay%20servers%20in%20their%20worldwide%20datacenters.%20Best%20practice%20is%20to%20allow%20the%20Teams%20subnet%20networks%20to%20communicate%20to%20the%20public%20SBC%20IP%20address%20for%20media%20traffic.%20It%20is%20also%20possible%20to%20open%20the%20SBC%20public%20IP%20address%20to%20your%20mobile%20worker%2C%20but%20it%20is%20quite%20difficult%20to%20manage%20this.%20Each%20time%20they%20connect%20to%20the%20internet%2C%20they%20will%20use%20another%20public%20IP%20address.%20Therefor%20my%20recommendation%20is%20to%20allow%20only%20the%20Teams%20subnet%20networks%20to%20your%20SBC%20public%20IP%20and%20to%20benefit%20from%20the%20Microsoft%20Global%20Network.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIf%20you%20are%20doing%20so%2C%20the%20audio%20data%20from%20the%20home%20user%20will%20be%20transmitted%20to%20one%20of%20the%20nearest%20Transport%20Relay%20server%20of%20the%20Microsoft%20Global%20Network.%20Pay%20attention%20that%20your%20users%20can%20use%20a%20local%20internet%20break%20out%20and%20reach%20the%20nearest%20egress%20point%20to%20the%20Microsoft%20Global%20Network.%20The%20Microsoft%20Transport%20Relay%20server%20will%20connect%20to%20the%20SBC%20directly%20and%20will%20establish%20a%20communication.%20And%20here%20is%20the%20same%20behavior%3A%20the%20path%20from%20the%20Microsoft%20Global%20Network%20to%20your%20SBC%20will%20be%20shorten%20to%20the%20most%20necessary.%20That%20is%20why%20even%20your%20home%20user%20will%20benefit%20from%20Media%20Bypass.%20The%20runtime%20of%20the%20audio%20packages%20is%20optimized%20with%20the%20help%20of%20the%20Microsoft%20Global%20network.%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%207.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238857i51CB45DE376E8A01%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%207.png%22%20alt%3D%22Figure%207.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20size%3D%225%22%3E%3CSTRONG%3EHow%20to%20configure%20Media%20Bypass%20and%20local%20Media%20Optimization%3C%2FSTRONG%3E%3C%2FFONT%3E%3CBR%20%2F%3ETo%20configure%20Media%20Bypass%20and%20Local%20Media%20Optimization%20you%20must%20check%20if%20your%20installed%20SBC%20firmware%20already%20supports%20this%20feature.%20If%20not%2C%20ask%20your%20vendor%20for%20a%20current%20release%20and%20install%20it%20on%20the%20SBC.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThen%20you%20must%20configure%20your%20network%20topology%20in%20the%20Microsoft%20Teams%20Admin%20Center%2C%20so%20the%20Teams%20platform%20is%20aware%20of%20your%20network%20infrastructure.%20You%20can%20allow%20or%20decline%20Media%20Bypass%20in%20two%20ways%2C%20as%20we%20already%20know%20from%20the%20good%20old%20times%3A%20Always%20ByPass%20or%20Local%20Only.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EIn%20case%20of%20Always%20ByPass%20the%20Microsoft%20Teams%20endpoint%20tries%20to%20connect%20directly%20to%20the%20SBC%20every%20time%2C%20regardless%20of%20where%20the%20user%20is%20located%20in%20your%20network.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EWhen%20you%20configure%20Local%20Only%2C%20Media%20Bypass%20will%20only%20be%20used%2C%20if%20the%20user%20is%20in%20the%20same%20network%20site%20as%20the%20SBC.%20If%20each%20one%20is%20in%20a%20separate%20network%20site%2C%20the%20media%20flow%20is%20routed%20to%20a%20Microsoft%20Transport%20server%20and%20then%20to%20the%20SBC.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3ETherefor%20you%20must%20configure%20Regions%20and%20Sites%20in%20the%20Teams%20Admin%20Center%20or%20with%20PowerShell.%20Next%20you%20assign%20your%20networks%20to%20a%20site.%20You%20must%20configure%20the%20trusted%20WAN%20IP%20addresses%20as%20well.%20Theses%20are%20the%20public%20IP%20addresses%20used%20by%20your%20users%20to%20connect%20to%20Microsoft%20Teams.%20According%20to%20this%20information%20and%20the%20network%20topology%2C%20Microsoft%20Teams%20will%20allow%20to%20use%20Media%20Bypass%20for%20the%20endpoint.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EThe%20last%20step%20is%20to%20enable%20Media%20Bypass%20on%20the%20SBC%20level%20in%20the%20Teams%20Admin%20Center%20or%20on%20the%20PowerShell.%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EMore%20information%20can%20be%20found%20on%20Microsoft%20Docs%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fmicrosoftteams%2Fdirect-routing-media-optimization-configure%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EConfigure%20Local%20Media%20Optimization%20for%20Direct%20Routing%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1968701%22%20slang%3D%22en-US%22%3E%3CP%3ETo%20gain%20best%20audio%20quality%20in%20a%20PSTN%20phone%20call%20it%20is%20important%20to%20understand%20how%20local%20media%20optimization%20can%20support%20this%20scenario%20and%20how%20to%20configure%20it.%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Figure%206.png%22%20style%3D%22width%3A%20915px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F238858iB8AC585C4A921AD5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Figure%206.png%22%20alt%3D%22Figure%206.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1984824%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20and%20Local%20Media%20Optimization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1984824%22%20slang%3D%22en-US%22%3E%3CP%3EVery%20useful%20information%20and%20nicely%20documented%20the%20technical%20details.%20Thanks%20for%20the%20blog%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2094476%22%20slang%3D%22en-US%22%3ERe%3A%20Teams%20Direct%20Routing%20and%20Local%20Media%20Optimization%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2094476%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Pickhan%2C%3C%2FP%3E%3CP%3EI%20have%20set%20up%20LMO%20Trusted%20IP%2C%20Sites%20and%20Subnets%2C%20media%20Bypass%20n%20PSTNGateway%20in%20Tenant.%20Using%20Ribbon%205400%20SBCs.%20I'm%20doing%20Proxy%20SBCs%20with%20internal%20SBCs%20(downstreams%20SBCs).%20Users%20are%20located%20in%20various%20internal%20subnets.%20During%20my%20test%20from%20one%20of%20my%20internal%20subnet%2C%20I%20noticed%20the%203%20MX-%20headers%26nbsp%3B%20in%20sbc%20trace%20file%20but%20somehow%20Teams%20client%20is%20connecting%20to%20the%20external%20interface%20of%20the%20SBCs%20I%20expect%20it%20to%20connect%20to%20the%20downstream%20sbc%20private%20interface.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20do%20you%20think%20could%20be%20wrong%20with%20our%20configurations%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EX-MS-UserLocation%3A%20internal%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EX-MS-MediaPath%3A%20SBC.Sipdomain.com%26nbsp%3B%20(%20downstream%20sbc)%3C%2FSTRONG%3E%3CBR%20%2F%3E%3CSTRONG%3EX-MS-UserSite%3A%20Test_User_Site%3C%2FSTRONG%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Frequent Contributor

Teams Phone System and Direct Routing is more important than ever because it helps companies and their employees to stay connected with their office number even if they are working from home.
To gain best audio quality in a PSTN phone call it is important to understand how local media optimization can support this scenario and how to configure it.


With Teams Phone System in general companies can close the gap between working from anywhere and still stay connected with the office phone number. This is an often-underestimated scenario. Users can use legacy technologies like VPN securely to get a company access from home. They can use Office 365 services like Exchange Online and SharePoint Online to collaborate with colleagues and get work done. But one missing piece is most often left out: the desk phone in the office. With a legacy PBX system, it is difficult to bring the office phone number at home to the user. Here Microsoft Teams Phone System can help and support you. The Microsoft Teams Client will be extended by PSTN calling and the user is reachable under the office number in their home office or wherever they like to work.
But as often: there is no joy without sorrow. The network part and especially the WAN connection is critical. If the roundtrip time for the audio packages in the network is not optimal, users are complaining about bad audio quality and the well-intended solution can turn into a fiasco.


To offer the best experience for your users, Microsoft provides several techniques and features to optimize the media flow for this scenario.


Media Flow in Microsoft Teams– some basics
In case of Microsoft Teams, we must two types of media flow. The first scenario is a 1:1 scenario. Microsoft Teams always tries to use the shortest network path for transmitting the data packages. In this 1:1 scenario this is a direct connection between the two endpoints. To optimize the flow even further, Microsoft Teams will try to establish a UDP connection first and will switch to a TCP connection if the first one is not possible.

Figure 1 - Media flow 1:1 callFigure 1 - Media flow 1:1 call

 

The second scenario is the Meeting scenario. A meeting scenario can be a scheduled online meeting, but also when you start a one on one conversation and add a third person to it, it will be turned into a meeting. And in case of a meeting, the media flow is always to the Office 365 platform as the central meeting platform.

Figure 2 - Media Flow in Teams MeetingFigure 2 - Media Flow in Teams Meeting

 

In case of PSTN Calling with Teams Direct Routing a session border controller is required. A session border controller (SBC) terminates the PSTN connection from the provider and routes inbound calls to the Teams platform and vice versa. Therefor the media flow for a PSTN call is slightly different because there is at least one more hop: the SBC itself where the audio packages will be routed through.


Media Flow and Microsoft Teams Direct Routing – default scenario
In a default scenario without Media Optimization, the audio packages will be routed from the SBC to the Microsoft Teams platform and from there to the Teams endpoint. In case of an employee inside the company, the media stream traverses the firewall twice: first time from the SBC to Office 365 and for a second time from the Office 365 platform to the user. As you can imagine this costs bandwidth and, of course, package runtime.

Figure 3 - Default Media Flow with Teams Direct RoutingFigure 3 - Default Media Flow with Teams Direct Routing

 

 

How to optimize Media Flow with Teams Direct Routing – Media Bypass
The first step to optimize the media flow is a well know technique from Microsoft Lync and Skype for Business deployments: Media Bypass.

Figure 4 - Media Flow with Teams Direct Routing and Media BypassFigure 4 - Media Flow with Teams Direct Routing and Media Bypass

 

If the Microsoft Teams endpoint can communicate directly to the SBC external IP address, the call is established with Media Bypass. This means that the audio data are transmitted directly between the Teams endpoint and the SBC itself. The audio data does not traverse the firewall and the routing is optimized. Additionally, you have the option to prioritize Microsoft Teams audio data in your network with Quality of Service.


With a current firmware release installed on the SBC and Local Media Optimization, you can configure the SBC to provide an internal facing network adapter to use for Media Bypass, too. The Teams client will send and receive the audio packages to and from an internal IP address of the SBC directly.
In the past, you had to configure the external interface with the public IP address for Media Bypass, so that internal clients use the external IP for a direct connection. This made it very hard and complex because your firewall had to support this scenario.


The advantages are very simple: the media flow stays in your local network and you can control it better with Quality of service. Also, the firewall configuration is much simpler for this scenario.


Local Media Optimization with Centralized SBC for Branch Offices
For your branch offices you can use Media Bypass as a centralized SBC, too. In this scenario the different phone number ranges for your offices will terminate on one SBC in your datacenter. The SBC will do the routing between the users in the branch offices and the Microsoft Teams platform.

Figure 5 - Media Flow with Media Bypass from the Branch OfficeFigure 5 - Media Flow with Media Bypass from the Branch Office

 

Local Media Optimization with Proxy SBC
A second option for your branch office can be to implement a Proxy SBC in your main datacenter and local SBC systems on site. In this scenario, the Proxy SBC is used for the central communication to the Microsoft Teams platform. The SBC in the branch site is responsible for the local PSTN connection and will route calls over the Proxy SBC to Microsoft Teams and vice versa.


In this scenario a Proxy SBC can help to reduce the requirements to your infrastructure. Only a single SBC instance must be configured to work with Microsoft Teams. Also, it is often used where a centralized SBC is not possible when there are some regulatory or the onsite SBC does not meet the technical requirements.

Figure 6 - Proxy SBC for the Branch OfficeFigure 6 - Proxy SBC for the Branch Office

 

Can Home Office users participate from Media Bypass?
Of course, Media Bypass and local Media Optimization also provides some benefits for your home office and mobile users.


Microsoft provides several Transport Relay servers in their worldwide datacenters. Best practice is to allow the Teams subnet networks to communicate to the public SBC IP address for media traffic. It is also possible to open the SBC public IP address to your mobile worker, but it is quite difficult to manage this. Each time they connect to the internet, they will use another public IP address. Therefor my recommendation is to allow only the Teams subnet networks to your SBC public IP and to benefit from the Microsoft Global Network.


If you are doing so, the audio data from the home user will be transmitted to one of the nearest Transport Relay server of the Microsoft Global Network. Pay attention that your users can use a local internet break out and reach the nearest egress point to the Microsoft Global Network. The Microsoft Transport Relay server will connect to the SBC directly and will establish a communication. And here is the same behavior: the path from the Microsoft Global Network to your SBC will be shorten to the most necessary. That is why even your home user will benefit from Media Bypass. The runtime of the audio packages is optimized with the help of the Microsoft Global network.

Figure 7.png

 

How to configure Media Bypass and local Media Optimization
To configure Media Bypass and Local Media Optimization you must check if your installed SBC firmware already supports this feature. If not, ask your vendor for a current release and install it on the SBC.


Then you must configure your network topology in the Microsoft Teams Admin Center, so the Teams platform is aware of your network infrastructure. You can allow or decline Media Bypass in two ways, as we already know from the good old times: Always ByPass or Local Only.


In case of Always ByPass the Microsoft Teams endpoint tries to connect directly to the SBC every time, regardless of where the user is located in your network.


When you configure Local Only, Media Bypass will only be used, if the user is in the same network site as the SBC. If each one is in a separate network site, the media flow is routed to a Microsoft Transport server and then to the SBC.


Therefor you must configure Regions and Sites in the Teams Admin Center or with PowerShell. Next you assign your networks to a site. You must configure the trusted WAN IP addresses as well. Theses are the public IP addresses used by your users to connect to Microsoft Teams. According to this information and the network topology, Microsoft Teams will allow to use Media Bypass for the endpoint.


The last step is to enable Media Bypass on the SBC level in the Teams Admin Center or on the PowerShell.


More information can be found on Microsoft Docs Configure Local Media Optimization for Direct Routing

 

2 Comments
Occasional Visitor

Very useful information and nicely documented the technical details. Thanks for the blog

Occasional Visitor

Hi Pickhan,

I have set up LMO Trusted IP, Sites and Subnets, media Bypass n PSTNGateway in Tenant. Using Ribbon 5400 SBCs. I'm doing Proxy SBCs with internal SBCs (downstreams SBCs). Users are located in various internal subnets. During my test from one of my internal subnet, I noticed the 3 MX- headers  in sbc trace file but somehow Teams client is connecting to the external interface of the SBCs I expect it to connect to the downstream sbc private interface. 

 

What do you think could be wrong with our configurations? 

 

X-MS-UserLocation: internal
X-MS-MediaPath: SBC.Sipdomain.com  ( downstream sbc)
X-MS-UserSite: Test_User_Site