Auto Attendant and Call Queues with Direct Routing




is there a way to assign direct routing phone numbers to Auto Attendants or Call Queues. That seems to be an obvious function but I have not found any documentation. It always refers to service numbers.


Thank you


109 Replies

@domienxylos: As long as you do not have submenu "Call Queue" and "Auto Attendant" in menu "Voice" in Teams portal, your tenant is not already migrated to the new CQ/AA. Migration of all tenants is ongoing. Just wait, until these two submenus are available and retry then.




They are available but still not working ...




When executing the 'Set-CsOnlineVoiceApplicationInstance' command I  get the error 'The application instance does not have a valid license. I assigned the corresponding resource account an Enterprise E1 license with Phone System add-on.


Anything else I'm missing?


PS> Set-CsOnlineVoiceApplicationInstance -TelephoneNumber +31887769999 -Identity ******@pro****.nl
The application instance does not have a valid license.
+ CategoryInfo : PermissionDenied: (Set-CsOnlineVoiceApplicationInstance:String) [Set-CsOnlineVoiceApplicationInstance], UnauthorizedAccessException
+ FullyQualifiedErrorId : UnAuthorized,Microsoft.Rtc.Management.Hosted.Bvd.SetVoiceAppEndpointCmdlet
+ PSComputerName :



@Remco van Noorloos I am getting the same problem you mention here, unable to assign a direct routing number to a new resource account in teams. The resource account is licensed with E3 and Phone System add-on.


Have you been able to move past it?


@chrisprice Unfortunately not, still getting the same error message.


Exactly the same problem with my tenant, resource account needs a direct dial number and has been licensed with E3 and phone and still the command to assign comes back with license invalid.
Please Microsoft, sort it out !


I found either a solution or a workaround. Instead of using Set-CsOnlineVoiceApplicationInstance, use Set-CsOnlineApplicationInstance -Identity RA_ADDRESS -OnPremLineURI +1xxxxxxxxxx. This worked for me when the Set-CsOnlineVoiceApplicationInstance gave the licensing error.


@SSchumacher_C1 Did you run anything else on-premise (new-cshybridapplicationendpoint) or is your setup a pure online one? Because I was able to run the command but still Teams is replying with a SIP 404 Not Found.


Thanks for your input!


Just want to add that I have had a response from the product group about this (via a really useful MVP guy - Thanks Matt..), this is what was said.

I believe there is an update for the docs to apply a Direct Routing number to the Resource account that should go out soon. The command should be: Set-CsOnlineApplicationInstance -Identity -OnpremPhoneNumber tel:+14250000000

I'm about to test this my side, I'll update the post if it works.


Just a slight modification, the number can't have a "tel" at the front of it. So this just worked for me:

Set-CsOnlineApplicationInstance -Identity -OnpremPhoneNumber "+441234567890"


Hope this is useful.

This is what is configured on my end. First object is a Call Queue which is using a service number and is working, the second object (testdirectrouting) is the number locally that should be terminiating on Teams.

RunspaceId : b4ef4c26-e7bd-xxxx-959f-375e0ba6d8bc
ObjectId : 3cc3dacf-35c2-xxxx-9d76-71bab55eae23
TenantId : 9f9b64e1-xxxx-xxxx-ad52-cb8ff1b99317
UserPrincipalName : hg_e6e3f7e6a1224a80bd06851161a11b7c@xxxxxxx
ApplicationId : 11cd3e2e-fccb-42ad-ad00-878b93575e07
DisplayName : TestCallQueu
PhoneNumber : tel:+32330xxxxx

RunspaceId : b4ef4c26-e7bd-xxxx-959f-375e0ba6d8bc
ObjectId : c71dec49-xxxx-xxxx-8f88-59193de75b79
TenantId : 9f9b64e1-xxxx-xxxx-ad52-cb8ff1b99317
UserPrincipalName : testDirectRouting@xxxxxxxx
ApplicationId : 11cd3e2e-fccb-42ad-ad00-878b93575e07
DisplayName : TestDirectrouting
PhoneNumber : tel:+32147xxxxxx

And indeed no need to add the tel: because otherwise you get an error message stating that you need to include it :D (small bug i guess).

For others the error message you get when adding tel: . So even if the error says add tel: don't do it :)
The input of parameter "tel:+3214xxxxxx" is not in a valid format. Please provide an input with an acceptable format <tel:>+[number]", e.g. tel:+18005551234 or +14251234567.
In this case it was a purely online system. For hybrid you have to create the hybrid application instance and then apply the number.



I have been working with microsoft support, and we have narrowed down that you need to use set-csonlineapplicationinstance (no voice word), and they say you have to wait 24 hours, however i have done this and waited 24 hours, some have started working, whilst others havent.

Did you do anything else?


So I had the resource account already for some time. With the info found here I applied the phonenumber using the cmdlet without the voice part. Then I also created the onprem hybrid application that has now been synced for several hours. Up until now no success.



is this 24 hour wait period, you refer to, from the time you create the Csonlineapplicationinstance? We are working to create an AutoAttendant in hybrid scenario online.


so far have created the resource account online, cannot get phone number assigned to this object. tried with onpremphonenumber parameter suggested, but get an error the parameter does not exist.

RunspaceId        : f6c084ec-xxxx-xxxx-xxxx-866101234bf6
ObjectId          : c85a5500-xxxx-xxxx-xxxx-0482cf072ceb
TenantId          : d888e478-xxxx-xxxx-xxxx-f420a1800268
UserPrincipalName :
ApplicationId     : ce933385-9390-45d1-9512-c8d228074e07
DisplayName       : Huxxxxx - RsAccnt
PhoneNumber       :


and an onpremise cshybridapplicationendpoint object which i was able to get a phone number associated.

Identity               : CN={8e688921-xxxx-xxxx-xxxx-09662e22570d},OU=Accounts - Service,DC=domain,DC=com
ApplicationId          : ce933385-9390-45d1-9512-c8d228074e07
OwnerUrn               : urn:trustedonlineplatformapplication:ce933385-9390-45d1-9512-c8d228074e07
EnterpriseVoiceEnabled : True
Enabled                : True
SipAddress             :
DisplayName            : Huxxxxx - RsAccnt
LineURI                : tel:+125NXXXxxxx


Any thoughts or ideas would be greatly appreciated!

Hi @joe

We may be a little bit more lucky that we are online only, but I am sure I did something else to get it working, I just can’t remember. Make sure you are using the command set-csonlineapplicationinstance and NOT set-csonlineVOICEapplucationinstance



affirmative, tried it both ways unsuccessfully.  will keep plugging away at it.


@Joe Williams I have been burning the candle both ends at this, my life seems to be teams... 


I have just tried one more command that i think i may have applied the other day to the resource account


grant-CsOnlineVoiceRoutingPolicy -Identity **resourceaccountname** -PolicyName **policyname**


I ran something on the other 2 accounts to get them working, but i cannot remember what, so trying to work it out now :(

Looks like it finally allowed me to assign the onpremPhoneNumber parameter. i'll check on the voiceroutingpolicy thing too, good info. thanks!
Making some progress, call is hitting on-prem and attempting to go across edge server, returning a 480 temporarily unavailable at this point though in our Hybrid setup.