使用英语阅读

通过


共享通话示例方案

阅读本文之前,请确保已 阅读规划共享通话配置共享呼叫。 这些文章介绍了许可要求、先决条件配置以及如何配置共享呼叫策略。

本文提供了设置共享通话的示例方案。 它为以下步骤提供了 PowerShell 示例:

  1. 获取共享呼叫用户。
  2. 为用户启用语音。
  3. 获取自动助理资源帐户的电话号码。
  4. 根据自动助理的电话号码类型创建紧急呼叫路由策略。
  5. 在资源帐户上设置静态紧急位置。
  6. 创建共享呼叫策略。
  7. 向用户授予共享呼叫策略。

共享调用 PowerShell 示例

# Get the Shared Calling user
$user = Get-CsOnlineUser -Identity user@contoso.com

## Enable voice for the user
Set-CsPhoneNumberAssignment -Identity user@contoso.com -EnterpriseVoiceEnabled $true

## Get the phone number of the Auto attendant resource account
$mainaa = 'main-aa@contoso.com'
$PhoneNumber=Get-CsPhoneNumberAssignment -AssignedPstnTargetId $mainaa

if ($PhoneNumber.NumberType -eq 'DirectRouting') {
    # Define the emergency numbers for emergency calling
    $en1=New-CsTeamsEmergencyNumber -EmergencyDialString 933 -OnlinePSTNUsage WW
    $en2=New-CsTeamsEmergencyNumber -EmergencyDialString 911 -OnlinePSTNUsage WW

    New-CsTeamsEmergencyCallRoutingPolicy -Identity TECRP-DR -EmergencyNumbers @{add=$en1,$en2} -AllowEnhancedEmergencyServices $true

    # Grant the policy to the user
    Grant-CsTeamsEmergencyCallRoutingPolicy -Identity $user -PolicyName TECRP-DR
}

else {
    # Define the emergency numbers for emergency calling
    $en1=New-CsTeamsEmergencyNumber -EmergencyDialString 933
    $en2=New-CsTeamsEmergencyNumber -EmergencyDialString 911

    New-CsTeamsEmergencyCallRoutingPolicy -Identity TECRP-CPOC -EmergencyNumbers @{add=$en1,$en2} -AllowEnhancedEmergencyServices $true

    # Grant the policy to the user
    Grant-CsTeamsEmergencyCallRoutingPolicy -Identity $user -PolicyName TECRP-CPOC
}

# Set the static emergency location on the resource account
$CivicAddress = Get-CsOnlineLisCivicAddress -City Seattle
Set-CsPhoneNumberAssignment -LocationId $CivicAddress.DefaultLocationId -PhoneNumber $PhoneNumber.TelephoneNumber

# Create the Shared Calling policy
$ecbn1 = '+14255556789'
$ecbn2 = '+14255554321'
$ra = Get-CsOnlineUser -Identity $mainaa
New-CsTeamsSharedCallingRoutingPolicy -Identity Seattle -ResourceAccount $ra.Identity -EmergencyNumbers @{add=$ecbn1,$ecbn2}

# Grant the Shared Calling policy to the user
Grant-CsTeamsSharedCallingRoutingPolicy -Identity $user -PolicyName Seattle