record_call
Record call in the background. Unlike the record
method, the record_call
method
will start the recording and continue executing the SWML script while allowing the recording to happen in the background.
To stop call recordings started with record_call
, use the stop_call_record
method.
Name | Type | Default | Description |
---|---|---|---|
record_call Required | object | - | An object that accepts the record_call parameters . |
record_call Parameters
Name | Type | Default | Description |
---|---|---|---|
control_id Optional | string | Auto-generated and saved to record_control_id variable | Identifier for this recording, to use with stop_record_call |
stereo Optional | boolean | false | Whether to record in stereo mode |
format Optional | string | wav | Format ("wav" or "mp3" ) |
direction Optional | string | both | Direction of the audio to record: "speak" for what party says, "listen" for what party hears, "both" for what the party hears and says |
terminators Optional | string | - | String of digits that will stop the recording when pressed |
beep Optional | boolean | false | Whether to play a beep before recording |
input_sensitivity Optional | number | 44.0 | How sensitive the recording voice activity detector is to background noise? A larger value is more sensitive. Allowed values from 0.0 to 100.0 . |
initial_timeout Optional | number | 0 | How long, in seconds, to wait for speech to start? |
end_silence_timeout Optional | number | 0 | How much silence, in seconds, will end the recording? |
Variables
Set by the method:
- record_call_url: (out) the URL of the newly started recording.
- record_call_result: (out)
success
|failed
. - record_control_id: (out) control ID of this recording.
Examples
Start an MP3 recording of the call
- YAML
- JSON
version: 1.0.0
sections:
main:
- record_call:
format: mp3
{
"version": "1.0.0",
"sections": {
"main": [
{
"record_call": {
"format": "mp3"
}
}
]
}
}
Record and play back
Record both sides of the conversation:
- YAML
- JSON
version: 1.0.0
sections:
main:
- record_call:
beep: true
terminators: '#'
- play:
urls:
- 'say:Leave your message now'
- 'silence:10'
- stop_record_call: {}
- play:
urls:
- 'say:Playing back'
- '%{record_call_url}'
{
"version": "1.0.0",
"sections": {
"main": [
{
"record_call": {
"beep": true,
"terminators": "#"
}
},
{
"play": {
"urls": [
"say:Leave your message now",
"silence:10"
]
}
},
{
"stop_record_call": {}
},
{
"play": {
"urls": [
"say:Playing back",
"%{record_call_url}"
]
}
}
]
}
}
Record only the speaker's side
- YAML
- JSON
version: 1.0.0
sections:
main:
- record_call:
beep: true
direction: speak
- play:
urls:
- 'say:Leave your message now'
- 'silence:10'
- stop_record_call: {}
- play:
urls:
- 'say:Playing back'
- '%{record_call_url}'
{
"version": "1.0.0",
"sections": {
"main": [
{
"record_call": {
"beep": true,
"direction": "speak"
}
},
{
"play": {
"urls": [
"say:Leave your message now",
"silence:10"
]
}
},
{
"stop_record_call": {}
},
{
"play": {
"urls": [
"say:Playing back",
"%{record_call_url}"
]
}
}
]
}
}