Forum Discussion

VoipJedi's avatar
VoipJedi
Copper Contributor
Sep 26, 2023

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

  • 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.

    1. 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.

    1. Regarding the Alternative PowerShell Method

    Some older guidance recommends using:

     

    Set-CsUser -LineUri

     

    This method is outdated for Teams phone number assignment.

    Microsoft now recommends using:

    Set-CsPhoneNumberAssignment

    The parameter:

    -PhoneSystemRoutingPolicyName

    is also not a valid parameter for Set-CsUser in the current Teams PowerShell module and should not be used for this configuration.

    1. Licensing Requirements

    A Microsoft Calling Plan license is not required when using Direct Routing.

    The user requires:

    1. Microsoft Teams Phone, previously known as Phone System
    2. 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.

    1. 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 EnterpriseVoiceEnabled

     

    Also 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.

  • LeonPavesic's avatar
    LeonPavesic
    Silver 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:

    1. Go to the Microsoft Teams admin center.
    2. Click Users > Manage users.
    3. Select the user or users that you want to enable for Direct Routing.
    4. Under Account, click Edit.
    5. Under Assign phone number, select Enable users for Direct Routing.
    6. 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:

    1. Go to the Microsoft Teams admin center.
    2. Click Users > Manage users.
    3. Select the user to whom you want to assign a phone number.
    4. Under Account, click Edit.
    5. Under Assign phone number, select Direct Routing from the Phone number type drop-down menu.
    6. Enter the phone number that you want to assign to the user.
    7. 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:

    1. Open PowerShell as an administrator.
    2. Import the Teams PowerShell module:

     

    Import-Module MicrosoftTeams​

     

    1. Connect to Teams:

     

    Connect-MicrosoftTeams -Credential $credential​

     

    where $credential is a variable that stores your Teams administrator credentials.

    1. Get a list of all users that are enabled for Phone System:

     

    Get-CsOnlineUser | Where-Object { $_.EnterpriseVoiceEnabled -eq $true }​

     

    1. 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.

    1. 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.

    1. Disconnect from Teams:

     

    Disconnect-MicrosoftTeams​

     

    For 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-MicrosoftTeams

     

     

    You 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-22's avatar
      hjan-22
      Copper 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