Restricting callerID choices in Twilio - twilio

I have a very simple Twilio setup for my company as our phone system. I've one specific problem: at the moment, anyone can use any of the numbers that have been associated with the company on the site for calling out. So Bob might accidentally use Alice's number, and that's unfortunate.
How do I change that? I would like to be able to set it so that each non-administrator user can only use one phone number for calling out, specifically the number associated with their user or device.

You could use subaccounts:
http://www.twilio.com/docs/api/rest/subaccounts
Alternatively, enforce the extra Caller ID logic in your own application and refuse calls if they don't match the correct params.

Related

Associating a Twilio number with a specific Frontline user

I'm trying to figure out how to associate a specific user with a Twilio number, so that when a call/text comes to that number it only goes to that user's Frontline app/account.
I'm writing the callbacks in Node.js, and I guess that I'm a bit confused to as to how to identify the target number (as the quickstart I'm using is more focused on the customerNumber and relationship with a specific worker).
Thank you.
I believe you should set up Custom Routing for this and, instead of using the customer number (the MessageBinding.Address from the webhook parameters) to do the routing as in the quick start, you can use the number the customer sent the message to, which I think is the MessageBinding.ProxyAddress.
Check out all the parameters that are sent to the onConversationRoute webhook URL. You might also want to test and just log out all the available parameters in order to match to the target number.
The best and the only option I see the Call Forwarding for that purpose and using Twilio's inbuilt TwiML Bins.
Complete info:
https://support.twilio.com/hc/en-us/articles/223179908-Setting-Up-Call-Forwarding

Twilio phone call validation public numbers

I am using Twilio for the first time. It is implemented already, but I am trying to solidify the system.
My question is pretty simple. I would like to know if Twilio has integrated protections against trolls entering numbers such as 911-123-4567. I wouldn't want the company to get into troubles because someone decided to have the system make emergency calls on our name.
Otherwise, I could make an array of public numbers, for which, if the number given starts by said numbers, I throw an error.
Which one would be the best practice?
Thanks in advance!
Twilio doesn't have any automated blocks on dialling numbers. You might not want to call emergency numbers, for example, but some applications do.
You could certainly build your own blocklist for numbers you don't want your application to be able to call. Or for more security, your own allowlist.
One other option is verifying that the user owns the phone number that they are submitting, so that you know it is theirs. You could do this by implementing SMS or voice verification calls using the Twilio Verify API. It depends on your use case which of these three methods work with your use-case.

Twilio custom caller ID

On a ride booking app, it is required communication between driver and user.
Now the case, if user A contacts the driver via website or app, call or sms can be achieved via Twilio, we don't want to expose their contact numbers to each other.
If three users A, B and C contacts the driver and driver has no app installed, in fact the driver wants call back and sms reply. How the driver can reach users on Caller ID.
There could be large number of users and we can't buy separate twilio number for each user.
Please advise the solution.
How many users are likely to need to contact each individual driver at any one time? Not many I wouldn't think.
Buy 10 Twilio numbers, assign them incrementally as users call/SMS their driver and save the assignment for user/driver numbers in your database.
If the driver calls/SMS a number in response query the database and route the call/SMS to the user it was assigned to when they called the driver.
Recycle the 1st assignment once the 11th user calls/SMS the driver, rinse and repeat.
Twilio developer evangelist here.
In order to maintain anonymous communications in this way you need as many numbers as the maximum number of relationships one person in your system has. The best explanation of this is in this article on masked text messaging with Twilio (though it applies to calls too).
Your comment on miknik's answer suggests you want to keep these relationships alive forever. This is not the way that most services build out this feature. They normally give a particular length to the relationship, Uber for example will recycle the phone number a number of minutes after a ride ends.
If you are looking for an easier way to manage this kind of number pooling and masking, check out Twilio Proxy, it handles a lot of the logic for you. It is still in developer preview right now, but you can apply for early access.

Twilio: Change caller ID based on number called?

I have two numbers that forward to a single phone, one work number (A), and one personal number (B).
(A) was setup using Twilio to forward to my phone.
Is there anyway to have some sort of caller ID indicator letting me know which number is being called? That way I can distinguish whether the incoming call was for my work or personal number.
Any help would be deeply appreciated.
Thank you,
This depends on how you have it set up.
If you have your office and personal line ring a twilio number you would do something like this
First you would add a verified outbound caller ID with twilio
https://support.twilio.com/hc/en-us/articles/223180048-Adding-a-verified-outbound-caller-ID-with-Twilio
Then you on an inbound call you would grab the id of the number called. It will be listed as the To number.
https://www.twilio.com/docs/api/rest/call
Then when they call the phone you are forwarding it to you would just specify the To number from before as the From number.
https://www.twilio.com/docs/api/rest/making-calls
If you have a different set up or would like to have twilio make an announcement instead of showing that caller ID there are other work arounds for those methods too. Just let me know and I can edit my answer.

How to share a single Twilio number between multiple clients?

I'm creating a twilio service with three actors:
The customer, a person who calls a company
The company, a company who forwards calls to the service-provider
The service-provider (that's us), an entity that services the customer on behalf of the company
Herein lies the catch: The service provider needs to be able to identify the company associated with the customer but it may only use a single phone number. We cannot use multiple phone numbers for cost reasons (the margins are that low). We cannot use the caller id because a single customer may be associated with multiple companies.
I am familiar with Twilio's ForwardedFrom field but as mentioned here it isn't always reliable. In fact, forwarding from my cell-phone carrier results in a null ForwardedFrom field.
How can we (reliably) identify the company who redirected a customer to us without using multiple phone numbers?
You can use the number + extension. http://www.twilio.com/docs/howto/ivrs-extensions
Perhaps you could build a sort of phone tree system, asking the caller the nature of their problem, which would be an indicator of the company their call is related to.
My guess is that you wouldn't want an outright "which company are is your call related to?" question, because that would feel cheap to the customer. So, maybe you could formulate a question or series of questions that wouldn't be overtly asking which company their calling about, but the answer(s) would clearly indicate on the service-provider end which company the call is about.
This could be further whittled down on the service-provider end by doing a company lookup based on the customer's calling number - if it matches a certain company (or set of companies), then that automatically limits the potential company they could be calling about.
Another possibility (if it fits in your use case) is some sort of we'll-call-you setup. Perhaps the customer could text/email requesting a call, and the information they'd provide in the text/email/online-form-submission would indicate the company they wish to speak about (again, you could use questions that aren't overtly "which company do you want a call from?").
Then again, if it's such a low-margin operation, maybe the companies are ok with a phone-tree style call-in number, where the customer needs to select a company they're calling about which is then indicated to the service-provider.
This doesn't seem to be possible at this time (2013). I will keep an eye out for new answers and will accept them if this becomes possible at a later time.
In general, I'd recommend separate numbers per customer but since you say that's not an option, here's another approach:
When the call comes into the Company, that individual leg gets a CallSid which is a unique identifier. When the call is forwarded to the Service Provider, that separate leg also gets a CallSid. Let's call them CallSidOne and CallSidTwo respectively.
If you then query based on CallSidTwo, you'll get back its instance properties as listed here:
http://www.twilio.com/docs/api/rest/call#instance-properties
The key property here is "parent_call_sid" which should be CallSidOne. Therefore, you can connect the two segments together.. then you can query on CallSidOne which gives you the ability to track who called which customer called which customer when.
Does that solve your problem?
~Twilio employee

Resources