Forum Discussion
Assign a phone number for user using Direct Routing
Hello,
I have setup a trunk for direct routing. I think I have all the proper licensing in place for my user, ie: phone system and calling plan. I am now trying to assign a phone number however the phone number type drop down ( in the general information section of my user in teams admin ) does not have the direct routing option. The only option given is Calling Plan. I want to use number that is on the Direct Routing trunk, not a Calling Plan number. How can I make it so Direct Routing is an option under Assign Phone number -> Phone number Type?
3 Replies
- Ahmed_Masoud97Steel Contributor
Direct Routing Number Assignment in Microsoft Teams
The Direct Routing option not appearing in the Teams admin center dropdown is expected behavior and does not indicate a configuration issue.
The Teams admin center only displays number types available within your Microsoft managed phone number inventory. Direct Routing numbers are managed outside Microsoft, so they do not appear in this dropdown regardless of the licenses assigned to the user.
Direct Routing numbers should therefore be assigned through PowerShell.
- Assign the Direct Routing Number
Use the following command:
The phone number must use E.164 format, including the plus sign and country code.
After assigning the number, allow a few minutes for the change to propagate, then refresh the Teams admin center. The number should appear against the user once synchronization is complete.
- Regarding the Alternative PowerShell Method
Some older guidance recommends using:
Set-CsUser -LineUriThis method is outdated for Teams phone number assignment.
Microsoft now recommends using:
Set-CsPhoneNumberAssignmentThe parameter:
-PhoneSystemRoutingPolicyNameis also not a valid parameter for Set-CsUser in the current Teams PowerShell module and should not be used for this configuration.
- Licensing Requirements
A Microsoft Calling Plan license is not required when using Direct Routing.
The user requires:
- Microsoft Teams Phone, previously known as Phone System
- An Online Voice Routing Policy containing the appropriate PSTN usages and routes for the Direct Routing trunk
A Calling Plan license is only required when using Microsoft provided phone numbers.
If the environment uses Direct Routing exclusively, the Calling Plan license can be removed. Keeping it assigned will not prevent Direct Routing from working, but it may influence what options are displayed within the Teams admin center.
- Additional Checks
Before assigning the number, confirm that Enterprise Voice is enabled for the user:
Get-CsOnlineUser -Identity email address removed for privacy reasons | Select EnterpriseVoiceEnabledAlso confirm that the user's Online Voice Routing Policy contains the correct PSTN usages and routes associated with the Direct Routing trunk.
The phone number may still assign successfully if these settings are missing, but inbound or outbound calling may not route correctly until the voice routing configuration is complete.
- LeonPavesicSilver Contributor
Hi VoipJedi,
To enable users for Direct Routing, you must have the following:
- A Direct Routing trunk configured in Teams.
- The appropriate licensing for your users, including the Phone System license and a calling plan.
Once you have these things in place, you can enable users for Direct Routing by following these steps:
- Go to the Microsoft Teams admin center.
- Click Users > Manage users.
- Select the user or users that you want to enable for Direct Routing.
- Under Account, click Edit.
- Under Assign phone number, select Enable users for Direct Routing.
- Click Apply.
Enable users for Direct Routing - Microsoft Teams | Microsoft Learn
To assign a phone number for a user using Direct Routing, follow these steps:
- Go to the Microsoft Teams admin center.
- Click Users > Manage users.
- Select the user to whom you want to assign a phone number.
- Under Account, click Edit.
- Under Assign phone number, select Direct Routing from the Phone number type drop-down menu.
- Enter the phone number that you want to assign to the user.
- Click Apply.
Assign phone numbers for users in Teams: https://learn.microsoft.com/en-us/microsoftteams/assign-change-or-remove-a-phone-number-for-a-user
You can also do that with PowerShell:To enable users for Direct Routing in Teams using PowerShell, follow these steps:
- Open PowerShell as an administrator.
- Import the Teams PowerShell module:
Import-Module MicrosoftTeams- Connect to Teams:
Connect-MicrosoftTeams -Credential $credentialwhere $credential is a variable that stores your Teams administrator credentials.
- Get a list of all users that are enabled for Phone System:
Get-CsOnlineUser | Where-Object { $_.EnterpriseVoiceEnabled -eq $true }- Enable the users for Direct Routing:
Set-CsUser -Identity "<User name>" -PhoneSystemRoutingPolicyName "DirectRouting"where <User name> is the name of the user that you want to enable for Direct Routing.
- Assign a phone number to the user:
Set-CsUser -Identity "<User name>" -LineUri "<Phone number>"where <Phone number> is the phone number that you want to assign to the user.
- Disconnect from Teams:
Disconnect-MicrosoftTeamsFor example, to enable a user named John Doe for Direct Routing and assign him the phone number 123-456-7890, you would use the following PowerShell commands:
Import-Module MicrosoftTeams Connect-MicrosoftTeams -Credential $credential # Get a list of all users that are enabled for Phone System $users = Get-CsOnlineUser | Where-Object { $_.EnterpriseVoiceEnabled -eq $true } # Enable John Doe for Direct Routing Set-CsUser -Identity "John Doe" -PhoneSystemRoutingPolicyName "DirectRouting" # Assign the phone number 123-456-7890 to John Doe Set-CsUser -Identity "John Doe" -LineUri "123-456-7890" Disconnect-MicrosoftTeamsYou can also use PowerShell to enable multiple users for Direct Routing at once. For example, to enable all users that are enabled for Phone System for Direct Routing, you would use the following PowerShell command:
Get-CsOnlineUser | Where-Object { $_.EnterpriseVoiceEnabled -eq $true } | Set-CsUser -PhoneSystemRoutingPolicyName "DirectRouting"Once you have enabled users for Direct Routing and assigned them phone numbers, they will be able to make and receive calls using their Direct Routing trunk.
Please click Mark as Best Response & Like if my post helped you to solve your issue.
This will help others to find the correct solution easily. It also closes the item.If the post was useful in other ways, please consider giving it Like.
Kindest regards,
Leon Pavesic
(LinkedIn)- hjan-22Copper Contributor
Hi LeonPavesic ,
I have the below licenses attached to my account:
- MS Teams Phone Standard
- MS 365 Business Standard
- MS Teams Domestic and International Calling Plan (I disabled this because of the same problem VoipJedi is having).
However, when I use PowerShell to assign the number, this is what it gives me:
This is what shows under the Voice > Phone Number:
As it can be seen, the number that I procured from Microsoft while setting up my account is of Calling Plan type which is why I am unable to use it for Direct Routing.
Can you please guide me on how can I make use of a Direct Routing Number for my testing and usage?
Any degree of help will be highly appreciated.
Best Regards,
Hisham