Skip to main content

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

PropertyTypeDescription
resultRelay.Calling.PromptResultFinal result of this prompt.
statestringCurrent state.
completedbooleanWhether the prompt attempt has finished.
payloaddictPayload sent to Relay to start prompt.
control_idstringUUID 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

ParameterTypeRequiredDescription
volumenumberrequiredVolume 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)