Incoming Call Recording in Twilio with HOLD option - twilio

Suppose for an incoming call to a Twilio Number '+18XXXXXXXXXX' the call is forwarded to a client with name 'CLIENT'. Now there are two legs with Callsids 'CSid1' and 'CSid2'.
If the 'CLIENT' wants to hold the call, the Connection leg with Callsid 'CSid1' is redirected to a Music url. If the 'CLIENT' resumes the call, the call 'CSid1' is again redirected to the 'CLIENT' with new CallSid 'CSid3'.
Now, how to get the single recording url for the whole Incoming call (connection with CallSid 'CSid1').
Note: The recording url for connection with callsid 'CSid2' and 'CSid3' can be obtained by setting record verb in dial tag (Two recording urls).
Any other suggestions to achieve Incoming Call recording in Twilio with hold option is also welcome.

Twilio developer evangelist here.
If you want to record the whole call in one recording, including holds, then you may want to investigate using a <Conference>.
Once your original caller dials in, put them into a <Conference>, using <Dial> with the record attribute set. At the same time, use the REST API to make a phone call to the client which also lands them in the conference.
You can then use the Participants resource to hold and unhold the caller.
This would not redirect the caller, therefore giving you one recording URL.
Let me know if this helps.

Related

How to handle issue with connecting participants in a twilio conference?

Generally when I do direct call via <Dial><Number> Twiml, I used to listen the ringing and network message if the caller is busy or not answering or switched off. Maybe that's because I had used answerOnBridge=true?
Now I am starting a call from web client, putting myself in a conference, then creates a REST call to the caller. At that time, I only get to listen the wait music of the conference since I am alone in the conference. Nothing happens when the caller doesn't pickup or hang up without answering, it just keeps playing the music. I am using REST call with url to link the conference but that only happens when the user picks up.
return client.calls
.create({
from: from,
to: to,
url: callbackUrl,
statusCallback: 'https://xx.m.pipedream.net/',
statusCallbackEvent: ['initiated',
'ringing', 'answered',
'completed']
});
I know I can use the statusCallback to get the status and broadcast a message probably, but is there any other way to make this feel more natural and get the real network message that we usually get when we call via cellphone? Thanks!
Note: I have intention to add or transfer to users, so I need to use conference.
Don't use the /Call resource, use the conference participants end-point (Create A Participant) to be able to listen to the call progress tones (earlyMedia).

Twilio conferenceSid from callSid

I have been using Twilio with a node and Angular project to build a call centre. All the incoming and outgoing calls are made to conference call to make it easy to add participants for transfer call etc.
In the Angular project, I have been using Twilio device to initialise a connection to accepts calls. The parameters that I always receive from the clinet are from, to, callSid and accountSid. I need to find the conferenceSid to add a participant to the call. Is there a way I can get the conferenceSid with just the callSid?
You can use conference eventing to capture the ConferenceSID the participants are joining. However, not clear on the call flow of how your are connecting participants into the conference.
TwiML™ Voice: Conference - statusCallbackEvent

Twilio call forwarding from caller to third party number

I want to ask if it's possible to forward call not from called side but from caller? For example, first user calls to second user. Second user picks up. Then system (or second user) automatically (or on button click somewhere) calls to third user and the first user hangs up the call so when third user picks up then there are second user and third user on the call?
Thanks.
I was able to forward call from called user to thid party but the common user was caller. For example it's described here - https://www.twilio.com/docs/voice/tutorials/call-forwarding-nodejs-express but it's not what I need. I want to forward call from caller not from called user.
Twilio developer evangelist here.
This seems like something you could achieve using a <Conference>. You could have the first user dial a Twilio number that dropped them into a conference call with the following TwiML
<Response>
<Dial hangupOnStar="true" action="/dial-next-user">
<Conference>Forwarder</Conference>
</Dial>
</Response>
This would set the initial caller to listen to hold music. You could then initiate an outbound call with the REST API to caller 2 by creating a participant for the conference. This will dial the user into the conference too.
Now, to get caller 1 to hangup and connect to caller 3. Notice I included hangupOnStar="true" to the <Dial>. This would allow caller 1 to press * and leave the call. When they do that Twilio will make a webhook to the URL defined by the action attribute. You can then respond to that request by dialling in caller 3 using the same participants API and thus achieving connecting caller 1 to 2 and then 2 to 3.
Let me know if that helps at all.

Use Record and Dial together in Twilio API

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.

how to handle call transfer with twilio?

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

Resources