You are here

Microsoft Teams

The following articles provide more information about configuring and using Phone System Direct Routing. You should read all of these articles to understand how to plan and configure Direct Routing. Microsoft Phone System Direct Routing lets you connect an ALLOcloud SIP trunk to Microsoft Phone System.

 

    Prerequisites:

    • Office 365 tenant: An Office 365 tenant that you use to home your Microsoft Teams users.
    • Teams users of Direct Routing must have the following licenses assigned in Office 365: Office 365 E3 with Microsoft Phone System and Microsoft Audio Conferencing addons or Office 365 E5 (addons already included).
    • sip365.cloud subdomain: provided by ALLOcloud.
    • ALLOcloud SIP trunk: configured in the ALLOcloud V3 account portal.
    • Office 365 teant coexistence mode should be configured to "TeamsOnly" (See https://docs.microsoft.com/en-us/microsoftteams/migration-interop-guidance-for-teams-with-skype)

     

    In this example, we will use:

    • ALLOcloud account: teams.allocloud.com
    • sip365.cloud subdomain: teams.sip365.cloud
    • Customer's main domain in Office 365: contoso.com

     

    Configuration of the Office 365 Tenant:

    • Connect to the Office 365 admin portal and assign the users with Direct Routing with the appropriate licenses (see prerequisites).
    • Configure the main domain "contoso.com" with the "Skype for Business" online services:
                 Sign in to Office 365 with your work account.
                 Choose Setup > Domains.
                 On the Manage domains page, choose a domain in the list, and then choose Manage DNS.
                 You need to select Skype for Business. After that, you’ll see, in the domains setup wizard wizard and on the DNS management page, only the DNS records you have to update for "contoso.com". Update/Create these DNS entries
    •  Add the domain provided by ALLOcloud:
                 Sign in to Office 365 with your work account.
                 Choose Setup > Domains.
                 On the Manage domains page, add the domain "teams.sip365.cloud". You will need to contact ALLOcloud Support to validate domain ownership (TXT record to be added on our side).
    • When the domain "teams.sip365.cloud" is correctly added, create a dummy user xxx@teams.sip365.cloud with Office 365 E3 license (+ Microsoft Phone System and Microsoft Audio Conferencing addons) or Office 365 E5 (addons already included). This user is temporarily and only needed to create the Direct Routing trunk in the next steps. This user can be removed afterwards. 
    • In order to propagate and validate this domain correctly, please login on https://teams.microsoft.com with this dummy user.      

    n.b.: It can takes a couple of minutes, even hours for this configuration to be completely propagated on all Microsoft servers. If you encounter errors in the next steps, please try again later.     

    Pair the Direct Routing Service with ALLOcloud SIP trunk:

      You need to use a PowerShell session connected to the tenant to pair the ALLOcloud SIP trunk to the Direct Routing interface. To open a PowerShell session, please follow the steps outlined in Set up your computer for Windows PowerShell

      • Install the Skype for Business Online Connector module.
      • Open powershell and connect to the Tenant with an admin user (i.e.: john@contoso.com):        
         Import-Module LyncOnlineConnector
         $credential = Get-Credential
         $session = New-CsOnlineSession -Credential $credential
         Import-PSSession $session
        
        
      • To pair the ALLOcloud SIP trunk to the tenant, in the PowerShell session type the following and press Enter:
                    New-CsOnlinePSTNGateway -Fqdn <SBC FQDN> -SipSignallingPort <SBC SIP Port> -MaxConcurrentSessions <Max Concurrent Sessions the SBC can handle> -Enabled $true
              in our case:
                    New-CsOnlinePSTNGateway -Fqdn teams.sip365.cloud -SipSignallingPort 5061 -MaxConcurrentSessions 10 -Enabled $true  
      •  Validate that the trunk is present in the list:

                    Get-CSOnlinePSTNGateway

      n.b.: It can takes a couple of minutes, even hours for this configuration to be completely propagated on all Microsoft servers. If you encounter errors in the next steps, please try again later.     

      Configure Voice Routing:

      Microsoft Phone System has a routing mechanism that allows a call to be sent to a specific SIP Trunk.

      • First, you need to create a PSTN usage:

                  Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="ALLOcloud"}

      • Validate that the usage was created by entering:
                  Get-CSOnlinePSTNUsage
      • Create the route based on destination prefix. For example, to route everything through the SIP Trunk:

                  New-CsOnlineVoiceRoute -id "ALLOcloud"  -NumberPattern ".*" -OnlinePstnGatewayList teams.sip365.cloud  -OnlinePstnUsages "ALLOcloud"          

      • Create the route policy:

                 New-CsOnlineVoiceRoutingPolicy "ALLOcloud" -OnlinePstnUsages "ALLOcloud"

      n.b.: It can takes a couple of minutes, even hours for this configuration to be completely propagated on all Microsoft servers. If you encounter errors in the next steps, please try again later.     

      Enable users for Direct Routing Service:

      • For each Teams users, configure the phone number and enable enterprise voice and voicemail.

                   Set-CsUser -Identity user1@contoso.com -OnPremLineURI tel:+3228801234 -EnterpriseVoiceEnabled $true -HostedVoiceMail $true
                   Set-CsUser -Identity user2@contoso.com -OnPremLineURI tel:+3228801235 -EnterpriseVoiceEnabled $true -HostedVoiceMail $true

      • For each Teams users, grant a voice routing policy (created in "Configure Voice Routing"):

                   Grant-CsOnlineVoiceRoutingPolicy -Identity user1@contoso.com -PolicyName "ALLOcloud"
                   Grant-CsOnlineVoiceRoutingPolicy -Identity user2@contoso.com -PolicyName "ALLOcloud"

      Optional: Create custom dial plans in Teams: 

      A dial plan is a named set of normalization rules that translate dialed phone numbers by an individual user into an alternate format (typically E.164) for purposes of call authorization and call routing.

      A dial plan consists of one or more normalization rules that define how phone numbers expressed in various formats are translated to an alternate format. The same dial string may be interpreted and translated differently in different dial plans, so depending on which dial plan is assigned to a given user, the same dialed number may be translated and routed differently.

      If you want to be able to call from Teams to ALLOcloud using internal extensions, then a custom dial plan is needed. Example: A Teams user dials extension 200 that belongs to an ALLOcloud callflow. Without custom dial plan, Microsoft Direct Routing will transform the called number "200" to "+32200", which will not match your callflow in ALLOcloud. To make this possible, we will create this dial plan for 3 digits (if you use 4 digits, you need to adapt this script):

                  $nr1=New-CsVoiceNormalizationRule -Identity ALLOcloud/ED3 -Description 'ALLOcloud extension dialing - 3 digits' -Pattern '^(\d{3})$' -Translation '$1' - InMemory
                  New-CsTenantDialPlan -Identity ALLOcloud-internal-extensions -NormalizationRules @{Add=$nr1} -SimpleName ALLOcloud-internal-extensions

      When done, you need to assign this dial plan to the users:
                  Grant-CsTenantDialPlan -Identity user1@contoso.com -PolicyName ALLOcloud-internal-extensions
                  Grant-CsTenantDialPlan -Identity user2@contoso.com -PolicyName ALLOcloud-internal-extensions
      If you get an error, saying that the policy cannot be applied, this user needs to login one time into the team client
       
      n.b.: If you get an error, saying that the policy cannot be applied, this user needs to login one time into the Teams client. It can takes a couple of minutes, even hours for this configuration to be completely propagated on all Microsoft servers. 
       
      Create the callflow(s) on AC3:
       
      Create the callflow to route the numbers to Microsoft Teams Direct Routing:
       
       
       
      Test and validation:
       
      At this stage, you should contact ALLOcloud Support so we can validate that the link between ALLOcloud and your Microsoft Teams Direct Routing is well connected and that the configuration on our side is finished. 
      You should then be able to call in and out from/to Microsoft Teams.