Jun 19 2022 11:07 PM - edited Jun 19 2022 11:10 PM
Hi all,
I have been looking and cant find specific help on this subject. Ive seen loads of posts to create new AA's but not really to change an existing one. The scenario is that i want to update the greeting which will be customer facing via a power app. I would be using PowerShell in the backend and this is the code i have so far:
$AutoAttendantID = "1b87d836-ba69-4da5-a6ef-c3874b28353d"
$AutoAttendant = Get-CsAutoAttendant -Identity "$AutoAttendantID"
$content = Get-Content "C:\temp\voice.wav" -Encoding byte -ReadCount 0
$GreetingAudioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "voice.wav" -Content $content
$GreetingAudioFile
$WelcomePrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $GreetingAudioFile
Set-CsAutoAttendant -Identity "$AutoAttendant"
I typically get this kind of response:
But no changes are made to the actual AA. Am i doing something wrong or is what im trying to do not yet supported?
Will it be simpler for my script to delete the existing AA and then create a new one?
Thanks,
David
Jun 20 2022 05:01 AM
Jun 20 2022 03:33 PM
Hi @Andres Gorzelany ,
Thanks for your reply. I had come across both of those articles yesterday so i have adjusted my script but its still not working. First i am running the required version
I have then adjusted my script to the following:
# get the AA details
$attendantName = 'CRED POC AA'
$aa = Get-CsAutoAttendant -NameFilter $attendantName | Where-Object Name -eq $attendantName
# upload audio file
$content = Get-Content "C:\Temp\Voice.wav" -Encoding byte -ReadCount 0
$AudioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "Voice.Wav" -Content $content
$AudioFilePrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $audioFile
# save the config
Set-CsAutoAttendant -Instance $aa
but i get an error
i get a different error if i use identity
i have gone through it and cant see any typo's and i think the code is written correctly as per those articles but it still looks like i have something wrong?
Thanks,
David
Jun 20 2022 04:35 PM
Jun 20 2022 04:51 PM
Jun 20 2022 04:58 PM
So I closed and re-opened PS and now I'm not getting any errors
but no changes are made to the greeting
i would have imagined that it would show something like "voice.wav"
Jun 20 2022 08:42 PM
Solution
This is a quick example i made,
$attendantName = 'AA_BV_01'
$aa = Get-CsAutoAttendant -NameFilter $attendantName | Where-Object Name -eq $attendantName
$content = Get-Content "C:\Message.wav" -Encoding byte -ReadCount 0
$audioFile = Import-CsOnlineAudioFile -ApplicationId "OrgAutoAttendant" -FileName "Message.wav" -Content $content
$greetingPrompt = New-CsAutoAttendantPrompt -AudioFilePrompt $audioFile
$aa.DefaultCallFlow.Greetings=$greetingPrompt
# save the config
Set-CsAutoAttendant -Instance $aa
The key is to save the changes to the $aa object
s
Jun 20 2022 09:29 PM
Jun 27 2022 05:30 PM