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?

2 Replies

  • 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 

Resources