locked
Importing a wav file with powershell as HolydayAction (code not working) RRS feed

  • Question

  • I'm trying to import a wav file to play when a response group hits a holyday that is specified in his holydayset.

            $audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:*****.****.***" -FileName $messageFile[0].Name -Content (Get-Content $messageFile[0].FullName -Encoding byte -ReadCount 0)
            $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile
            $action = New-CsRgsCallAction -Prompt $prompt -Action Terminate
            $workflow.HolidayAction = $action
            Set-CsRgsWorkflow $workflow

    This does seem to import the wav file as I can see it when checking the rgsconfig web page for this workflow. I can download the wav file from the webpage.

    But when I call the workflow with a skype for business client the message isn't played It just terminates the call.

    The strange part is that when I change the "During holidays, process call as follows" through the web interface. It does play the file I uploaded with powershell.

    Tuesday, May 23, 2017 10:43 AM

All replies

  • I'm trying to import a wav file to play when a response group hits a holyday that is specified in his holydayset.

            $audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:*****.****.***" -FileName $messageFile[0].Name -Content (Get-Content $messageFile[0].FullName -Encoding byte -ReadCount 0)
            $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile
            $action = New-CsRgsCallAction -Prompt $prompt -Action Terminate
            $workflow.HolidayAction = $action
            Set-CsRgsWorkflow $workflow

    This does seem to import the wav file as I can see it when checking the rgsconfig web page for this workflow. I can download the wav file from the webpage.

    But when I call the workflow with a skype for business client the message isn't played It just terminates the call.

    The strange part is that when I change the "During holidays, process call as follows" through the web interface. It does play the file I uploaded with powershell.

    Hi,

    There is a bug, you need to add text to speech with empty space  like this " ". Then it works.

    Do it this way:

     $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt " "

    Greetings,

    Erdem


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.


    • Edited by Er-D Tuesday, May 23, 2017 3:39 PM powershell cmdlet
    • Proposed as answer by Alice-Wang Wednesday, May 24, 2017 2:18 AM
    Tuesday, May 23, 2017 3:29 PM
  • I'm trying to import a wav file to play when a response group hits a holyday that is specified in his holydayset.

            $audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:*****.****.***" -FileName $messageFile[0].Name -Content (Get-Content $messageFile[0].FullName -Encoding byte -ReadCount 0)
            $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile
            $action = New-CsRgsCallAction -Prompt $prompt -Action Terminate
            $workflow.HolidayAction = $action
            Set-CsRgsWorkflow $workflow

    This does seem to import the wav file as I can see it when checking the rgsconfig web page for this workflow. I can download the wav file from the webpage.

    But when I call the workflow with a skype for business client the message isn't played It just terminates the call.

    The strange part is that when I change the "During holidays, process call as follows" through the web interface. It does play the file I uploaded with powershell.

    Hi,

    There is a bug, you need to add text to speech with empty space  like this " ". Then it works.

    Do it this way:

     $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt " "

    Greetings,

    Erdem


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.


    Thank you for the answer! This was indeed the problem.

    The technet article on New-CsRgsPrompt confused me since both parameters (AudioFilePrompt  and TextToSpeechPrompt) are marked as optional.



    • Edited by ToinneGuust Wednesday, May 24, 2017 7:37 AM
    Wednesday, May 24, 2017 7:12 AM
  • I'm trying to import a wav file to play when a response group hits a holyday that is specified in his holydayset.

            $audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:*****.****.***" -FileName $messageFile[0].Name -Content (Get-Content $messageFile[0].FullName -Encoding byte -ReadCount 0)
            $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile
            $action = New-CsRgsCallAction -Prompt $prompt -Action Terminate
            $workflow.HolidayAction = $action
            Set-CsRgsWorkflow $workflow

    This does seem to import the wav file as I can see it when checking the rgsconfig web page for this workflow. I can download the wav file from the webpage.

    But when I call the workflow with a skype for business client the message isn't played It just terminates the call.

    The strange part is that when I change the "During holidays, process call as follows" through the web interface. It does play the file I uploaded with powershell.

    Hi,

    There is a bug, you need to add text to speech with empty space  like this " ". Then it works.

    Do it this way:

     $prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt " "

    Greetings,

    Erdem


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.


    Thank you for the answer! This was indeed the problem.

    The technet article on New-CsRgsPrompt confused me since both parameters (AudioFilePrompt  and TextToSpeechPrompt) are marked as optional.



    Your welcome glad that the problem is solved. I know i also encountered this problem before ;)

    Greetings,

    Erdem


    Please mark as helpful if you find my contribution useful or as an answer if it does answer your question. That will encourage me - and others - to take time out to help you.

    Wednesday, May 24, 2017 7:46 AM
  • Hi Toinne,

    You could mark Er-D's reply as an answer, it will help others who has the similar issue.


    Regards,

    Alice Wang


    Please remember to mark the replies as an answers if they help and unmark them if they provide no help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, May 30, 2017 7:11 AM