PromptAction

View as Markdown

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

PropertyTypeDescription
ControlIDstringThe identifier used to control the operation.
ResultSignalWire.Relay.Calling.PromptResultFinal result of this prompt.
StateSignalWire.Relay.Calling.CallPlayStateCurrent state of the play operation.
CompletedboolWhether the prompt operation has completed.
PlayPayloadList<SignalWire.Relay.Calling.CallMedia>Payload sent to Relay to start playing.
CollectPayloadSignalWire.Relay.Calling.CallCollectPayload 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.

1PromptAction actionPrompt = call.PromptTTSAsync(
2 "Welcome to SignalWire! Please enter your PIN",
3 new CallCollect
4 {
5 InitialTimeout = 10,
6 Digits = new CallCollect.DigitsParams
7 {
8 Max = 4,
9 DigitTimeout = 5,
10 }
11 });
12
13Thread.Sleep(5000);
14
15StopResult resultStop = actionPrompt.Stop();

Volume

Change the volume of the action immediately.

Parameters

ParameterTypeRequiredDescription
volumedoubleThe 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.

1PromptAction actionPrompt = call.PromptTTSAsync(
2 "Welcome to SignalWire! Please enter your PIN",
3 new CallCollect
4 {
5 InitialTimeout = 10,
6 Digits = new CallCollect.DigitsParams
7 {
8 Max = 4,
9 DigitTimeout = 5,
10 }
11 });
12
13Thread.Sleep(1000);
14
15actionPrompt.Volume(4.0);