Send and receive SMS with Twilio, start conversation between sender and receiver

StackOverflow https://stackoverflow.com/questions/22742372

  •  24-06-2023
  •  | 
  •  

Вопрос

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

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top