---
lab:
title: TechLab: Configure Teams Direct Routing
description:
level: 300
duration: 60 minutes
islab: true
primarytopics:
---
@lab.Title
Please enter your own Microsoft alias (without the @microsoft.com) in the field below before starting the lab. This information is required to correctly associate your activity with your learner record and ensure your completion is accurately captured and reported. For data integrity and compliance reasons, learners may only enter their own alias. After completing the lab, please allow up to 5 business days for all reporting systems to fully reflect your completion.
@lab.ActivityGroup(aliascapture)
===
This lab is a technical deep dive on Teams Phone advanced features and calling plans. Before we begin, please take a moment to consider your experience and comfort level with this topic and answer these questions.
@lab.ActivityGroup(initialsurvey)
===
During this lab, you will configure the PSTN connectivity type Direct Routing in Microsoft Teams. You will configure and use an on-premises session border controller and then enable users for Teams Phone using this PSTN connectivity type.
In this lab you will use an AudioCodes Session Border Controller for your lab environment but there are many more supported SBC vendors available.
[!KNOWLEDGE] If you want to learn more, go to Plan Direct Routing - Microsoft Teams
and
Session Border Controllers certified for Direct Routing - Microsoft Teams
Estimated time to complete: 45 minutes
To complete the exercises in this lab, you will be provided a Microsoft 365 tenant with an Enterprise E5 trial subscription.
The type text
and copy/paste
features used in this lab will send the specified text string to the active window in the virtual machine. Always compare the text in the lab document with the typed text in the virtual machine and virtual machine and verify the expected text is shown.
After completing the exercises, you will be able to:
- Pair an on-premises AudioCodes Mediant virtual edition session border controller (SBC) with Microsoft Teams.
- Configure a user for Teams Phone, voicemail, and assign a phone number.
- Test calling inbound and outbound using direct routing.
Select Next to continue to the lab exercises.
All credentials are provided in the lab steps.
===
As the Teams administrator for your organization, you've started the planning and deployment of the PSTN connectivity type Direct Routing. You completed all required planning steps and now you are ready to start the configuration for your environment.
First, you must configure the environment with a custom domain and request a trusted third-party public certificate that will be used by the SBC. Then you will deploy a configuration file and required certificates to the SBC in preparation for connecting to Microsoft Teams.
This task updates the O365Ready.com DNS server with your lab's public IP address and creates a DNS delegation zone for your lab domain pointing to the DNS server running on RRAS01. Requests for hosts in your lab domain will be resolved by the DNS server running in RRAS01.
Expand this section if you have restarted this lab or if it expired *and* you are using the same lab number and Microsoft 365 tenant.
>If you have restarted this lab or if it expired and the virtual machines were reset *and* you are using the same lab number and Microsoft 365 tenant, perform the steps in the tip section at the end of this task. You do not need to be issued a new lab number. If you will be using a new lab number, continue with this task.-
Sign in to @lab.VirtualMachine(CLIENT01).SelectLink as @lab.VirtualMachine(CLIENT01).Username with +++@lab.VirtualMachine(CLIENT01).Password+++ as the password.
-
In Microsoft Edge, go to +++http://www.O365Ready.com+++.
-
On the Welcome page, select the Generate Lab Number tab.
-
In the IP Address box, enter +++@lab.VirtualMachine(RRAS01).NetworkAdapter(Network Adapter).IpAddress+++.
[!ALERT] This is the public IP address assigned to the gateway server, RRAS01.
RRAS01 is hosting the public DNS records for your custom lab domain name. -
In the Lab Code box, enter +++41228TEAMS+++ and then press Enter or select Submit.
This lab code will expire 90 days after the start of this course. -
In the results, locate and write down the five-digit lab number that is assigned to you. You will refer to this five-digit number throughout the labs.
You will be using all five digits as part of your organization's on-premises domain. -
Enter your five-digit lab number in the following text box. This will automatically populate your lab number in the lab document:
@lab.TextBox(customlabnumber) -
Select the following button to create the lab configurations and files that will be used later:
@lab.Activity(labartifacts)
[!KNOWLEDGE]
**Expand this section if** you are using the same lab number and have restarted this lab or if the lab timer has expired and the virtual machines were reset. You will likely have a new public IP address. Perform the following steps to update your lab domain delegation zone's public IP address.
>- Open Windows PowerShell and then run the following command. Replace the five x's with your lab number. > > ```PowerShell-wrap > Resolve-DnsName labxxxxx.o365ready.com -type NS -server o365ready.com > ``` > >- Write down the identified public IP. This should be the public IP address you previously used. >- In Microsoft Edge, go to +++http://www.O365Ready.com+++. >- On the Welcome page, select the **Update Public IP Address** tab. >- In the **Student Lab Number** box, type your five digit lab number. > If you did not write down your original lab number, you can find it by signing into Microsoft 365 and browsing to the **Domains** feature. >- In the **Old public IP address** box, type the previously used public IP address. >- In the **New public IP address** box, type +++@lab.VirtualMachine(RRAS01).NetworkAdapter(Network Adapter).IpAddress+++ and then press Enter. >- Select **Submit** and wait for the update to complete. This may take a couple of minutes.
===
-
In CLIENT01, right-click Start and then select Terminal (Admin).
-
In the User Account Control dialog box, select Yes.
-
Connect to Azure AD. In Windows PowerShell, enter the following and then press Enter:
Connect-MgGraph -Scopes "User.ReadWrite.All","Domain.ReadWrite.All"User name +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ Password +++@lab.CloudCredential(M365Calling).AdministrativePassword+++ If prompted for to change password enter:
-
Current password: +++@lab.CloudCredential(M365Calling).AdministrativePassword+++
-
New Password: +++@lab.CloudCredential(M365Calling).UserPassword+++
-
-
In the dialog box select consent on behalf of my organization and the select Accept
-
Add your lab domain to Azure. In Windows PowerShell, enter the following and then press Enter:
New-MgDomain -BodyParameter @{Id="lab@lab.Variable(customlabnumber).o365ready.com";IsDefault="False"} -
Assign the verification text record to a variable. In Windows PowerShell, enter the following and then press Enter:
$verifyTXT = (Get-MgDomainVerificationDnsRecord -DomainId "lab@lab.Variable(customlabnumber).o365ready.com" | Where-Object {$_.RecordType -eq "Txt"}).AdditionalProperties.text
Confirm by entering:
PowerShell-wrap $verifyTXT
-
The RRAS01 server is hosting the DNS zone used by your custom domain. Rather than connecting to the remote server's console, you can do this remotely using Windows PowerShell. Create a CIM session to the DNS server named RRAS01. In Windows PowerShell, enter the following and then press Enter:
$Cimsession = New-CimSession -Name "RRAS01" -ComputerName "RRAS01" -Credential $(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList ("@lab.VirtualMachine(RRAS01).Username", (ConvertTo-SecureString -AsPlainText -Force -String "@lab.VirtualMachine(RRAS01).Password"))) -Authentication Negotiate -
Using the remote session, add the verification text record to the DNS server. In Windows PowerShell, enter the following and then press Enter:
Add-DnsServerResourceRecord -ComputerName "RRAS01" -CimSession $Cimsession -ZoneName "@lab.Variable(labDomain)" -Name "@" -Txt -DescriptiveText $verifyTXT -
Complete domain verification in Azure AD by confirming the value you have in your DNS zone with the expected value from Microsoft 365. In Windows PowerShell, enter the following and then press Enter:
Confirm-MgDomain -DomainId "lab@lab.Variable(customlabnumber).o365ready.com" -
For Direct Routing, you cannot use the default domain *.onmicrosoft.com. You must use one or more domains added to the organization. Set the lab domain name as the default domain in Azure AD. In Windows PowerShell, enter the following and then press Enter:
Update-MgDomain -DomainId "lab@lab.Variable(customlabnumber).o365ready.com" -IsDefault:$trueThere is no output for this command.
@lab.Activity(Automated2)
[!ALERT] If your domain is not able to be verified, confirm all configurations were successful in the previous task. If necessary, review the Add your custom domain name using the Azure Active Directory portal Microsoft Learn document.
[!KNOWLEDGE] To learn more about why a DNS Record is required for the SBC, go to Plan Direct Routing - Microsoft Teams
and To learn more about the Verification TXT Records, go to Add DNS records to connect your domain - Microsoft 365 admin
===
-
In CLIENT01, open Microsoft Edge and then go to +++https://admin.microsoft.com+++.
-
Sign in as +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ using +++@lab.CloudCredential(M365Calling).AdministrativePassword+++ as the password.
-
Select Skip for now.
-
In the Microsoft 365 admin center, in the left navigation, select Show all.
-
Select Settings > Domains.
-
On the Domains page, select lab@lab.Variable(showcustomlabnumber).o365ready.com.
-
On the lab@lab.Variable(showcustomlabnumber).o365ready.com page, select Continue setup.
-
On the How do you want to connect your domain page, select Continue.
[!NOTE] The lab's DNS records have already been created for you in the publicly facing DNS server on RRAS01.
-
On the Add DNS records, select Continue.
You may choose to review the different DNS record option requirements. -
On the Domain setup is complete page, select Done.
-
In the left navigation, select Domains.
-
On the Domains page, verify the Status for the lab@lab.Variable(showcustomlabnumber).o365ready.com is listed as Healthy.
===
An SBC needs to have a valid public certificate to build a trusted connection to Microsoft Teams and to encrypt the traffic. Therefore, we are going to request such a certificate from a valid public CA (Certification Agency) and install it locally on the SBC in the lab.
-
Open File Explorer and then go to C:\LabFiles.
-
Double-click or double-tap CertReq-lab@lab.Variable(customlabnumber).o365Ready.com.txt.
This certificate request was created by the configuration script. -
In Notepad, select all text in the file and then press Ctrl+C to copy the contents to the clipboard.
-
Switch to Microsoft Edge and then go to +++https://www.digicert.com/friends/exchange.php+++.
-
On the Microsoft Event CSR Submission page, in the Paste CSR box, right-click and then select Paste.
-
Under Certificate Details, review the common name and subject alternative names (SAN) information that will be assigned to the certificate.
-
Under Certificate Delivery, in the Email Address and Email Address (again) boxes, enter +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++.
-
Select the I agree to the Terms of Service above checkbox.
-
Select Submit.
-
Close Notepad and File Explorer.
===
In this exercise, you will verify your custom domain exists in Microsoft 365 and is assigned to a user. Then, you will upload a new configuration file and update an AudioCodes Mediant virtual edition SBC.
-
On @lab.VirtualMachine(CLIENT01).SelectLink, in Microsoft Edge, go to +++https://admin.microsoft.com+++.
-
Sign in as +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ with +++@lab.CloudCredential(M365Calling).AdministrativePassword+++ as the password.
-
In the left navigation, select Users > Active users.
-
In the Active users list, select Diego Siciliani.
-
In the Diego Siciliani user card, under Username and email select Manage username and email.
-
In the Manage username and email pane, to the right of DiegoS@@lab.CloudCredential(M365Calling).TenantName, select the Edit pencil icon.
-
To the right of Diego, select the menu and then select lab@lab.Variable(customlabnumber).o365Ready.com.
-
Select Done and then select Save changes.
-
Close the Manage username and email pane.
[!NOTE] Your custom domain must be assigned to at least one Teams enabled user to ensure the domain is available for the SBC configured later in this lab.
-
Perform the same steps to update the username and email address for Patti Fernandez from PattiF@@lab.CloudCredential(M365Calling).TenantName to PattiF@lab@lab.Variable(customlabnumber).O365Ready.com.
===
-
In Microsoft Edge, open a new tab and then go to +++https://outlook.office365.com+++.
If necessary, sign to in Outlook on the web as +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ with password +++@lab.CloudCredential(M365Calling).AdministrativePassword+++. -
In the message list, locate and select the message from DigiCert with the zip file attachment.
The message may arrive in the Focused or Other folder.[!ALERT] If the message is not in the Inbox, wait 2-5 minutes. Refresh the browser if the message list is not automatically updated. If the message has not been delivered, continue to the next lab and return later. In some cases, processing and issuance of the certificate may take longer than expected.
-
Download the sbc01_Lab@lab.Variable(customlabnumber).O365Ready.comXXXXXXX.zip file.
[!ALERT] Do not open or extract the zip file. You will do next this using PowerShell.
-
Right-click Start and then select Terminal (Admin).
-
In the User Account Control dialog box, select Yes.
-
Verify the zip file is located in the Downloads folder. In Windows PowerShell, enter the following and then press Enter:
Get-ChildItem "C:\Users\$env:Username\Downloads" | where{ $_.Name -like "sbc01*.zip" } -
Review the output and verify the file is listed. If it is not, return to Outlook on the web and download the file again.
===
-
Create a variable to hold the certificate zip file. In Windows PowerShell, enter the following and then press Enter:
$CertZipFileName = (Get-ChildItem "C:\Users\\$env:Username\Downloads" | where{ $_.Name -like "sbc01*.zip" }).Name -
Expand the archive to the C:\Script folder. In Windows PowerShell, enter the following and then press Enter:
Expand-Archive -LiteralPath "C:\Users\$env:Username\Downloads\$CertZipFileName" -DestinationPath "C:\Scripts" -Force -
Complete the certificate request that was created at the beginning of this lab. In Windows PowerShell, enter the following and then press Enter:
certreq.exe -accept (Get-ChildItem C:\Scripts\$($CertZipFileName.Split(".")[0]) | Where-Object { $_.Name -like "sbc01_lab@lab.Variable(customlabnumber)_o365ready_com*" }).VersionInfo.FileName[!NOTE] The certificate request was created when you ran the Update lab configurations and files automation activity.
-
Review the output of the command and verify the certificate has been installed.
-
Retrieve the certificate thumbprint. In Windows PowerShell, enter the following and then press Enter:
$cert = (Get-ChildItem Cert:\LocalMachine\My | Where-Object { $_.Subject -like "CN=sbc01.@lab.Variable(labDomain)*" }).Thumbprint -
Create a secure password string. In Windows PowerShell, enter the following and then press Enter:
$securePassword = "@lab.VirtualMachine(CLIENT01).Password" | ConvertTo-SecureString -AsPlainText -Force -
Export the certificate to a PFX file so it can be used later. In Windows PowerShell, enter the following and then press Enter:
Export-PfxCertificate -Cert Cert:\LocalMachine\My\$cert -FilePath C:\LabFiles\Labcert.pfx -ChainOption BuildChain -Password $securePassword
===
[!NOTE] The ini file used in this task is the configuration file for the SBC and includes all the required configuration details for the SBC like IPs, Connection to Teams, Ports, Media, Security etc.
This lab is not intended to teach how to configure an SBC. The focus is to understand the configuration steps and requirements for a Direct Routing.
-
In Microsoft Edge, open a new tab and then go to +++http://192.168.0.200+++.
This is the address of the AudioCodes SBC. -
On the Web Login page, sign in as +++Admin+++ with password +++Admin+++.
-
In the top navigation menu, select ADMINISTRATION.
-
In the left navigation, select MAINTENANCE > Configuration File.
-
In the Configuration File window, under INI FILE, under Load INI file to the device, select Choose File.
-
go to C:\LabFiles, select Lab@lab.Variable(customlabnumber)-SBC01-Config.ini, and then select Open.
-
To the right of the configuration file path, select Load INI file.
-
Review the dialog box and then select OK.
Wait for the SBC to restart. When finished restarting, the browser will refresh to the sign in page.
===
The SBC must trust the full certificate chain Microsoft uses for the Direct Routing infrastructure to allow a TLS connection between the SBC and Microsoft.
-
In Microsoft Edge, on the AudioCodes page, at the Web Login, sign in as +++Admin+++ with password +++Admin+++.
If necessary, refresh the browser page. You may need to wait for the SBC to finish restarting. -
On the top menu, select IP NETWORK.
-
In the left navigation, select SECURITY > TLS Contexts.
-
In the results pane, in the TLS Contexts table, select Teams-TLSContext.
-
Under #1[Teams-TLSContext], at the bottom of the page, select Trusted Root Certificate >>.
-
In the Trusted Root Certificates window, select Import.
-
In the Import New Certificate dialog box, select Choose File.
-
Go to C:\LabFiles, select BaltimoreTrustedRootCA.cer, and then select Open.
-
In the Import New Certificate dialog box, select Ok.
-
Review the information for the selected root certificate that was installed.
-
At the top of the page, select Import.
-
Perform the same steps and load the following root certificates:
- DigicertTrustedRoot.cer
- DigicertTrustedRootIntermediate.cer
-
When complete, in the Trusted Root Certificates window, to the left of TLS Context[#1], select the back arrow icon.
===
The specific certificate for the SBC must be imported to ensure the device connection is valid.
-
In the TLS Contexts window, in the TLS Contexts table, select Teams-TLSContext.
-
Under #1[Teams-TLSContext], at the bottom of the page, select Change Certificate >>.
-
In the Change Certificates window, scroll down to the UPLOAD CERTIFICATE FILES FROM YOUR COMPUTER section.
-
In the Private key pass-phrase (optional) box, enter +++@lab.VirtualMachine(CLIENT01).Password+++.
-
Under Send Private Key file from your computer to the device, select Choose File.
-
In the Open window, go to C:\LabFiles, select Labcert.pfx, and then select Open.
-
To the right of the lab certificate file path, select Load File.
-
Review the message below the Change Certificates page name and verify that the certificate was loaded.
===
A message manipulation rule defines a manipulation sequence for SIP messages. SIP message manipulation enables the normalization of SIP messaging fields between communicating network segments.
-
In Microsoft Edge, go to +++http://192.168.0.200/AdminPage+++.
-
In the left navigation, select ini Parameters.
-
In the Parameter Name box, enter +++GWOutboundManipulationSet+++.
-
In the Enter Value box, enter +++0+++.
This is the manipulation set ID value. -
Select Apply New Value.
-
Review the information in the Output Window.
-
In the left navigation, select Back to Main.
-
In the top navigation menu, select Save.
-
In the Save Configuration dialog box, select Yes.
===
In this exercise, you will learn how to connect the on-premises SBC to Microsoft Teams Direct Routing and how to configure Teams users to use Direct Routing to connect to the Public Switched Telephone Network (PSTN). You will test calling from Microsoft Teams to a SIP software-based phone and from the softphone to Microsoft Teams.
[!KNOWLEDGE] If you want to learn more, go to Configure Direct Routing - Microsoft Teams
-
Perform a lookup on the SBC host name and verify the name resolves to a public IP address. In Windows PowerShell, enter the following and then press Enter:
Resolve-DnsName sbc01.@lab.Variable(labDomain) -
The lab virtual environment cannot be used to telnet to the public IP address of the SBC.
Telnet to the SBC using the public DNS name and signaling port of the SBC. Using your own computer, in Windows PowerShell, enter the following and then press Enter:++Telnet sbc01.@lab.Variable(labDomain) 5061++
[!HINT] If you don't have telnet already installed, on Windows you can install telnet using the following command:
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient -
A successful connection will result in a blank console screen.
Type any letters into the console session to cause it to close or wait for the session to close automatically. -
Close Windows PowerShell.
===
-
In CLIENT01, right-click Start and then select Windows Terminal (Admin).
-
In the User Account Control dialog box, select Yes.
-
Connect to Microsoft Teams using the Teams PowerShell module. In Windows PowerShell, enter the following and then press Enter:
Connect-MicrosoftTeams -
In the Windows PowerShell credential request window, enter the following information and then select OK:
Username +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ Password +++@lab.CloudCredential(M365Calling).AdministrativePassword+++ -
Review the PSTN gateway commands. In Windows PowerShell, enter the following and then press Enter:
Get-Command *PSTNGateway* -
Review the available cmdlets.
-
Create an SBC (Online PSTN Gateway) in Microsoft Teams. In Windows PowerShell, enter the following and then press Enter:
New-CsOnlinePSTNGateway -Fqdn sbc01.lab@lab.Variable(customlabnumber).o365ready.com -SipSignalingPort 5061 -MaxConcurrentSessions 100 -Enabled $true[!Alert] If you receive an error stating:
Can not use the "sbc01.lab@lab.Variable(customlabnumber).o365ready.com" domain as it was not configured for this tenant.
You may have to wait up to 15 minutes until the newly added custom domain is available for use. Periodically retry the command until it is successful. -
Review the output of the command.
@lab.Activity(Automated3)
[!HINT] We highly recommend setting the SBC Maximum Concurrent Sessions which can be found in the SBC documentation. The limit will help to be notified if the SBC is at the capacity level.
[!KNOWLEDGE] If you want to learn more, go to Connect your Session Border Controller (SBC) to Direct Routing
===
-
Switch to Microsoft Edge and then go to +++https://admin.teams.microsoft.com+++.
If necessary, sign to in Outlook on the web as +++@lab.CloudCredential(M365Calling).AdministrativeUsername+++ with password +++@lab.CloudCredential(M365Calling).AdministrativePassword+++. -
In the left navigation, select Voice > Direct Routing.
-
On the SBCs tab verify that sbc01.lab@lab.Variable(customlabnumber).o365ready.com is listed.
[!HINT] The SBC may show warnings. The TLS connectivity status warning is related to the certificate expiring within 30 days. The SIP Options status warning should be transient and will not impact this lab.
-
Select sbc01.lab@lab.Variable(customlabnumber).o365ready.com.
-
Although there is no current call information, on the Usage tab, review the different graphs that are available.
-
Select the Settings tab.
-
Review the different settings reported for the SBC.
-
Switch to Microsoft Edge and the AudioCodes tab.
If necessary, sign in as +++Admin+++ with password +++Admin+++. -
On the audiocodes page, at the top, select TROUBLESHOOT.
-
In the left navigation, under MESSAGE LOG > LOGGING, select Syslog Settings.
-
On the Syslog Settings page, under SYSLOG, verify Enable Syslog is set to Enable.
-
In the Syslog Server IP box, enter +++192.168.0.101+++.
This is the IP address of CLIENT01. -
Select the Debug Level menu and then select Basic.
-
At the bottom of the page, select APPLY.
-
At the top of the page, select Save.
-
In the Save Configuration dialog box, select Yes.
===
-
On CLIENT01, select Start and then select Syslog Viewer.
[!NOTE] If prompted, you do not need to update the application.
-
Maximize the Syslog Viewer window.
-
Wait for logs to begin displaying in the window.
-
In the menu, select Tools > SIP Flow Diagram.
-
In the SIP Flow Diagram window, in the table, select one of the flows from the SBC.
-
Under the table, in the SIP stack, locate and review the CONTACT entry and confirm this header contains the SBC fully qualified domain name (FQDN) instead of an IP address.
-
In the visualization on the left, verify receipt of the 200 OK option.
!IMAGESyslog viewer showing the SIP Flow Diagram connection from 192.168.0.200 to 192.168.0.200{700}
!IMAGESyslog viewer showing the SIP Flow Diagram connection from Device to the IP address 52.114.132.46{300}
-
In the table, select one of the flows from sip:sip-du-a-us.pstnhub.microsoft.com, sip:sip-du-a-eu.pstnhub.microsoft.com, or sip:sip-du-a-as.pstnhub.microsoft.com to 192.168.0.200.
[!HINT] These are the connection points Microsoft uses for Direct Routing within the documented IP ranges of 52.112.0.0/14 and 52.120.0.0/14.
-
In the visualization on the left, verify receipt of the 200 OK option.
Leave the SIP Flow Diagram window open. It will be used later.
===
[!note] Sign into Microsoft Teams in PowerShell before running the commands.
-
Return the current PSTN usage records in the tenant. In Windows PowerShell, enter the following and then press Enter:
Get-CsOnlinePstnUsage -
Review the output of the command.
[!KNOWLEDGE] If you have several usages defined, the names of the usages might truncate. Use the command, (Get-CSOnlinePSTNUsage).Usage, to display a list of the defined PSTN usages.
-
Add a usage to the list of online PSTN usages. In Windows PowerShell, enter the following and then press Enter:
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="US and Canada"} -
Create a new online voice route to tell Microsoft Teams how to route calls from Microsoft 365 users to phone numbers on the public switched telephone network (PSTN) or a private branch exchange (PBX). In Windows PowerShell, enter the following and then press Enter:
New-CsOnlineVoiceRoute -Identity "10 Digit Dialing" -NumberPattern "^\+1(\d{10})$" -OnlinePstnGatewayList sbc01.lab@lab.Variable(customlabnumber).o365ready.com -OnlinePstnUsages "US and Canada"
===
-
Switch to Microsoft Edge and the Microsoft Teams admin center.
-
In the left navigation, select Voice > Direct Routing.
-
On the SBCs tab, for sbc01.lab@lab.Variable(customlabnumber).o365ready.com, check the different status fields.
You may need to refresh the screen to see updated information. -
Confirm the SIP Options status is listed as Active.
-
Select the Voice routes tab.
-
Review the Voice routes and verify sbc01.lab@lab.Variable(customlabnumber).o365ready.com is listed in the SBCs enrolled column for the recently created voice route.
[!KNOWLEDGE] If you want to learn more, go to Health Dashboard for Direct Routing - Microsoft Teams
===
[!note] You must sign into Microsoft Teams in PowerShell before running the commands.
-
Switch to Windows Terminal.
-
Set Diego Siciliani's phone number and phone number type. In Windows PowerShell, enter the following and then press Enter:
Set-CsPhoneNumberAssignment -Identity DiegoS@lab@lab.Variable(customlabnumber).o365ready.com -PhoneNumber +14255551234 -PhoneNumberType DirectRouting -
Set Patti Fernandez's phone number and phone number type. In Windows PowerShell, enter the following and then press Enter:
Set-CsPhoneNumberAssignment -Identity PattiF@lab@lab.Variable(customlabnumber).o365ready.com -PhoneNumber +14255551235 -PhoneNumberType DirectRouting -
In Windows PowerShell, enter the following and then press Enter:
Get-CsOnlineUser -Filter "DisplayName eq 'Diego Siciliani' or DisplayName eq 'Patti Fernandez'" |fl Userprin*,DisplayN*,Enter*,LineU*[!ALERT] If there is no output for the command, wait 2-3 minutes and then retry the command.
-
Review the information and notice that Teams Phone is enabled.
===
Microsoft Phone System has a routing mechanism that allows a call to be sent to a specific Session Border Controller (SBC) based on:
- The called number pattern.
- The called number pattern plus the specific user who makes the call.
-
Create a new online voice routing policy. In Windows PowerShell, enter the following and then press Enter:
New-CsOnlineVoiceRoutingPolicy "North America" -OnlinePstnUsages "US and Canada" -
Assign the policy to Diego Siciliani. In Windows PowerShell, enter the following and then press Enter:
Grant-CsOnlineVoiceRoutingPolicy -Identity DiegoS@lab@lab.Variable(customlabnumber).o365ready.com -PolicyName "North America"[!ALERT] If you receive an error stating that the Policy "North America" is not a user policy. You can assign only a user policy to a specific user, wait 2-3 minutes and then retry the command. You may need to retry the command several times before it is successful. It may take up to 15 minutes before it becomes available. If the policy is still not updated in the service, you continue to the next lab and return later.
-
Assign the policy to Patti Fernandez. In Windows PowerShell, enter the following and then press Enter:
Grant-CsOnlineVoiceRoutingPolicy -Identity PattiF@lab@lab.Variable(customlabnumber).o365ready.com -PolicyName "North America" -
Confirm the voice routing policy has been assigned to Diego Siciliani and Patti Fernandez. In Windows PowerShell, enter the following and then press Enter:
Get-CsOnlineUser -Filter "DisplayName eq 'Diego Siciliani' or DisplayName eq 'Patti Fernandez'" |ft Userprin*,OnlineVoiceR*[!ALERT] If there is no output for the command, wait 2-3 minutes and then retry the command.
-
Review the output of the command.
If the policy is empty, try the command again. If the policy is still empty, wait approximately 2-3 minutes and then try the command again.
[!KNOWLEDGE] If you want to learn more, go to Configure call routing for Direct Routing - Microsoft Teams
@lab.Activity(Question11)
===
The 3CX softphone is a software-based IP phone and is being used to represent calls made from a user connecting through the SBC.
-
Select Start and then select 3CX Phone > 3CX Phone.
-
Verify that On Hook is displayed on the screen.
[!NOTE] The softphone has already been configured to connect to the AudioCodes Mediant VE SBC.
===
-
Verify Syslog Viewer and SIP Flow Diagram are running or open Syslog Viewer and the SIP Flow Diagram. Logs will be reviewed in later tasks.
-
On the Windows task bar, select Microsoft Teams.
[!ALERT] The currently installed version of Microsoft Teams may require updating to be current with Microsoft requirements for connectivity. If this happens, in Microsoft Edge, go to +++https://www.microsoft.com/en-us/microsoft-teams/download-app+++ and download the desktop Teams app for Teams for work or school.
-
In the Microsoft Teams window, select Get started.
-
In the Sign in box, enter +++DiegoS@lab@lab.Variable(customlabnumber).o365ready.com+++ and then select Next.
-
In the Password box, enter +++@lab.CloudCredential(M365Calling).UserPassword+++ and then select Sign in.
If prompted for to change password enter:
-
Current password: +++@lab.CloudCredential(M365Calling).UserPassword+++
-
New Password: +++@lab.CloudCredential(M365Calling).AdministrativePassword+++
-
-
In the Stay signed in to all your apps window, select No, sign in to this app only.
-
Close the introduction wizard and any other notifications.
-
In the app bar on the left, select Calls.
[!ALERT] If the Calls option is not available, sign out of Microsoft Teams, wait 2-3 minutes, and then sign in again. You may need to repeat this if the option is not available after your first retry.
-
Using the dial pad, call +++12065559876+++.
This is the number for the account configured in the 3CX softphone.[!ALERT] If the dial pad is not available, continue to the next task and test calling from the softphone. It may take several minutes before the feature is available.
-
If prompted, in the Windows Security Alert dialog box, select Allow access.
-
Switch to the 3CX softphone.
-
In the incoming call notification, select Answer and verify the call is connected.
[!ALERT] If the call fails to complete, you may need to wait 1-2 minutes and then try again.
-
When complete, in the 3CX window, select the hang up icon.
===
-
In the softphone, using the dial pad, call +++14255551234+++.
-
Answer the call using the Teams client and verify the call has connected.
-
Switch to the softphone and hang up the call.
-
From the softphone, using the dial pad, call +++14255551235+++.
-
Verify that you can connect to Patti's voicemail and then hang up.
[!ALERT] If you are unable to hear the voicemail message, hang up and continue with the lab.
===
-
Switch to Microsoft Edge and the AudioCodes tab.
If necessary, sign in as +++Admin+++ with password +++Admin+++. -
On the audiocodes page, at the top, select MONITOR.
-
In the left navigation, select VOIP STATUS > SBC CDR HISTORY.
-
In the table, review the incoming and outgoing calls.
Locate the calls from the Microsoft Teams user to the softphone. -
Switch to the AudioCodes Syslog Viewer app and the SIP Flows Diagram window.
-
Under the table, on the menu, select Refresh.
-
In the table, scroll to the bottom of the captured connections and move back up to locate and then select the call from sip:+14255551234@sip.pstnhub.microsoft.com to sip:+12065559876@sbc01.lab69392.o365ready.com.
-
Under the table, review the SIP stack information.
These are the entries from INVITE to SESSION-EXPIRES. -
Below the SIP stack, review the Session Description Protocol (SDP) content.
-
In the visualization on the left, review the call from INVITE through the final 200 OK to end the session.
!IMAGESIP Flow diagram showing a successful call from a Teams user through the SBC to a recipient
[!KNOWLEDGE] If you want to learn more, go to Teams Phone System Direct Routing: SIP protocol - Microsoft Teams.
===
Please take a moment to answer these questions. Providing answers to these questions will complete this lab. Your answers will help us understand the effectiveness of the lab and help to improve these labs as a whole.
[!Alert] IMPORTANT: These labs are hosted on the Skillable platform. Completion data is collected and then exported to Success Factors every Monday. SF require another 1-3 days to process that data. The status for this lab will be visible in Viva and Learning Path next week.
Be sure to select "Submit" in the bottom right corner to get credit for completing this lab.
@lab.ActivityGroup(completionsurvey)
[!Alert] After answering the survey questions, select submit to complete and end the lab. This is required in order to receive credit for lab completion.
===
You've completed the Deploying Direct Routing in Microsoft Teams lab.

