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
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 | Hash | Payload sent to Relay to start prompt. |
controlId | String | UUID 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
Parameter | Type | Required | Description |
---|---|---|---|
setting | Numeric | Yes | Volume 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