With Direct Routing your on-premises PSTN provider is connected to Microsoft 365 phone system using a SBC. All the call routing has to be configured using voice routing policies. Therefore, voice routing policy is also needed for Auto Attendants (more specifically the resource account) to route calls externally.
In this scenario, the resource account that is associated with the auto attendant will need to be granted the voice routing policy that routes calls to the desired external number.
Let’s assume the ID of the resource account linked to the Auto Attendant is “AAresource001@tenantxyz.com”.
The voice routing policy to rout calls to external numbers in US is called “US Only”
You will have to run the following powershell command to apply this voice routing policy to the resource account.
Grant-CsOnlineVoiceRoutingPolicy -Identity “AAresource001” -PolicyName “US Only”
After the policy takes into effect, the Auto Attendant will start routing calls to the desired external number.
SBCs can be configured to restrict call routing based on the “source” number. This configuration is done on the SBC side. If after applying the policy, if the routing is still failing then, first thing to do is collect logs from the SBC to determine if SBC is blocking this call from routing to external number. One scenario, is that, SBC might be checking the PAI header to make sure it is within its allowed list of numbers that can route a call to external numbers. In that case, make sure, PAI header is getting populated correctly with the Auto Attendant resource account number – this is also a SBC configuration.