1
votes

How can I make a php script that start conversation between sender and receiver without knowing their actual phone numbers.

I believe twilio have this service according to this https://www.twilio.com/help/faq/sms/how-can-i-have-users-send-text-messages-to-each-other-over-twilio

but i don't know what step should I follow to implement it, i didn't get any step wise tutorial to accomplish it.

Does anyone knows how can it be implemented through php?

Thanks

1
Hey, Twilio employee here. Without their actual phone numbers, it is impossible to send an SMS message to them. You need to provide a way for your users to give you their phone number of their mobile phone. If you are considering using Twilio Client (twilio.com/client) which is a VOIP client for browsers, that does not require phonenumbers. - phalt
Thanks for reply, but according to link twilio says that two users can communicate without sharing their real numbers by purchasing a twilio number. In my case, first time a user will send text by using a link in website(php) that goes to another user and if that user reply back then it should go to the mobile of orignal user which uses website link and can reply back too, so it should start a conversation now. - user3477624
Ah ha, I see. Yes that's perfectly possible and exactly how AirBnB uses Twilio. I assumed you wanted to contact a person's phone without prior knowledge of their phone number. Let me write up an answer for you. - phalt

1 Answers

2
votes

Yes, this is possible and very easy to implement in any language.

Because Twilio is a "toolbox" API, you build the logic with the "tools" to provide communication between the two partners, using the Twilio phone number as the intermediary, thus keeping each partner's number private.

Assuming you already know both the phone numbers that you want to connect:

  1. An SMS arrives from one phone number to your Twilio number.
  2. You perform a database lookup to see which phone number needs to receive the message.
  3. You create a new SMS with the Twilio REST API to the receiving phone number, from the Twilio phone number.

This exact procedure works both ways. You can also replace SMS for voice.

I've deliberately not written this in code as I believe an explanation of this particular process is better than a code dump.