Is there an API that I can use to stop recording an ongoing call?
We have a feature here where you can record only pieces of a call. So you can click a button to stop recording, and then after some time you can click another button to start recording again.
How can I accomplish that on Twilio? I didn't find anything in their docs.
Twilio developer evangelist here.
There's no direct way to start and stop recording a call, however you could manage this using <Gather> and <Conference>.
The idea would be that callers would join a conference (even if there's just two of them) which recorded their call using the record attribute.
You would wrap that <Conference> in a <Gather> that was waiting for a caller to dial a particular digit which stops recording by redirecting the caller who pressed the digit to a new <Conference> without the record attribute set.
You will also need to redirect the other call to that conference too. When you get the webhook after the first caller pressed a digit to stop recording you can fire off a REST API call to redirect the second caller to the new non-recorded conference.
If you wrap this second <Conference> in a <Gather> too, you can reverse this process to start recording again.
Let me know if that helps at all.
[edit]
As a further consideration, I realised that you indicated you need a user to press a button to start or stop recording. I initially thought of this as a button on your phone, which is why I suggested using <Gather>. If, however, the user in control of recording is an agent in a call centre, for example, you could build an easier interface using Twilio Client to make or receive the calls.
Then, when the calls are connected into the initial conference you'd need to record both the Call SIDs.
You could then implement a button in your interface that when pressed transfers both calls from a recording conference to a non recording conference (or vice versa). Again, this would use the REST API to redirect the calls.
Related
I am working with Twilio Voice JS SDK. Every incoming calls are converted to conferences. I can do this.
If there is a second incoming call, I want a user can answer it.
But if I invoke call.accept(), the first call will disconnect.
So I tried to hold the first call by update ParticipantResource.Update() with hold = true. This doesn't help. I listen hold music from browser and the first call is still active.
Is it possible to answer the 2nd incoming call/conference?
Do Play verb with loop 0 value cause the music to play till the call is connected?
https://www.twilio.com/docs/api/twiml/play
Twilio developer evangelist here.
Effectively in this situation you are looking to put your user in a queue while you dial your agents. This is how you'd do it:
First up, when you receive the incoming call you can respond with <Enqueue> that directs a user into a queue. You can set a waitUrl attribute that allows you to define either a music file or TwiML that will play while the user waits for the call to be answered.
<Response>
<Enqueue waitUrl='/wait-music'>incoming</Enqueue>
</Response>
While your incoming caller is waiting, you can then start making calls to your agents using the REST API. Once an agent connects and accepts the whisper you would then join the calls by dialling the <Queue>.
<Response>
<Dial><Queue>incoming</Queue></Dial>
</Response>
With this method you'd need to maintain whether your user has been answered yet and manually handle whether to redirect their call from the queue to more TwiML to <Record> a voicemail.
There is a more robust way to set all this up. It still requires enqueueing in the first place, but you should take a look at TaskRouter. It's an automated call distribution service with configurable workflows. There's a bit more setup involved on the Twilio side, but TaskRouter will handle directing calls to your agents and allow you to define rules for how to handle a user who's been waiting too long. I recommend you check out the TaskRouter documentation and then take a look at the quickstart guide as an example.
Let me know if that helps at all.
I am using Twilio to create call tracking phone numbers that redirect to another number using the Dial verb. I am also recording these calls. Here is an example of my TWIML
<Response><Dial record="true" action="http://example.com/PostCall">555-555-5555</Dial></Response>
I want to be able to terminate the call recording but not the call using something like the Record verb's finishOnKey option. Is this possible?
The reason is, a call comes in to a call center and is transferred to a lawyer. I want to record the call center part of the call but not the attorney/client part of the call. If pressing # during the call could stop the recording but keep the call active it would solve my problem.
Is there a way to stop recording without terminating the call?
Can the record verb be used in conjunction with the dial verb?
The <Record> TwiML verb is best if you want to record one person talking. I'm assuming you want to record both parties connected via <Dial> in the call center so you would rely on the record attribute as you have above.
Read the FAQ for the full breakdown on the difference in recording settings.
Is there a way to stop recording without terminating the call?
Depending on the flow of your call center you might modify the live call via the REST API and redirect the call to new TwiML where you set recording to "false".
call = client.calls.update("CALL_SID", url="https://example.com/no-record.xml",
method="POST")
Alternatively, you could add Twilio itself as a 3rd call leg in a <Conference> call, and let it handle recording. This way you can use the REST API to modify that leg without disrupting the primary 2 callers, including stopping recording of the call midway through while the other 2 callers are still live.
I'am using twilio to set up a call between 2 people
I'd like to manage call transfer asked from one side (like when a dtmf key is pressed). The other side could listen to a prompt who could be "please wait while your call is being transfered"
Any chance to do that properly with twilio?
When both parties are connected, Twilio blocks execution of further verbs until the caller or called party hangs up. That's why it is not possible in regular way.
But you can hangupOnStar attribute to hangup the caller party. And set an action URL to continue next dial verbs.
Here is a detail answer:
Twilio call transfer from in-call
I can successfully record voice within the browser using Twilio.js lib.
I would like to display a count down timer once the recording begins which happens when the "beep" is played.
Is there any way for the client lib to detect the recording start / beep so that I can start count down timer?
Twilio evangelist here.
There is no way for the client to tell you that a "beep" has occurred. What you could do is at the beginning of the call, prompt the user to press a button on the web page to start recording. That button press can do two things:
send a DTMF tone to Twilio which you can listen for using the <Gather> verb. Once the gather completes you can tell Twilio to start recording.
starts a timer on the client.
The timing between the client and exactly when the client starts won't be 100% in sync, but it should be pretty close.
Hope that helps.