How to change caller id during call in twilio - twilio

I have 2 phone numbers registered as caller ids in my twilio account.
Is is possible to change the caller id during call. Lets say i am using Phone 1 as a caller id but during call if user presses 1 he will be connected to other user. But Before connecting to other user i want that Phone 2 works as caller id.
Is it possible? Please help

Twilio evangelist here.
Based on your description of the workflow, I believe this is possible.
I assume you are using <Gather> to listen for Caller1 to indicate he wants to be connected to another call. If thats the case, in the URL thats requested once Caller1 had pressed one, you're going to return some TwiML that includes the <Dial> verb to tell Twilio to dial Caller2 and bridge them with Caller1. The <Dial> verb has a callerID attribute that you can set to one of your verified caller ID's, and that is what will be shown to Caller2 when Twilio rings them.
https://www.twilio.com/docs/voice/twiml/dial#dial-attributes
Hope that helps.

Related

Twilio conference call participants can able to see other participants numbers or not?

I am trying to integrate Twilio call and conference call, before that I have few doubts on it.
While conference call time one participants can able to see other participants real numbers or not? If possible, how to restrict that?
Twilio developer evangelist here.
With a conference call, your participants will only see one number, the Twilio number that they called or that you make calls from.
With regular calls, you have the option to set a callerId when you forward a call. If you don't set this, then the incoming caller ID is used and the number will be shared with the person being called. If you set the callerId to a Twilio number, then the person being called will only see the Twilio number.
If you are looking to build masked number/anonymous communications, then I recommend you take a look at Twilio Proxy which can handle all of this for you too.

Twilio Mobile to Mobile Call

I am new to Twilio and I need some help on a specific scenario. I have been trying to find a solution for this for some time, but I haven't been able to do so.
I want to use a Twilio number from one mobile (A) to call another user on mobile (B). I want to do this in a manner where the call is initiated by the Twilio number and not by (A)'s phone number.
In other words, (A) dials a Twilio number from a mobile and Twilio in turn dials (B) and connects (B) with (A).
I have configured the Twilio phone number dialed by (A) to used a Twiml bin and I have used the Dial verb to dial (B) upon receiving the call from (A).
But the Dial verb adds user (B) to the call. USer (B) does not see the call coming from the Twilio number but from User (A). This is not what I was hoping to achieve.
First of all, I hope I have been able to explain the scenario properly.
IS the scenario possible?
IS it possible for me to get Twilio to dial another user's number when it receives a call from a user? (without using the dial verb in Twiml).
IS there any solution in the API?
Let me know your thoughts. Also, please feel free to ask for any clarifications
Yes it's possible, you just need to supply a callerId parameter in your TwiML. Without one then Twilio will just use the incoming callers number as the caller ID, as you are currently experiencing.
You can use any Twilio number you have purchased or any number you have verified as the displayed caller ID. Your TwiML dial verb should look like this:
<Dial callerId="+15551231234">
<Number>+1555555555</Number>
</Dial>

Twilio: Dial out from conference

I have an incoming phone call that is waiting in a conference. While they are waiting, our application looks for an appropriate rep based on some business logic to connect to them too. If we are unable to find a rep, we would like to forward the call to a general number. It's possible that this number will dial to voicemail.
Normally, I would dial out, and when the phone is picked up I would connect the call to the conference. The issue with that workflow is the person in the conference will not hear the call being dialed out, and it also presents challenges with voicemails (I need the inbound call to know if they are leaving a voicemail).
How can I either remove the inbound caller from the conference and dial out to the generic number, or call out from the conference?
I found from here: https://twilio.radicalskills.com/projects/conference-calling-voice/3.html (under "modify live calls") that using the original call Sid you should be able to remove them and send new twiml instructions. Whoopie!
edit: I was asked to expand on my answer. Here is what I'm doing:
The caller is already waiting in a conference, I need to "remove" them and dial out.
Using the Rest API I send a Redirect to the original call sid of the call that was put into a conference.
The Redirect url returns a twiml dial app to the number I want the original call to be connected to.
That's it :)

"Press 1 at any time" in Twilio

I'm trying to make a Twilio workflow that allows for a user to press 1 at any time to cancel out (as long as a <Dial> hasn't connected yet) and leave a voicemail instead. The TwiML documentation offers a <Gather> option, but this is for a specific time and it supposedly won't let me run a <Dial> command during a <Gather>. Is there a trick to getting this to work?
Twilio evangelist here.
You should be able to Dial another number after gathering input.
<Gather action="[your_gather_processing_url]">
When the <Gather> completes (eg the user presses one), then Twilio will make a request for the URL you've set in the action parameter. In there you can use <Dial> to connect to another number.
It sounds like what you want to do is have Twilio <Gather> for input while the <Dial> is ringing. I believe in that case you are correct, thats something we cannot do today.
One option might be to use <Dial>s timeout property to set a finite limit on the length of time Twilio will wait for the call to be answered (its 30 seconds by default), and then in the action URL, check the DialCallStatus to see if the call was not-answered and send to voicemail when appropriate.
Hope that helps.

Use incoming caller ID on Twilio to make outgoing call

I'm wondering if the following is possible:
Caller rings Twilio number which gets answered and then automated message is played.
Caller is placed in a queue
In parallel to this, our system dials a number (using the rest API) showing the caller id of the incoming call, plays a gather to verify the user wants to pick up, and then connects the call.
I know that the easiest way to achieve something similar to this is to redirect the incoming call with a Dial verb, but for reasons that aren't really relevant to the question that isn't possible.
Twilio evangelist here.
Yes, this is possible, with the caveat that the initial callers phone number must be previously verified with Twilio. See this topic in the help center:
http://www.twilio.com/help/faq/voice/can-i-use-a-non-twilio-number-as-the-caller-id-for-outgoing-calls
Hope that helps.
Devin

Resources