Replace Teams Outbound Caller ID with Resource Account Number

One of the standard PhoneSystem features that Microsoft Teams supports is Caller ID Policies. Masking users direct dials for outbound calls is a pretty common requirement in any organization. Interestingly, when we navigate to the Caller ID Policy, we don’t have a simple option to select a Resource Account number. The use case here, and probably the most common use case, is to mask our outbound calls with the reception number, usually assigned to an Auto Attendant (Check out this article for steps in setting up an Auto Attendant).

For some reason, we still need to set this up via PowerShell. To do this, connect to Microsoft Teams PowerShell, and run the command “Get-CSCallingLineIdentity | fl” to list the Calling Identity Policies in the organization. If there are no custom policies, the you’ll just have the default (Figure 1).

Note: This process requires version 2.3.1 of the Microsoft Teams PowerShell Module

Figure 1: The Default Caller ID Policy

To mask outbound identities, a new policy can be created with the below command:

New-CsCallingLineIdentity  -Identity MaskOutbound -Description "Mask outbound calls with the reception DDI"

The existing policy can also be used if the mask should apply to all users. To set the outbound number to an existing Resource Account, run the commands below, specifying either the newly created policy or the default (Global) policy depending on who you want to target. Make sure to replace “resourceaccount@domain.com with the UPN of the resource account you want to mask with as shown in Figure 2.

$ResourceAccount = Get-CsOnlineApplicationInstance -Identity resourceaccount@domain.com
Set-CsCallingLineIdentity -Identity global -CallingIDSubstitute resource -ResourceAccount $ResourceAccount.ObjectId
Figure 2: Update the Calling ID Policy

If you made the change to a new or custom Calling ID Policy, make sure to apply the policy to your users with the below command:

Grant-CsCallingLineIdentity -Identity "user@domain.com" -PolicyName "Mask Outbound"

Summary

There are a lot of tasks, particularly around Direct Routing that are not possible in the Teams Admin Center so it’s definitely worth getting used to the Teams PowerShell module for this type of thing. The updates to the module have been coming thick and fast lately so make sure to keep it updated too.

14 thoughts on “Replace Teams Outbound Caller ID with Resource Account Number

  1. Yasitha

    Hey Sean,

    Did you have any issues with the -CompanyName attribute for set-cscallinglineidentity? I set up my company name along with the resource account object ID info. I can see the resource account phone and location, but not the name I put as the callerID. Strange…

    Like

  2. Hi,

    thank you for sharing this post.
    I already follow every step you wrote including putting the resource number on Global CallingLineIdentity and set EnableUserOverride to false, but OnpremLineURI from user still gets through. Do these steps apply to Direct Routing, too?

    Best Regards,
    Gabriel

    Like

    1. Gabriel Wishnu

      Nevermind my question. I forgot to set ForwardPAI to $false. Now it is working like a charm.

      Thank you very much

      Like

  3. Christian

    Hi Sean, do you know if it’s possible to use outbound caller id in combination with direct routing? We have the SBC hosted by a third party, so if it is possible to do that, I would be able to set it up for particular users in our organization without having to create a support ticket with them.

    Like

      1. Christian Nagelkerke

        Hi Sean,
        I didn’t notice the typo at first, I got it working now. Thanks for your help!

        Like

  4. Mario Velazquez

    Hi there, I’m using Direct Routing with a third party provider (they manage the SBC) I’m trying to setup the Caller ID for some of our users to a Toll Free Number (i.e. 1888XXXXXXX). I followed the steps and it is working intermittently (Some calls get out without issue but most of them failed with a message saying “The person you’re trying to reach isn’t available”). Have any of you got something like this working with a TFN? One other note: the TFN that we are using is not part of the telco that provides the SBC/Trunk, the TFN belong to us but is with another telco provider so basically we are “spoofing” the TFN. Thanks for any help!

    Like

    1. Generally when you see this it would be a routing issue on the provider. If calls are getting through intermittently then your config is working. One thing to note is that many Telcos are locking down “spoofing” of numbers – particularly across different countries.

      Like

  5. Chuck Martin

    Sean,
    Never mind, Gabriel Wishnu’s suggestion to turn off ForwardPAI (or set to $false if using powers shell) for the SBC configured under Teams Direct Routing did the trick for me as well. My SIP Trunk traffic now contains the Reference account phone number as the from number.

    Like

Leave a comment