Lync Shell Cmdlet New-CsRgsPrompt work not properly

Hi Techies

I'm working on a scheduled powershell script to change a Lync RGS Workflows non bussines hours action more times a day.

Now I discover a problem with the Cmdlet New-CsRgsPrompt. With it I'm not able to set an audio file prompt. When I set a text to speech prompt it work all fine.

http://technet.microsoft.com/en-us/library/gg398486.aspx

I checked the audio.wav file for it's requirements.

http://technet.microsoft.com/en-us/library/gg398649.aspx

 

Here the script I wrote so far:

$y = Get-CsRgsWorkflow -Identity Service:ApplicationServer:lyncserver.domain.com -Name "Lync Workflow"

$musicFile = Get-Content -ReadCount 0 -Encoding Byte "C:\Temp\audio.wav" | Import-CsRgsAudioFile -Identity Service:ApplicationServer:lyncserver.domain.com -FileName "audio.wav"

$prompt = New-CsRgsPrompt -AudioFilePrompt $musicFile

$y.NonBusinessHoursAction = New-CsRgsCallAction -Action Terminate -Prompt $prompt

Set-CsRgsWorkflow -Instance $y

 

Do you have any advice? Is this a bug or am I wrong?


June 10th, 2011 5:36pm

Hi,Kim,

Unfortunately,scipts issue is not in the support scope of this Lync forum,and your issue is more on cmdlets scripts you need post your question to PowerShell forum to get more useful help and advices.

Here is the PowerShell forum

http://social.technet.microsoft.com/Forums/en/winserverpowershell/threads

Regards,

Sharon

Free Windows Admin Tool Kit Click here and download it now
June 14th, 2011 11:03am

Posted a new thread under:

http://social.technet.microsoft.com/Forums/en/winserverpowershell/thread/01faa232-82d2-4b84-9479-6af9f28b20c0

July 8th, 2011 6:21pm

Hi,Kim,

Unfortunately,scipts issue is not in the support scope of this Lync forum,and your issue is more on cmdlets scripts you need post your question to PowerShell forum to get more useful help and advices.

Here is the PowerShell forum

http://social.technet.microsoft.com/Forums/en/winserverpowershell/threads

Regards,

Free Windows Admin Tool Kit Click here and download it now
July 8th, 2011 11:25pm

Hey Kim,

Not sure if this is the problem, but in the call to Get-Content, you should either have the -Path parameter name before the path, or put the path first.

 

Get-Content "C:\Temp\audio.wav" -ReadCount 0 -Encoding Byte

 

or

 

Get-Content -ReadCount 0 -Encoding Byte -Path "C:\temp\audio.wav"

 

Does that fix it?

 

 

July 19th, 2011 1:40am

Hey, Kim. Did you get an error message of any kind when you ran the script? I just tried using those same commands and I managed to get things to work. Or at least they seemed to work according to the ouput I got:

Identity                        : service:ApplicationServer:pool0.vdomain.com/7c5e7af5-b0f7-4b8e-8dfa-c497b255fced
NonBusinessHoursAction : prompt=chimes.wav
                                   : Action=Terminate

If you can give me some more information on what happens when you run a script I'll be happy to look into this for you.

Thanks!

Greg Stemp
Microsoft Lync Server

 

 

Free Windows Admin Tool Kit Click here and download it now
July 19th, 2011 1:46am

Hi Guys,

I can comnfirm that I see the same problem when trying to set the non bussines hours message to an audio file prompt.

When using PS commands to change it - it reflects ok in the "Response Group Configuration Tool" GUI, but I never hear the new message until I actually click "Save" at the "edit workflow" GUI.

I also tried to activate / deactivate the workflow with commands:

$grupp = Get-CsRgsWorkflow service:ApplicationServer:pool01.kressmark.com -Name "MyGroupNumber"
$grupp.Active = $false
Set-CsRgsWorkflow -Instance $grupp
$grupp.Active = $true
Set-CsRgsWorkflow -Instance $grupp

And I tried to restart the RGS service.

Stop-CsWindowsService -Name "RTCRGS"
Start-CsWindowsService -Name "RTCRGS"

But the message will not play until I actually click "Save" at the webpage.

I do not see any error messages when sending the commands or in the GUI.
I do find the following in the eventlog while testing this:
Log Name:      Lync Server
Source:        LS Response Group Service
Event ID:      31117
The workflow runtime encountered a critical error.
Failure occurrences: 5, since 2012-02-29 08:48:25.
The last encountered error was from a workflow with the display name: xxx, the URI: xxx, and the GUID: xxx


Looks like a bug - have anyone reported this as a fault to Microsoft?

/mk

March 2nd, 2012 10:54am

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian

  • Proposed as answer by HsVi Sunday, November 18, 2012 7:30 PM
Free Windows Admin Tool Kit Click here and download it now
November 16th, 2012 10:28am

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian

  • Proposed as answer by HsVi Sunday, November 18, 2012 7:30 PM
November 16th, 2012 10:28am

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian

  • Proposed as answer by HsVi Sunday, November 18, 2012 7:30 PM
Free Windows Admin Tool Kit Click here and download it now
November 16th, 2012 10:28am

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian

November 16th, 2012 1:28pm

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian


I can confirm the same behavior / solution.
Free Windows Admin Tool Kit Click here and download it now
November 18th, 2012 10:32pm

Hi All

I have a case logged with Microsoft and Im awaiting the results of their testing.

However when I ran the Lync Server 2010 Logging Tool I was able to capture a trace while calling a workflow which was configured with (among others) the following powershell command:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile

The trace is as follows:

(00000000002E949B)[7cc61f6e-bd46-19c7-58cd-d4ccaae63216] Handling an exception (System.ArgumentNullException: Value cannot be null.
Parameter name: alternateText
   at Microsoft.Speech.Synthesis.PromptBuilder.AppendAudio(Uri audioFile, String alternateText)
   at Microsoft.Rtc.Acd.Workflow.Activities.BusinessHoursActivity.OnCloseBusinessPromptTurnStarting(Object sender, SpeechTurnStartingEventArgs e)
   at System.Workflow.ComponentModel.Activity.RaiseGenericEvent[T](DependencyProperty dependencyEvent, Object sender, T e)
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.OnTurnStarting()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.StartSpeakAsync()
   at Microsoft.Rtc.Workflow.Activities.SpeechStatementActivity.Execute(ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(T activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutor`1.Execute(Activity activity, ActivityExecutionContext executionContext)
   at System.Workflow.ComponentModel.ActivityExecutorOperation.Run(IWorkflowCoreRuntime workflowCoreRuntime)
   at System.Workflow.Runtime.Scheduler.Run())

It seems that alternateText cannot be null. Next I tried:

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Welcome to the help desk. Please hold."

This works as expected and the audio file is played.  Although not documented it seems you must provide a text to speech string when using -AudioFilePrompt. Under what circumstances the text to speech is played I have no idea.

I came across this thread as I was trying to create an audio prompt for a workflow queue timeout. There are no options for this in the GUI therefore pressing save or confirm was not an option, it can only be done in powershell. Here is the powershell code I used for this:

$audioFile = Import-CsRgsAudioFile -Identity "service:ApplicationServer:poolname.domain.com" -FileName "audio.wav" -Content (Get-Content C:\audio.wav -Encoding byte -ReadCount 0)

$prompt = New-CsRgsPrompt -AudioFilePrompt $audioFile -TextToSpeechPrompt "Sorry we cannot take your call"
$ca = New-CsRgsCallAction -Action TransferToVoiceMailUri -Prompt $prompt -Uri sip:address@domain.com

$q = Get-CsRgsQueue -Identity service:ApplicationServer:poolname.domain.com -Name "Queue Name"
$q.TimeoutAction = $ca
Set-CsRgsQueue $q

Julian

Confirmed as well. Thank you for the Answer! Glad it fixed my holiday message :) 

July 4th, 2013 3:48am

Thanks for the fix!! Experienced same issue in Lync 2013 with latest updates. Did you get any response from your MS support ticket?
Free Windows Admin Tool Kit Click here and download it now
July 19th, 2015 7:16pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics