SignalWire.Relay.Calling.PromptAction
This object returned from one of asynchronous Prompt
methods that represent a prompt operation that is currently active on a call.
Properties
Property | Type | Description |
---|---|---|
ControlID | string | The identifier used to control the operation. |
Result | SignalWire.Relay.Calling.PromptResult | Final result of this prompt. |
State | SignalWire.Relay.Calling.CallPlayState | Current state of the play operation. |
Completed | bool | Whether the prompt operation has completed. |
PlayPayload | List<SignalWire.Relay.Calling.CallMedia > | Payload sent to Relay to start playing. |
CollectPayload | SignalWire.Relay.Calling.CallCollect | Payload sent to Relay to collect input. |
Methods
Stop
Stop the action immediately.
Parameters
None
Returns
SignalWire.Relay.Calling.StopResult
- The result object to interact with.
Examples
Ask user to enter a PIN and stop the action after 5 seconds.
PromptAction actionPrompt = call.PromptTTSAsync(
"Welcome to SignalWire! Please enter your PIN",
new CallCollect
{
InitialTimeout = 10,
Digits = new CallCollect.DigitsParams
{
Max = 4,
DigitTimeout = 5,
}
});
Thread.Sleep(5000);
StopResult resultStop = actionPrompt.Stop();
Volume
Change the volume of the action immediately.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
volume | double | The volume from -40dB to +40dB where 0 is unchanged. |
Returns
SignalWire.Relay.Calling.PromptVolumeResult
- The result object to interact with.
Examples
Ask user to enter a PIN and change the volume after 1 second.
PromptAction actionPrompt = call.PromptTTSAsync(
"Welcome to SignalWire! Please enter your PIN",
new CallCollect
{
InitialTimeout = 10,
Digits = new CallCollect.DigitsParams
{
Max = 4,
DigitTimeout = 5,
}
});
Thread.Sleep(1000);
actionPrompt.Volume(4.0);