Twilio Client Call Routing - twilio

Looking over the Twilio Client setup am I correct in thinking that for each person I want to route a call to that I need to have a TwiML app set up for that person.
That way they each have a unique name to register with to accept inbound calls. Then I am also limited to only haveing 1,000 apps

Twilio evangelist here.
You should only need to have a single TwiML App, but you can dynamically generate the TwiML returned from that apps Voice Request URL with whatever client name you are trying to reach.
Hope that helps.

Related

Twilio Flex Post caller ID's phone number to external webpage

I am setting up a Twilio Flex acct and am wanting when a caller calls and lets say says or presses # 2 I want to ultimately take the callers phone number from the caller id and do a post to an external webpage. I am looking for documentation on this. Anyone have any suggestions?
The Twilio Studio flow I am having issues with it
Twilio developer evangelist here.
By default, incoming calls to a Flex number are directed through a Twilio Studio flow. The default flow passes the caller straight through to get assigned to an agent in Flex, but you can add other widgets to ask for input or direct the call any way you want.
One of the available Studio widgets is the Make HTTP Request widget which allows you to make an HTTP request to a URL of your choice. You can add data to the body of the request using the widget. To get the phone number of the caller you can use the variables set by the inbound trigger. In the case of the phone number of the caller, you need {{trigger.call.From}}.

How to configure Twilio send sms with callback url?

We have a requirement to configure callback URL with a custom parameter.
It's possible to configure the callback http url in Twilio console.
But we have to configure the callback url when we send sms so that when the user replies, twilio will make a call to the specified url mentioned.
Is there any way to configure the callback url programmatically?
Your timely help is much appreciated.
Twilio developer evangelist here.
You can't configure the SMS URL to be different based on different users responding to a Twilio number.
You can, however, direct this within your own system. When Twilio makes the webhook to your application it sends through a bunch of parameters including From, the number that sent you the message.
These parameters are sent as URL encoded parameters in the body of the POST request.
In your application you should be able to use that From parameter to look up your user and then deal with the incoming message for that user.
Let me know if that helps at all.

Twilio Opt-In/Opt-Out API

I am working on an Opt-In /Opt-Out api that integrates with Twilio. The way our Opt-In/Opt-Out works is each company (our customer) signs up for one or more Twilio phone numbers and their customers can opt-in/opt-out into these numbers.
When Twilio receives these opt-in/opt-outs we want Twilio to call us into a webhook URL.
So my question is: how do we register these callback URLs? Do these have to be defined at the time when each company signs up for a phone number? If so whats the API end point for that?
These numbers can be added by different companies at any time. Please advise how to do that. We already have URLs defined for sending and receiving SMS messages with Twilio. In this case we first send the message to Twilio and we specify a callback url in that. Can the Opt-In/Opt-outs work with these already registered end points?
All the phone numbers these companies sing up for are created as a subaccount under us. So is that fine with Twilio and can Twilio call us back on the already registered end points (URLs).
If you have any documentation on how to set up an Opt-In/Opt-Out,please include that. I couldn't find one anywhere. The API method we use for creating subaccounts when companies sign up for a phone number is CreateSubAccount and there is no parameter to specify an call back endpoint URL. I tried contacting their support but they haven't gotten back to us yet.
Twilio developer evangelist here.
I'm not sure exactly what you mean when you say "When Twilio receives these opt-in/opt-outs" as the only thing you will get webhooks for is when a number receives an incoming SMS (or phone call, but we're talking SMS right now).
You can set a different SMS webhook URL per each phone number using the API when you buy the phone number. As part of the POST request to the Incoming Phone Numbers resource you can add the optional parameters SmsUrl and SmsMethod.
Once you have purchased the number, you can also update the webhook URLs for it, by POSTing or PUTing to the instance resource, using the same parameters.
Let me know if this helps at all.

change the voice for twilio number incoming call

We have a twilio number.
When ever any one call on that twilio number then there is an automated voice of twilio play. Can we customize this to a new message?
Thanks,
Rajendra
Twilio developer evangelist here.
You can customise Twilio calls as much as you want! I recommend you take a look through this QuickStart for handling incoming phone calls with Twilio which should get you up and running.
To quickly describe it though, you have a Twilio number and that number has a Voice Request URL configured in the number's settings. When you make a call to that Twilio number, Twilio makes an HTTP request to the URL. That URL needs to return TwiML (a set of instructions to Twilio in XML) which tells Twilio what to do with the call.
If you update the URL to something you control and then return different TwiML, then you can change the message and do a whole lot of other stuff with your Twilio number.

Can you do peer to peer calls with Twilio?

If I wanted to create an interoffice phone system with Twilio can you call between two registered clients on Twilio, i.e. can I call my co-worker in the office across from me?
Bonus prize, if you can do that, can you enqueue the call to the other person, essentially creating a multi-line phone for people?
Thanks!
Twilio evangelist here.
Sure, you can absolutely make a Client to Client call. The Twilio Client for JavaScript Quickstart has a walk-through showing you how to do this:
https://www.twilio.com/docs/quickstart/php/client/browser-to-browser-calls
You can also use the Queue verb in a client-to-client call.
Lets say you want to put Call A (lets call them 'customer') into a queue. To do that you would create a new TwiML App and point it at a URL that returns the <Enqueue> verb. When you initiate that client you would use that TwiML Apps SID to generate the Capability token.
Now for Call B (lets call them 'agent'). If you want to connect them to callers in your Queu, you would create another TwiML app whose URL returns TwiML with the <Dial> verb containing the <Queue> noun. This tells Twilio to connect the 'agent' with the first caller in the queue. As with the 'customer', when you initialize the 'agent', you would use the 'agent' specific TwiML App SID to generate the Capability token.
Hope that helps.
Devin

Resources