Twilio

Twilio is one of the most popular services in the world based in California. It works well in many countries, especially in the US, Canada, and the UK. You will need ACCOUNT_SID and AUTH_TOKEN (or API_SID/API_SECRET pair) which you can get after registrating a Twilio account.


field params:
{
"account_sid": "ACdc5f132a3c49700934481addd5ce1659",
"auth_token": "1095175a27d2044c06e1db8577b484f3",
"enable_status_callback": false
}
type: transceiver
provider: twilio

or


field params:
{
"account_sid": "ACdc5f132a3c49700934481addd5ce1659",
"api_sid": "SK12347865ugdfjbdf7845876345",
"api_secret": "BS12347865ugdfjbdf7845876345",
"enable_status_callback": false
}
type: transceiver
provider: twilio

The full SQL request will look like this:


INSERT INTO `google`.`sms_gates` (`type`, `provider`, `params`, `enabled`, `class_filter`) VALUES ('transceiver', 'twilio','{"account_sid": "ACdc5f132a3c49700934481addd5ce1659","auth_token":"1095175a27d2044c06e1db8577b484f3", "enable_status_callback": true}',1,'*');

You can find information on your ‘account_sid’ and ‘auth_token’ in your dashboard. To see it, please click on ‘Show API Credentials’.
And do additional SQL requests:


UPDATE `google`.`dealers` SET `master_phone` = "TWILIO_PHONE",`from_sms`="TWILIO_PHONE" WHERE dealer_id=1;
INSERT INTO `google`.`sms_gates_to_dealers` (`dealer_id`, `gate_id`) VALUES (0, 1);

TWILIO_PHONE stands for the phone number you have leased from Twilio provider. The first additional SQL requests is adding phone that will be sent in ‘from’ field to Twilio API. The last one assigns dealer to sms gate used by this dealer.
If you are going to use bash scripting you will need to escape all backticks, for example,

UPDATE \`google\`.\`dealers\` SET \`master_phone\` ....

Incoming messages

To get incoming messages via Twilio provider add the following URL using web-interface:

http://$IPADDR:22000/sms/$GATEID/incoming

Where $IPADDR is an ip address of the server or its domain name
$GATEID – id of sms gate which is processing incoming messages
22000 – port used to listen connects (default value)

We use сookies to improve our website, products and related services, analyze site traffic, and serve targeted advertisements. If you continue to use our services, you consent to our use of сookies. Read more