Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Twilio initiate outbound call that connects agent phone before dialing target number

Tags:

twilio

I want to create a help desk web page in which an agent can click a link to initiate an outbound call to a target number. I understand how to use the Web Client to make that happen, but for an agent who doesn't have bandwidth to support VoIP, I'd like Twilio to call the agent's phone number then dial the target number.

The experience would be much like using Google Voice with Google Chat/Hangout client -- Google Voice calls your number/client, then initiates a call to the target.

Also, if both agent and target phone numbers are domestic landlines, would this scenario incur 2X the per minute landline fees?

I'm not looking for code necessarily, but rather an answer based on Twilio APIs and Twiml concepts.

like image 585
user3079993 Avatar asked Dec 08 '13 14:12

user3079993


People also ask

How do I set up outbound calls on Twilio?

Make an outbound call For any Function using the built-in Twilio Client, the "Add my Twilio Credentials (ACCOUNT_SID) and (AUTH_TOKEN) to ENV" option on the Settings > Environment Variables tab must be enabled. You can use a Function to make a call from your Twilio phone number via Programmable Voice.

How does Twilio call work?

Twilio uses the From parameter (required) to set a phone number or client identifier as the caller ID for your outbound call. If you used a phone number for your To value in your POST request, the From value you specify must also be a phone number.

How can I get call status from Twilio?

You can use the StatusCallbackEvent parameter to get notifications when a call reaches the initiated , ringing , answered and completed states. The StatusCallbackEvent is available for calls created via the REST API as well as outbound TwiML calls that use <Dial><Number>, <Dial><Sip> and <Dial><Client>.


1 Answers

Twilio evangelist here.

Sounds like you are looking to create "Click to Call". Here is some code from our docs that shows how to do this:

https://www.twilio.com/docs/howto/click-to-call

The basics are:

Use the REST API to initiate an outbound call. When that call is answered Twilio is going to make an HTTP request to some URL that you told about in your initial REST request. That URL's job is to return TwiML that contains the <Dial> verb which tells Twilio to dial the second phone number and bridge the two call legs together.

For domestic US calls, the total cost is going to be 4 cents / minute. 2 cents per each leg, since each leg is considered outbound. See Example 4 on this page:

https://www.twilio.com/help/faq/voice/how-much-am-i-charged-for-call-forwarding

Hope that helps.

like image 169
Devin Rader Avatar answered Nov 03 '22 12:11

Devin Rader