Start Recording
The StartRecording verb allows a segment of a call or conference to be recorded while other verbs are executing.
When used on a call, all audio on both sides of the call will be recorded. When used on a conference, all members who are not on mute or hold will be recorded, as well as all audio clips played. The recording will continue until the call or conference ends, the <StopRecording>
verb is used, or the <PauseRecording>
verb is used.
- For use cases like voice mail system and conference member introduction, you might want to take a look at Record.
- For a more detailed view of Recording, check the Recording Guide.
Text Content
There is no text content available to be set for the <StartRecording>
verb.
Attributes
Attribute | Description |
---|---|
recordingAvailableUrl | (optional) URL to send the Recording Available event (or Conference Recording Available event if recording a conference/) to once it has been processed. Does not accept BXML. May be a relative URL. |
recordingAvailableMethod | (optional) The HTTP method to use for the request to recordingAvailableUrl . GET or POST. Default value is POST. |
transcribe | (optional) A boolean value to indicate that recording should be transcribed. Transcription can succeed only for recordings of length greater than 500 milliseconds and less than 4 hours. Default is false .Note: conferences may not be transcribed. This option will be silently ignored if set on a conference recording, and no callback will be sent. |
detectLanguage | (optional) A boolean value to indicate that the recording may not be in English, and the transcription service will need to detect the dominant language the recording is in and transcribe accordingly. Current supported languages are English, French, and Spanish. If transcribe is not set to true , this flag is ignored. Default is false . |
transcriptionAvailableUrl | (optional) URL to send the Transcription Available event to once it has been processed. Does not accept BXML. May be a relative URL. |
transcriptionAvailableMethod | (optional) The HTTP method to use for the request to transcriptionAvailableUrl . GET or POST. Default value is POST. |
username | (optional) The username to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl . If specified, the URLs must be TLS-encrypted (i.e., https ). |
password | (optional) The password to send in the HTTP request to recordingAvailableUrl or transcriptionAvailableUrl . If specified, the URLs must be TLS-encrypted (i.e., https ). |
tag | (optional) A custom string that will be sent with this and all future callbacks unless overwritten by a future tag attribute or cleared.May be cleared by setting tag="" Max length 256 characters. Note: this option will be silently ignored if set on a conference recording, and the tag associated with the conference (if any) will be sent. |
fileFormat | (optional) The audio format that the recording will be saved as: mp3 or wav . Default value is wav . |
multiChannel | (optional) A boolean value indicating whether or not the recording file should separate each side of the call into its own audio channel. Default value is false .Note: this option will be silently ignored if set on a conference recording; only single-channel recordings are allowed on conferences. |
recordingName | (optional) A name to identify this recording. It will be returned in the Recording Available or Conference Recording Available event if specified. |
If the recordingAvailableUrl
attribute is specified, then the Recording Available or Conference Recording Available event is sent to the URL once the recording is available for download, indicating the mediaUrl
and if there was any issue processing the recording. BXML returned in response to this callback will be ignored.
If the transcriptionAvailableUrl
attribute is specified for a call recording, then the Transcription Available event is sent to the URL once the transcription is available for download. BXML returned in response to this callback will be ignored. Note that this attribute will be silently ignored if recording a conference.
If the multiChannel
attribute is true
on a call recording, then the resulting recording will have 2 audio channels. Note that this option is ignored on conference recordings.
The caller/called party will be recorded in channel 0 (left channel) while <PlayAudio>
and <SpeakSentence>
will be recorded in channel 1 (right channel).
During a <Transfer>
the A-leg will be recorded in channel 0 (left channel) while the B-leg will be recorded in channel 1 (right channel/).
Only one <StartRecording> verb may be active at a time. If a second <StartRecording> verb is used without first using a <StopRecording> verb, the second <StartRecording> will be ignored.
Webhooks Received
Webhooks | Can reply with more BXML |
---|---|
Conference Recording Available | No |
Recording Available | No |
Transcription Available | No |
Examples
Record a Transferred Call
- XML
- Java
- C#
- Ruby
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<SpeakSentence voice="bridget">This call is being recorded. Please wait while we transfer you.</SpeakSentence>
<StartRecording recordingAvailableUrl="https://myapp.com/noBXML"/>
<Transfer>
<PhoneNumber>+15554567892</PhoneNumber>
</Transfer>
<StopRecording/>
<SpeakSentence voice="bridget">Thanks for your call. Have a nice day!</SpeakSentence>
</Response>
SpeakSentence speakSentenceStart = new SpeakSentence("This call is being recorded. Please wait while we transfer you.").builder()
.voice(TtsVoice.BRIDGET)
.build();
StartRecording startRecording = new StartRecording().builder()
.recordingAvailableUrl("https://myapp.com/noBXML")
.build();
PhoneNumber phonenumber = new PhoneNumber("+11234567892");
Transfer transfer = new Transfer().builder()
.destinations(List.of(phonenumber))
.build();
StopRecording stopRecording = new StopRecording();
SpeakSentence speakSentenceEnd = new SpeakSentence("Thanks for your call. Have a nice day!").builder()
.voice(TtsVoice.BRIDGET)
.build();
Response response = new Response()
.withVerbs(speakSentenceStart, startRecording, transfer, stopRecording, speakSentenceEnd);
System.out.println(response.toBXML());
SpeakSentence speakSentenceStart = new SpeakSentence
{
Sentence = "This call is being recorded. Please wait while we transfer you.",
Voice = "bridget"
};
StartRecording startRecording = new StartRecording
{
RecordingAvailableUrl = "https://myapp.com/noBXML"
};
PhoneNumber phoneNumber = new PhoneNumber
{
Number = "+11234567892"
};
Transfer transfer = new Transfer
{
PhoneNumbers = new PhoneNumber[] { phoneNumber }
};
StopRecording stopRecording = new StopRecording();
SpeakSentence speakSentenceEnd = new SpeakSentence
{
Sentence = "Thanks for your call. Have a nice day!",
Voice = "bridget"
};
Response response = new Response();
response.Add(speakSentenceStart);
response.Add(startRecording);
response.Add(transfer);
response.Add(stopRecording);
response.Add(speakSentenceEnd);
Console.WriteLine(response.ToBXML());
speak_sentence_start = Bandwidth::Bxml::SpeakSentence.new('This call is being recorded. Please wait while we transfer you.', {
voice: 'bridget'
})
start_recording = Bandwidth::Bxml::StartRecording.new({ recording_available_url: 'https://myapp.com/noBXML' })
phone_number = Bandwidth::Bxml::PhoneNumber.new('+15554567892')
transfer = Bandwidth::Bxml::Transfer.new([phone_number])
stop_recording = Bandwidth::Bxml::StopRecording.new
speak_sentence_end = Bandwidth::Bxml::SpeakSentence.new('Thanks for your call. Have a nice day!', { voice: 'bridget' })
response = Bandwidth::Bxml::Response.new([
speak_sentence_start,
start_recording,
transfer,
stop_recording,
speak_sentence_end
])
p response.to_bxml
const speakSentenceStart = new Bxml.SpeakSentence(
'This call is being recorded. Please wait while we transfer you.',
{
voice: 'bridget'
}
);
const startRecording = new Bxml.StartRecording({
recordingAvailableUrl: 'https://myapp.com/noBXML'
});
const phoneNumber = new Bxml.PhoneNumber('+19195551234');
const transfer = new Bxml.Transfer(undefined, [phoneNumber]);
const stopRecording = new Bxml.StopRecording();
const speakSentenceEnd = new Bxml.SpeakSentence(
'Thanks for your call. Have a nice day!',
{
voice: 'bridget'
}
);
const response = new Bxml.Response([
speakSentenceStart,
startRecording,
transfer,
stopRecording,
speakSentenceEnd
]);
console.log(response.toBxml());
speak_sentence_start = SpeakSentence(
text="This call is being recorded. Please wait while we transfer you.",
voice="bridget"
)
start_recording = StartRecording(
recording_available_url="https://myapp.com/noBXML"
)
phone_number = PhoneNumber(
number="+15554567892"
)
transfer = Transfer(
phone_numbers=[phone_number]
)
stop_recording = StopRecording()
speak_sentence_end = SpeakSentence(
text="Thanks for your call. Have a nice day!",
voice="bridget"
)
response = Response()
response.add_verb(speak_sentence_start)
response.add_verb(start_recording)
response.add_verb(transfer)
response.add_verb(stop_recording)
response.add_verb(speak_sentence_end)
print(response.to_bxml())
$speakSentenceStart = new BandwidthLib\Voice\Bxml\SpeakSentence("This call is being recorded. Please wait while we transfer you.");
$speakSentenceStart->voice("bridget");
$startRecording = new BandwidthLib\Voice\Bxml\StartRecording();
$startRecording->recordingAvailableUrl("https://myapp.com/noBXML");
$phoneNumber = new BandwidthLib\Voice\Bxml\PhoneNumber("+15554567892");
$transfer = new BandwidthLib\Voice\Bxml\Transfer();
$transfer->phoneNumbers(array($phoneNumber));
$stopRecording = new BandwidthLib\Voice\Bxml\StopRecording();
$speakSentenceEnd = new BandwidthLib\Voice\Bxml\SpeakSentence("Thanks for your call. Have a nice day!");
$speakSentenceEnd->voice("bridget");
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($speakSentenceStart);
$response->addVerb($startRecording);
$response->addVerb($transfer);
$response->addVerb($stopRecording);
$response->addVerb($speakSentenceEnd);
echo $response->toBxml();