Skip to main content

Relay::Calling::PromptAction

This object returned from the asynchronous prompt! family of methods and is the handle for 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.
payloadHashPayload sent to Relay to start prompt.
controlIdStringUUID to identify the prompt.

Methods​

stop​

Stop the action immediately.

Parameters

None

Returns

Relay::Calling::StopResult - A StopResult object with a successful property.

volume​

Sets the volume for the prompt playback.

Uses a value from -40dB to +40dB where 0 is original audio and -40 is muted. It follows the standard amplitude voltage gain factor: 10 pow (value / 20).

Parameters

ParameterTypeRequiredDescription
settingNumericYesVolume setting

Returns

Relay::Calling::PromptVolumeResult - A PromptVolumeResult object with a successful property.

Examples

Play some prompt and change the volume

prompt_action = call.prompt_audio(initial_timeout: 10, digits_max: 3, digits_timeout: 5, url: 'https://cdn.signalwire.com/default-music/welcome.mp3')

result = prompt_action.volume 20

puts "Volume change was successful" if result.successful