Forum Discussion
Teams Voice - sending 3 digit numbers to one SBC and everything else to another...
- Mar 17, 2021
Hi solidpro380
So I'm presuming you have your 2 SBC's already setup as CsOnlinePSTNGateways.
If so, then you just need to use Voice Routes. It sounds like you just have 1 voice route which picks up everything .* and sends to SBC1
You just need to add a new voice route putting it a higher priority than your wildcard, The voice route will look something like this:
New-CsOnlineVoiceRoute -Name "ExtensionCalling" -Priority 0 -OnlinePstnUsages "???" -OnlinePstnGatewayList sbc2.contoso.com -NumberPattern '[2-4][0-9][0-9]$' -Description "Extension routing"
This will match anything being called that starts with 2,3 or 4 and then any digit for the next 3 numbers and send to sbc2.
Ensure the OnlinePSTNUsage used is assigned to users in your onlinevoiceroutingpolicy who you want to be able to call those 3 digit extension numbers.
or this:
New-CsOnlineVoiceRoute -Name "ExtensionCalling" -Priority 0 -OnlinePstnUsages "???" -OnlinePstnGatewayList sbc2.contoso.com -NumberPattern '^(\d{3})$' -Description "3 digit extension calling"
This is simpler and just matches a 3 digit number and sends to sbc2. However, be careful with this as you may not want emergency calls.e.g. 112/999 going to sbc2??
What you will what to do is add a new rule into your dial plan as you may find that by calling a 3 digit extension number from Teams is that Teams will add a normalisation rule to it which would then not match your voice route. e.g 234 could turn into +44234
So just add a dial plan normalization rule via Teams Admin Centre, accepting a 3 digit number and passing it through as is. It would look like this in Advanced View
If Condition
^([2-4][0-9][0-9])$
Then do this
$1
Doing this will for example accept 234 from Teams, not change it, will look at your Voice Route and then match the ExtensionCalling route and send 234 to SBC2.
Hope this helps.
^(([2-4][0-9][0-9])|^([5][0-9])|^([7-8]))$
Then do this
$1
using this | is saying this OR this OR this
Would work the same way in your voice routes really. So would look like this:
^(([7-8])|([5][0-9])|([2-4][0-9][0-9]))$ - SBC1
Think that would do it but test it using the test facility in Dial Plans and then something like regexr.com (change flags to multiline)