Jump to content

Configure Teams Direct Routing: Difference between revisions

From wiki.oeser.name
Udo (talk | contribs)
No edit summary
Udo (talk | contribs)
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
==connect Powershell to Tennant==
[[Category: Microsoft]]
==Connect Powershell to Tenant==


  Install-Module MicrosoftTeams (if not there allready)
  Install-Module -Name PowerShellGet -Force -AllowClobber (if not there allready)
  Import-Module MicrosoftTeams
  Install-Module -Name MicrosoftTeams -Force -AllowClobber (new install)
  $sfbSession = New-CsOnlineSession
  Import-PSSession $sfbSession
  Connect-MicrosoftTeams
  Update-Module MicrosoftTeams


==Configure SBC==
==Configure SBC==
$FormatEnumerationLimit =-1
Get-CsTenant | fl Tenantid,*Domain*
The ''SIPDomain'' field must contain the SBC domain!!
  New-CsOnlinePSTNGateway -Fqdn <SBC FQDN> -SipSignalingPort <SBC SIP Port> -MaxConcurrentSessions <Max Concurrent Sessions the SBC can handle> -Enabled $true -ForwardPai $true
  New-CsOnlinePSTNGateway -Fqdn <SBC FQDN> -SipSignalingPort <SBC SIP Port> -MaxConcurrentSessions <Max Concurrent Sessions the SBC can handle> -Enabled $true -ForwardPai $true


==Enable Users==
==Enable Users==
  Get-CsOnlineUser -Identity "<User name>" | fl RegistrarPool,OnPremLineUriManuallySet,OnPremLineUri,LineUri
  Get-CsOnlineUser -Identity "<User name>" | fl RegistrarPool,OnPremLineUriManuallySet,OnPremLineUri,LineUri
  Set-CsUser -Identity "<User name>" -LineUri $null -EnterpriseVoiceEnabled $False -HostedVoiceMail $False
  Set-CsPhoneNumberAssignment -Identity "<User name>" -EnterpriseVoiceEnabled $true -HostedVoiceMail $true
  Set-CsUser -Identity "<User name>" -EnterpriseVoiceEnabled $true -HostedVoiceMail $true -OnPremLineURI tel:<phone number>
  Set-CsPhoneNumberAssignment -Identity "<User name>" -PhoneNumber <E.164> -PhoneNumberType DirectRouting


==Configure Routing==
==Configure Routing==
  Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="PBX"}
  Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="PBX"}
  New-CsOnlineVoiceRoute -Identity "PBXUnrestricted" -NumberPattern "^(\+d)$" -OnlinePstnGatewayList sbc001.domain.de -Priority 1 -OnlinePstnUsages "PBX"
  New-CsOnlineVoiceRoute -Identity "PBXUnrestricted" -NumberPattern "^(\+\d*)$" -OnlinePstnGatewayList sbc001.domain.de -Priority 1 -OnlinePstnUsages "PBX"
  New-CsOnlineVoiceRoutingPolicy "PBXUnrestricted" -OnlinePstnUsages "PBX"
  New-CsOnlineVoiceRoutingPolicy "PBXUnrestricted" -OnlinePstnUsages "PBX"


==Assign the voice routing policy to a user==
==Assign the voice routing policy to a user==
  Grant-CsOnlineVoiceRoutingPolicy -Identity "User Name" -PolicyName "PBXUnrestricted"
  Grant-CsOnlineVoiceRoutingPolicy -Identity "User Name" -PolicyName "PBXUnrestricted"
==Configure Dial Plan==
First Rule
$x=New-CsVoiceNormalizationRule -parent "DE_STT" -Name Mobile -Description "Short Dial for Mobile" -Pattern '^(777)$' -Translation '+49172123456789' -InMemory
New-CsTenantDialPlan -Identity "DE_STT" -NormalizationRules @{Add=$x}
Next Rule
$x=New-CsVoiceNormalizationRule -parent "DE_STT" -Name 3digit -Description "Dialing with internal 3-digit extension" -Pattern '^(\d{3})$' -Translation '+497116334$1' -InMemory
Set-CsTenantDialPlan -Identity "DE_STT" -NormalizationRules @{Add=$x}
Assign dial plan to user
Grant-CsTenantDialPlan -Identity user@domain -PolicyName "DE-STT"

Latest revision as of 10:54, 4 April 2023

Connect Powershell to Tenant

Install-Module -Name PowerShellGet -Force -AllowClobber (if not there allready)
Install-Module -Name MicrosoftTeams -Force -AllowClobber (new install)

Connect-MicrosoftTeams
Update-Module MicrosoftTeams

Configure SBC

$FormatEnumerationLimit =-1
Get-CsTenant | fl Tenantid,*Domain*

The SIPDomain field must contain the SBC domain!!

New-CsOnlinePSTNGateway -Fqdn <SBC FQDN> -SipSignalingPort <SBC SIP Port> -MaxConcurrentSessions <Max Concurrent Sessions the SBC can handle> -Enabled $true -ForwardPai $true

Enable Users

Get-CsOnlineUser -Identity "<User name>" | fl RegistrarPool,OnPremLineUriManuallySet,OnPremLineUri,LineUri
Set-CsPhoneNumberAssignment -Identity "<User name>" -EnterpriseVoiceEnabled $true -HostedVoiceMail $true 
Set-CsPhoneNumberAssignment -Identity "<User name>" -PhoneNumber <E.164> -PhoneNumberType DirectRouting

Configure Routing

Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="PBX"}
New-CsOnlineVoiceRoute -Identity "PBXUnrestricted" -NumberPattern "^(\+\d*)$" -OnlinePstnGatewayList sbc001.domain.de -Priority 1 -OnlinePstnUsages "PBX"
New-CsOnlineVoiceRoutingPolicy "PBXUnrestricted" -OnlinePstnUsages "PBX"

Assign the voice routing policy to a user

Grant-CsOnlineVoiceRoutingPolicy -Identity "User Name" -PolicyName "PBXUnrestricted"

Configure Dial Plan

First Rule

$x=New-CsVoiceNormalizationRule -parent "DE_STT" -Name Mobile -Description "Short Dial for Mobile" -Pattern '^(777)$' -Translation '+49172123456789' -InMemory
New-CsTenantDialPlan -Identity "DE_STT" -NormalizationRules @{Add=$x}

Next Rule

$x=New-CsVoiceNormalizationRule -parent "DE_STT" -Name 3digit -Description "Dialing with internal 3-digit extension" -Pattern '^(\d{3})$' -Translation '+497116334$1' -InMemory
Set-CsTenantDialPlan -Identity "DE_STT" -NormalizationRules @{Add=$x}

Assign dial plan to user

Grant-CsTenantDialPlan -Identity user@domain -PolicyName "DE-STT"