Pause Recording
The PauseRecording verb is used to pause a recording that was previously started by a <StartRecording>
verb.
Audio that occurs between a <PauseRecording>
verb and a <ResumeRecording>
verb will not be present in the recording.
The paused period will not be included in the duration of the recording and therefore will not contribute to the recording portion of the bill.
If there is not an ongoing recording at the time of this verb's execution, it has no effect.
Text Content
There is no text content available to be set for the <PauseRecording>
verb.
Attributes
There are no attributes available for the <PauseRecording>
verb.
Webhooks Received
There are no webhooks received after the <PauseRecording>
verb is executed.
Examples
Pause an Active Recording
- XML
- Java
- C#
- Ruby
- NodeJS
- Python
- PHP
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<PauseRecording/>
</Response>
PauseRecording pauseRecording = new PauseRecording();
Response response = new Response()
.with(pauseRecording);
System.out.println(response.toBXML());
PauseRecording pauseRecording = new PauseRecording();
Response response = new Response();
response.Add(pauseRecording);
Console.WriteLine(response.ToBXML());
pause_recording = Bandwidth::Bxml::PauseRecording.new
response = Bandwidth::Bxml::Response.new([pause_recording])
p response.to_bxml
const pauseRecording = new Bxml.PauseRecording();
const response = new Bxml.Response(pauseRecording);
console.log(response.toBxml());
pause_recording = PauseRecording()
response = Response()
response.add_verb(pause_recording)
print(response.to_bxml())
$pauseRecording = new BandwidthLib\Voice\Bxml\PauseRecording();
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($pauseRecording);
echo $response->toBxml();
PauseRecording on Transferred Calls
In this example, only the transfers themselves will be recorded, and the text-to-speech instructing the user will not be present in the recording.
- 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>
<PauseRecording/>
<Gather gatherUrl="https://myapp.com/gatherCallbackBxml" maxDigits="1" firstDigitTimeout="10">
<SpeakSentence voice="kate">Press one if you want to be transferred to another number.</SpeakSentence>
</Gather>
</Response>
BXML Response to the Gather Webhook
<?xml version="1.0" encoding="UTF-8"?>
<Response>
<ResumeRecording/>
<Transfer>
<PhoneNumber>+15554567893</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();
SpeakSentence speakSentenceTransfer = new SpeakSentence("Press one if you want to be transferred to another number.").builder()
.voice(TtsVoice.KATIE)
.build()
StartRecording startRecording = new StartRecording().builder()
.recordingAvailableUrl("https://myapp.com/noBXML")
.build();
PhoneNumber phonenumber = new PhoneNumber("+15554567892");
Transfer transfer = new Transfer().builder()
.destinations(List.of(phonenumber))
.build();
PauseRecording pauseRecording = new PauseRecording();
Gather gather = new Gather().builder()
.gatherUrl("https://gather.url/nextBxml")
.repeatCount(5)
.maxDigits(1)
.children(List.of(speakSentence))
.build();
Gather gather = new Gather().builder()
.gatherUrl("https://myapp.com/gatherCallbackBxml")
.maxDigits(1)
.firstDigitTimeout(10d)
.children(List.of(speakSentenceTransfer))
.build();
Response response = new Response()
.withVerbs(speakSentenceStart, startRecording, transfer, pauseRecording, gather);
System.out.println(response.toBXML());
BXML Response to the Gather Webhook
ResumeRecording resumeRecording = new ResumeRecording();
PhoneNumber phonenumber = new PhoneNumber("+15554567893");
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(resumeRecording, 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 = "+15554567892"
};
Transfer transfer = new Transfer
{
PhoneNumbers = new PhoneNumber[] { phoneNumber }
};
PauseRecording pauseRecording = new PauseRecording();
Gather gather = new Gather
{
GatherUrl = "https://myapp.com/gatherCallbackBxml",
MaxDigits = 1,
FirstDigitTimeout = 10,
SpeakSentence = new SpeakSentence
{
Sentence = "Press one if you want to be transferred to another number.",
Voice = "kate"
}
};
Response response = new Response();
response.Add(speakSentenceStart);
response.Add(startRecording);
response.Add(transfer);
response.Add(pauseRecording);
response.Add(gather);
Console.WriteLine(response.ToBXML());
BXML Response to the Gather Webhook
ResumeRecording resumeRecording = new ResumeRecording();
PhoneNumber phoneNumber = new PhoneNumber
{
Number = "+15554567893"
};
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(resumeRecording);
response.Add(transfer);
response.Add(stop_recording);
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])
pause_recording = Bandwidth::Bxml::PauseRecording.new
speak_sentence_gather = Bandwidth::Bxml::SpeakSentence.new('Press one if you want to be transferred to another number.', {
voice: 'kate'
})
gather = Bandwidth::Bxml::Gather.new([speak_sentence_gather], {
gather_url: 'https://myapp.com/gatherCallbackBxml',
max_digits: 1,
first_digit_timeout: 10
})
response = Bandwidth::Bxml::Response.new([speak_sentence_start, start_recording, transfer, pause_recording, gather])
p response.to_bxml
BXML Response to the Gather Webhook
resume_recording = Bandwidth::Bxml::ResumeRecording.new
phone_number = Bandwidth::Bxml::PhoneNumber.new('+15554567893')
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([resume_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();
const phoneNumber = new Bxml.PhoneNumber('+15554567892');
const transfer = new Bxml.Transfer(undefined, [phoneNumber]);
const pauseRecording = new Bxml.PauseRecording();
const speakSentenceGather = new Bxml.SpeakSentence(
'Press one if you want to be transferred to another number.',
{
voice: 'kate'
}
);
const gather = new Bxml.Gather(
{
gatherUrl: 'https://myapp.com/gatherCallbackBxml',
maxDigits: 1,
firstDigitTimeout: 10
},
[speakSentenceGather]
);
const response = new Bxml.Response([
speakSentenceStart,
startRecording,
transfer,
pauseRecording,
gather
]);
console.log(response.toBxml());
BXML Response to the Gather Webhook
const resumeRecording = new Bxml.ResumeRecording();
const phoneNumber = new Bxml.PhoneNumber('+15554567893');
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([
resumeRecording,
transfer,
stopRecording,
speakSentenceEnd
]);
console.log(response.toBxml());
speak_sentence_start = SpeakSentence(
sentence="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]
)
pause_recording = PauseRecording()
speak_sentence_gather = SpeakSentence(
sentence="Press one if you want to be transferred to another number.",
voice = "kate"
)
gather = Gather(
max_digits=1,
first_digit_timeout=10,
gather_url="https://myapp.com/gatherCallbackBxml",
speak_sentence=speak_sentence_gather
)
response = Response()
response.add_verb(speak_sentence_start)
response.add_verb(start_recording)
response.add_verb(transfer)
response.add_verb(pause_recording)
response.add_verb(gather)
print(response.to_bxml())
BXML Response to the Gather Webhook
resume_recording = ResumeRecording()
phone_number = PhoneNumber(
number="+15554567893"
)
transfer = Transfer(
phone_numbers=[phone_number]
)
stop_recording = StopRecording()
speak_sentence_end = SpeakSentence(
sentence="Thanks for your call. Have a nice day!",
voice="bridget"
)
response = Response()
response.add_verb(resume_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));
$pauseRecording = new BandwidthLib\Voice\Bxml\PauseRecording();
$speakSentenceGather = new BandwidthLib\Voice\Bxml\SpeakSentence("Press one if you want to be transferred to another number.");
$speakSentenceGather->voice("kate");
$gather = new BandwidthLib\Voice\Bxml\Gather();
$gather->gatherUrl("https://myapp.com/gatherCallbackBxml");
$gather->maxDigits(1);
$gather->firstDigitTimeout(10);
$gather->speakSentence($speakSentenceGather);
$response = new BandwidthLib\Voice\Bxml\Response();
$response->addVerb($speakSentenceStart);
$response->addVerb($startRecording);
$response->addVerb($transfer);
$response->addVerb($pauseRecording);
$response->addVerb($gather);
echo $response->toBxml();
BXML Response to the Gather Webhook
$resumeRecording = new BandwidthLib\Voice\Bxml\ResumeRecording();
$phoneNumber = new BandwidthLib\Voice\Bxml\PhoneNumber("+15554567893");
$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($resumeRecording);
$response->addVerb($transfer);
$response->addVerb($stopRecording);
$response->addVerb($speakSentenceEnd);
echo $response->toBxml();