Relay.Calling.PromptAction
Relay.Calling.PromptAction
This object returned from one of asynchronous prompt methods that represents a prompt attempt that is currently active on a call.
Properties
Property | Type | Description |
---|---|---|
result | Relay.Calling.PromptResult | Final result of this prompt. |
state | string | Current state. |
completed | boolean | Whether the prompt attempt has finished. |
payload | dict | Payload sent to Relay to start prompt. |
control_id | string | UUID to identify the prompt. |
Methods
stop
Stop the action immediately.
Parameters
None
Returns
coroutine
- Coroutine that will return a Relay.Calling.StopResult
object.
Examples
Ask user to enter a PIN and force-stop the action after 5 seconds.
import asyncio # to use sleep
action = await call.play_tts_async(text='Welcome to SignalWire!', gender='male')
await asyncio.sleep(5)
await action.stop()
volume
Control the volume of the playback.
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
volume | number | required | Volume value between -40dB and +40dB where 0 is unchanged. |
Returns
coroutine
- Coroutine that will return a Relay.Calling.PromptVolumeResult
object.
Examples
Start the prompt and increase the playback volume.
action = await call.play_tts_async(text='Please, enter your 3 digit PIN.', gender='male')
volume_result = await action.volume(5.0)