設定 - 透過 PowerShell 的通話佇列

過去六個月的 [通話佇列 (新功能)

必要條件

  • 確定您擁有租用戶系統管理權限。
  • 本文所述的代理程式、通訊群組清單和 Teams 頻道已建立。
  1. 判斷是否 MicrosoftTeams 已安裝 PowerShell 模組。

    Get-InstalledModule -Name MicrosoftTeams
    

    如果已安裝 PowerShell 模組,命令 MicrosoftTeams 的輸出看起來會類似下列:

    Get-InstalledModule -Name MicrosoftTeams
    
    Version              Name                                Repository           Description
    -------              ----                                ----------           -----------
    7.7.0                MicrosoftTeams                      PSGallery            Microsoft Teams cmdlets module for Windows PowerShell and PowerShell Core....
    

    繼續進行步驟 2。

    如果尚未安裝 PowerShell 模型,請 MicrosoftTeams 繼續進行步驟 3。

  2. 更新 MicrosoftTeams 模組

    Update-Module MicrosoftTeams
    

    繼續前往 案例

  3. 在您的電腦上安裝 MicrosoftTeams PowerShell 模組。

    • 設定電腦以使用 Windows PowerShell

    • 已安裝 MSTeams 模組

      Install-Module -Name MicrosoftTeams -Force -AllowClobber
      
    • 已安裝 Microsoft Graph 模組

      Install-Module -Name Microsoft.Graph -Force -AllowClobber
      

案例

銷售 (使用者和群組)

  • 在自動語音應答後面巢狀:是
  • 通話:僅透過銷售自動語音應答 - 不需要資源帳戶
  • 語言:英語 美國
  • 問候語:無 (來電由銷售自動語音應答)
  • 保留音樂: 播放音訊檔案
    • 檔案名稱:sales-hold-in-queue-music.wav
  • 來電接聽:使用者
    • Bill@contoso.com
    • Mary@contoso.com
  • 來電接聽:群組
    • Sales@contoso.com
  • 會議模式:開啟
  • 路由方式:循環
  • 以目前狀態為基礎的路由:開啟
  • 通話代理程式可以選擇不接聽來電:是
  • 呼叫代理程式警示時間:15
  • 通話溢位處理:200
    • 重新導向至: Adele@contoso.com
  • 通話逾時處理:120 秒
    • 重新導向至: Adele@contoso.com
  • 沒有代理程式處理
    • 套用至所有通話
    • 重新導向至: Adele@contoso.com
  • 回呼:否
  • 服務等級:20 秒
  • 驗證使用者
    • Adele@contoso.com
  • 語音應用程式 原則:銷售
  • 合規性記錄:否
  • 共用通話記錄:是
    • 範本:銷售
  • 自動錄製:否
展開以查看 PowerShell 命令

登入

出現提示時,輸入您的 Teams 系統管理員認證。

$credential = Get-Credential
Connect-MicrosoftTeams -Credential $credential
Connect-MgGraph -Credential $credential

Create Audio Files

d:\\取代為 wav 檔案儲存在電腦上的路徑。

$content = [System.IO.File]::ReadAllBytes('d:\sales-hold-in-queue-music.wav')
$audioFileSalesHoldInQueueMusicID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "sales-hold-in-queue-music.wav" -Content $content).ID

建立共用通話記錄範本

建立通話佇列範本的自動錄製

取得使用者識別碼

$userAdeleID = (Get-CsOnlineUser -Identity "sip:adele@contoso.com").Identity
$userSalesBillID = (Get-CsOnlineUser -Identity "sip:bill@contoso.com").Identity
$userSalesMaryID = (Get-CsOnlineUser -Identity "sip:mary@contoso.com").Identity

取得支援語言清單

Get-CsAutoAttendantSupportedLanguage

建立通話佇列

New-CsCallQueue -Name "Sales" -AgentAlertTime 15 -AllowOptOut $true -MusicOnHoldAudioFileID $audioFileSalesHoldInQueueMusicID -OverflowAction Forward -OverflowActionTarget $userAdeleID -OverflowThreshold 200 -TimeoutAction Forward -TimeoutActionTarget $userAdeleID -TimeoutThreshold 120 -RoutingMethod Attendant -ConferenceMode $true -User @($userSalesBillID, $userSalesMaryID) -LanguageID "en-US"

支援 (Microsoft班次)

  • 在自動語音應答後面巢狀:是 -
  • 通話:透過支援自動語音應答、內部和透過 PSTN - 需要資源帳戶
  • 語言:英國英語
  • 問候語:播放音訊檔案
    • 檔案名稱:support-greeting.wav
  • 保留音樂: 播放音訊檔案
    • 檔案名稱: support-hold-in-queue-music.wav
  • 來電應答:Microsoft 班次支援小組
    • Support@contoso.com
  • 會議模式:開啟
  • 路由方法:最長閒置
  • 以目前狀態為基礎的路由:不適用 – 預設為開啟,因為最長閒置
  • 通話代理程式可以選擇退出接聽來電:否
  • 呼叫代理程式警示時間:15
  • 通話溢位處理:200
    • 重新導向:支援共用語音信箱
      • (support-shared-voicemail-greeting.wav) 播放音訊檔案
      • 已啟用轉譯
  • 通話逾時處理:45 分鐘
    • 重新導向:支援共用語音信箱
      • TTS:“我們很抱歉讓您久等了,現在正在將您的通話轉移到語音信箱。
      • 已啟用轉譯
  • 沒有代理程式處理
  • 回呼:是
  • 服務等級:30 秒
  • 驗證使用者
  • 合規性報告
  • 共用通話記錄
  • 自動錄製
展開以查看 PowerShell 命令

登入

出現提示時,輸入您的 Teams 系統管理員認證。

$credential = Get-Credential
Connect-MicrosoftTeams -Credential $credential
Connect-MgGraph -Credential $credential

建立音訊檔案

d:\\取代為 wav 檔案儲存在電腦上的路徑。

$content1 = [System.IO.File]::ReadAllBytes('d:\support-greeting.wav')
$audioFileSupportGreetingID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-greeting.wav" -Content $content1).ID

$content2 = [System.IO.File]::ReadAllBytes('d:\support-hold-in-queue-music.wav')
$audioFileSupportHoldInQueueMusicID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-hold-in-queue-music.wav" -Content $content2).ID

$content3 = [System.IO.File]::ReadAllBytes('d:\support-shared-voicemail-greeting.wav')
$audioFileSupportSharedVoicemailGreetingID = (Import-CsOnlineAudioFile -ApplicationID HuntGroup -FileName "support-shared-voicemail-greeting.wav" -Content $content3).ID

取得支援小組群組識別碼

$teamSupportID = (Get-Team -DisplayName "Support").GroupID

取得支援語言清單

Get-CsAutoAttendantSupportedLanguage

建立通話佇列

New-CsCallQueue -Name "Support" -AgentAlertTime 15 -AllowOptOut $false -DistributionLists $teamSupportID -WelcomeMusicAudioFileID $audioFileSupportGreetingID -MusicOnHoldAudioFileID $audioFileSupportHoldInQueueMusicID -OverflowAction SharedVoicemail -OverflowActionTarget $teamSupportID -OverflowThreshold 200 -OverflowSharedVoicemailAudioFilePrompt $audioFileSupportSharedVoicemailGreetingID -EnableOverflowSharedVoicemailTranscription $true -TimeoutAction SharedVoicemail -TimeoutActionTarget $teamSupportID -TimeoutThreshold 2700 -TimeoutSharedVoicemailTextToSpeechPrompt "We're sorry to have kept you waiting and are now transferring your call to voicemail." -EnableTimeoutSharedVoicemailTranscription $true -RoutingMethod LongestIdle -ConferenceMode $true -LanguageID "en-US"

取得授權類型

Get-MgSubscribedSku

建立並指派資源帳戶

這裡不需要電話號碼,因為通話佇列是巢狀於自動語音應答後方。

  • ApplicationID
    • 自動語音應答:ce933385-9390-45D1-9512-c8d228074e07
    • 通話佇列: 11cd3e2e-fccb-42ad-ad00-878b93575e07

顯示在後面 (PHONESYSTEM_VIRTUALUSER) 的授權類型必須是 cmdlet 所 Get-MgSubscribedSku 列出的授權類型。

New-CsOnlineApplicationInstance -UserPrincipalName Support-RA@contoso.com -DisplayName "Support" -ApplicationID "11cd3e2e-fccb-42ad-ad00-878b93575e07"

Update-MgUser -UserId "Support-RA@contoso.com" -UsageLocation US

Set-MgUserLicense -UserId "Support-RA@contoso.com" -AddLicenses @(contoso:PHONESYSTEM_VIRTUALUSER) -RemoveLicenses @()

$applicationInstanceID = (Get-CsOnlineUser -Identity "Support-RA@contoso.com").Identity
$callQueueID = (Get-CsCallQueue -NameFilter "Support").Identity

New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceID) -ConfigurationID $callQueueID -ConfigurationType CallQueue

Teams 頻道) (設施

  • 巢狀於自動語音應答後方:否
  • 從 PSTN 直接撥打電話: 沒有 (僅限內部通話)
  • 語言:法語 FR
  • 問候語:無
  • 保留音樂:預設
  • 來電接聽:團隊:設施
  • 來電應答通道:技術支援中心
    • 頻道擁有者: Fred@contoso.com
  • 會議模式:開啟
  • 路由方式:循環
  • 以目前狀態為基礎的路由:開啟
  • 通話代理程式可以選擇退出接聽來電:否
  • 呼叫代理程式警示時間:15
  • 通話溢位處理:200
    • 中斷連線
  • 通話逾時處理:45 分鐘
    • 中斷連線
  • 沒有代理程式處理
  • 回呼:是
  • 服務等級:30 秒
  • 驗證使用者
  • 合規性報告
  • 共用通話記錄
  • 自動錄製
展開以查看 PowerShell 命令

登入

出現提示時,輸入您的 Teams 系統管理員認證。

$credential = Get-Credential
Connect-MicrosoftTeams -Credential $credential
Connect-MgGraph -Credential $credential

取得設施小組群組識別碼

$teamFacilitiesGroupID = (Get-Team -DisplayName "Facilities").GroupID

取得設施支援人員團隊頻道識別碼

Get-TeamChannel -GroupId $teamFacilitiesGroupID
$teamFacilitiesHelpDeskChannelID = "{assign ID from output of above command}"

取得設施支援中心頻道擁有者使用者識別碼

$teamFacilitiesHelpDeskChannelUserID = (Get-TeamChannelUser -GroupId $teamFacilitiesGroupID -DisplayName "Help Desk" -Role Owner).UserId

代理呼叫資源帳戶識別碼

$oboResourceAccountID = (Get-CsOnlineUser -Identity "MainAA-RA@contoso.com").Identity

取得支援語言清單

Get-CsAutoAttendantSupportedLanguage

建立通話佇列

New-CsCallQueue -Name "Facilities" -AgentAlertTime 15 -AllowOptOut $false -ChannelId $teamFacilitiesHelpDeskChannelID -ChannelUserObjectId $teamFacilitiesHelpDeskChannelUserID  -ConferenceMode $true -DistributionList $teamFacilitiesGroupID -LanguageID "fr-FR" -OboResourceAccountIds $oboResourceAccountID -OverflowAction DisconnectWithBusy -OverflowThreshold 200 -RoutingMethod RoundRobin -TimeoutAction Disconnect -TimeoutThreshold 2700 -UseDefaultMusicOnHold $true

取得授權類型

Get-MgSubscribedSku

建立並指派資源帳戶

這裡不需要電話號碼,因為通話佇列是巢狀於自動語音應答後方。

  • ApplicationID
    • 自動語音應答:ce933385-9390-45D1-9512-c8d228074e07
    • 通話佇列: 11cd3e2e-fccb-42ad-ad00-878b93575e07

顯示在後面 (PHONESYSTEM_VIRTUALUSER) 的授權類型必須是 cmdlet 所 Get-MgSubscribedSku 列出的授權類型。

New-CsOnlineApplicationInstance -UserPrincipalName Facilities-RA@contoso.com -DisplayName "Facilities" -ApplicationID "11cd3e2e-fccb-42ad-ad00-878b93575e07"

Update-MgUser -UserId "Facilities-RA@contoso.com" -UsageLocation US

Set-MgUserLicense -UserId "Facilities-RA@contoso.com" -AddLicenses @(contoso:PHONESYSTEM_VIRTUALUSER) -RemoveLicenses @()

$applicationInstanceID = (Get-CsOnlineUser -Identity "Facilities-RA@contoso.com").Identity
$callQueueID = (Get-CsCallQueue -NameFilter "Facilities").Identity

New-CsOnlineApplicationInstanceAssociation -Identities @($applicationInstanceID) -ConfigurationID $callQueueID -ConfigurationType CallQueue

Teams 的規劃:自動語音應答和通話佇列

以下是您使用 Microsoft Teams 電話可取得的功能

透過 cmdlet 建立自動語音應答