Twilio Call Masking Similar to Uber - parse-platform

I need to use twilio call masking similar to how uber does. I need to grab and available number and attach it to a transaction for a period of time. I got basic TwimXML working to deliver a message but how do I connect two numbers on the fly?
I'm working in iOS and Android with Parse.com serving as a temporary back end. Since these are mobile applications I'm hoping to use the native telephone and messaging applications.
My assumption is that I need to grab a number from the number pool. Assign a forwarding number to it. And return that number to my application in the success block of the promise. Then send that number to the telephone/message app. The part I'm not sure about is how to set up a forwarding number on my Twilio number with the rest api.
Any direction here would be greatly appreciated.

Twilio developer evangelist here.
Your assumptions are mostly correct, but as you point out, you're missing the bit about assigning the forwarding number.
If you've used TwiML to reply to an incoming message you are on the way though.
What you need is an endpoint that you can set as the Voice URL for the number you purchase through Twilio. With that endpoint you need to return TwiML that forwards the call onto the right number. That TwiML would look a bit like this:
<Response>
<Dial>
<Number>ONWARD_NUMBER</Number>
</Dial>
</Response>
In order to return that TwiML, you would need to set up a relationship in your database between the two users' phone numbers and the Twilio phone number such that when you receive a call from one of the numbers to the Twilio number, you can look up the other number in the database and use that in the forwarding TwiML.
That is a brief description of how this is supposed to work. There is a longer description of how to achieve this sort of system in our Masked Phone Numbers tutorial. Sadly the tutorial is not currently available in Node.js, but if you read through the instructions you should be able to follow the flow of the application.
Let me know if this helps at all.

Related

Twilio - How can I tell if a number can receive a text message?

I always relied on the "Carrier type" of "mobile" using the lookups API to determine if a number was able to receive a text message. This as served me well for several years.
I recently came across a lookup result as follows:
CARRIER NAME Enflick - 360 Networks - SVR
CARRIER TYPE voip
It seems this belong to the textnow.com carrier that sells wifi only phone plans that allow texting. Because of this, it seems some "voip" carriers can receive texts.
Is there a way to determine which numbers should be eligible to receive texts using the Twilio lookups API or something similar? I'd hate to consider all voip carriers as texting eligible since that definitely isn't the case.
Twilio developer evangelist here.
I think the easiest way to check if a number can receive texts from Twilio is to try sending one. If the API responds with an error (likely 21612) then you can't send messages to it.

Receiving messages back to my platform

Use Case SMS leaves my platform and goes out to a receiver (SMS). I would like to attach some sort of custom identifier so when the user responds back to the SMS..and my platform received the message..I know how to internally route the response back in my platform.
Any ideas?
Maybe set up a system where when the code is sent out
For instance:
Code - 11832
The user then has to enter this code on your website. A program will then match to see if it's the identical code. So you are then able to log the information
No expert on this though and Where is your code ?
Twilio evangelist here.
There isn't really a great way to attach an identifier to the message itself. You could force the user to prepend/append a code in their reply, but depending on your specific scenario that might not be a great user experience.
Another option is to save the to/from phone number as a unique pair when you send the message. Then as your application receives replies you can check the incoming to/from phone number against what you saved.
Hope that helps.

Can the SMS forwarding number be removed from the reply using Twilio's to forward SMS messages to another phone number?

I want to use Twilio to create an SMS relaying service where the Twilio number is the only number that is exposed, much like web proxy servers that allow you to access the Internet anonymously. I've used the example php code that twilio provides, saved it to a php file and hosted it on a public web server, then updated the messages URL on the Twilio site accordingly. Any message sent to the Twilio number the is forwarded to my mobile. Everything works fine, except for the fact that when I reply to the forwarded message from my phone, the reply includes a header that says "Sent from your Twilio trial account - + mymobilenumber" I understand that the header is inserted because I have a trial account, however I don't want the mymobilenumber field to be exposed. Is it possible to hide this?
I should mention I'm not really a programmer but I'm learning with Twilio.
I followed the example given here:
https://www.twilio.com/help/faq/sms/how-do-i-forward-my-sms-messages-to-another-phone-number
Thx
Antonio
A short code is a 5 or 6-digit number that can send and receive messages with mobile phones. These high-throughput numbers are perfect for apps that need to send messages to lots of users or need to send time sensitive messages. You can buy shortcodes from Twilio or port existing short codes to our platform.

What on earth is this serial-number google is sending me?

I am using the google checkout api to process orders in an online store that i am building.
i ran into an issue today that i cannot move past! oi i am getting such a huge headache from this! So here is the problem:
when i send google an xml-based order, they send me back a grip of information that looks something like this:
<?xml version="1.0" encoding="UTF-8"?>
<checkout-redirect xmlns="http://checkout.google.com/schema/2"
serial-number="981283ea-c324-44bb-a10c-fc3b2eba5707">
<redirect-url>
https://checkout.google.com/view/buy?o=shoppingcart&shoppingcart=8572098456
</redirect-url>
</checkout-redirect>
I have been able to use this in the past, and i have just passed in <merchant-private-data> tags in my order request to specify unique orders. i just use the redirect-url above to send them to a page where they complete their order, and google sends me a notification with a serial-number. I pass back the serial-number along with my merchant_id and merchant_key and they send me back a bunch of xml with my order data.
I have already gotten my application working like this. the problem is that now i am trying to make my application so that you can plug in your google merchant id and key and my application will handle the order processing for you. the problem here is that when they send me the serial number in the notification, I don't know which merchant-key or merchant-id to send back to them. And now we have come full-circle to the basis of my question, which is this:
what is this serial-number that google is sending me??? it is definitely not the serial number that the notification api is sending me (unless i have to decode somehow?). Google gives no explanation in their documentation about this and all of the other questions regarding it can be answered by simply using merchant-private-data tags.
Please somebody! some wizard out there! Please help me!!!
The serial number is only relevant to a specific merchant - based on your post, you can equate this to a "specific callback api url" (in serial number notification).
If/when you ask a merchant to give you their mid/key, you'll have to provide them (merchant) the (unique) url they have to provide to Google.
So the "relationship" will be "mid/key/callback api url".
Hth.

Validate Mobile Number

I want to have a mobile number validate for my site not just string validations ..what i need is to actually validate the mobile number with the same user exists..
one option i know is to send a pin to that mobile number & ask user to put that pin on form submit to validate ...so are there any ready to use services for this to use it on my website or what i have to do for this ...
Also tell if you know any other options available
You could use http://www.twilio.com/ to call the number and have the person respond (press 1 for ok, 0 for not ok) to your call.
But note that calling the number would work if the number was either a land-line or mobile. If you want to make sure that the number is mobile, then SMS is a good idea.
Twilio has an SMS api too.
you can use this service that give you web service that you can use to validate mobile number in any country http://www.data-8.co.uk/integr8/services/mobile_validation.aspx#Demo
Some push agregattors have APIs for HLR-look up, then you could know if number is right and it is active or off, etc.
If it's not super important that someone can fake their confirmation, then you could look at some of the headers received from the network operator containing the user's number: Can a mobile web application access the devices phone number?

Resources