Microsoft Teams – Manipulate Phone Numbers in Your Tenant


When we talk about Direct Routing it is possible to create manipulation rules to change the Phone Numbers (DDIs) inside the Teams tenant with no change to your SBCs.

The supported scenarios are:

  • Modify an call incoming from the PSTN to Teams (InboundPstnNumberTranslationRules)
  • Modify an outgoing call from Teams to the PSTN (OutboundTeamsNumberTranslationRules)

As a side note, the commands to change a call incoming from Teams (InboundTeamsNumberTranslationRules) and a call outgoing from the PSTN (OutboundPstnNumberTranslationRules) are available but I do not see any application for them


To be able to apply the number manipulations, P-Asserted-Identity (PAI) header must not be forwarded along with the call (so, it has to be disabled on the SBC for the incoming PSTN calls and in Teams for the calls outgoing from Teams)


Manipulation rules have to be defined in the tenant with the New-CsTeamsTranslationRule command. For example:

New-CsTeamsTranslationRule -Identity RedirectToAutoAttendant -Pattern ‘^usernumber$’ -Translation ‘Auto Attendant number’


The manipulations are applied on a per-SBC base as a parameters in the SBC configuration InboundPstnNumberTranslationRules for incoming PSTN and -OutboundTeamsNumberTranslationRules for calls outgoing from Teams. For a example

Set-CsOnlinePSTNGateway -Identity SBC.Modern-Workplace.UK -InboundPstnNumberTranslationRules RedirectToAutoAttendant

Set-CsOnlinePSTNGateway -Identity SBC.Modern-Workplace.UK -OutboundTeamsNumberTranslationRules ModifyCalledDDI

Below you can see two diagrams to explain the different steps