How to send a text from the user's cell phone number using Twilio?


#1

I want to programatically send SMS / text messages from my Meteor app; many people recommend twilio for this, and there are several Meteor Twilio packages (findable via https://atmospherejs.com and/or googling/binging). I don’t know if one of these packages is decidedly better than the other, but for now, at least, I’m using the abhiaayer:meteor-twilio package.

My concern is that, when you create a Twilio account, they assign you a “from” phone number (you can’t, apparently, just use your own). Maybe I’m misunderstanding how this works, but before I go too far down this path, I want to know if the sender of the SMS – IOW the user of my app – will be able to use their phone number as the “from”/sender phone number.

After all, the whole point of my app is to allow the user to send out multiple identical texts (such as “where are you?” or “are you okay?”) to friends/family, and then get a response back from them (to his phone, not to a Twilio-supplied number).

If it’s possible to use Twilio with your own phone number as the “from”/sending number, has anyone got suggestions on Meteor package preferences (abhiaayer, andreioprisan, DispatchMe) and how that can be accomplished from Meteor?

I imagine the basic code would be pretty much the same, regardless of package used; e.g., here’s an example from https://github.com/andreioprisan/twilio-meteor

twilio = Twilio(ACCOUNT_SID, AUTH_TOKEN);
  twilio.sendSms({
    to:'+16515556677', // Any number Twilio can deliver to
    from: '+14506667788', // A number you bought from Twilio and can use for outbound communication
    body: 'word to your mother.' // body of the SMS message
  }, function(err, responseData) { //this function is executed when a response is received from Twilio
    if (!err) { // "err" is an error received during the request, if any
      // "responseData" is a JavaScript object containing data received from Twilio.
      // A sample response from sending an SMS message is here (click "JSON" to see how the data appears in JavaScript):
      // http://www.twilio.com/docs/api/rest/sending-sms#example-1
      console.log(responseData.from); // outputs "+14506667788"
      console.log(responseData.body); // outputs "word to your mother."
    }
});

I did create a Twilio account, and have the “from” number (not my actual cell phone number) they assigned my account, and the SID, but I don’t kow what the AUTH_TOKEN should be.

If what I intend is not possible from Twilio, what I may do is just write the app so that all the selected “to” numbers can be copied to the clipboard, so that the user can paste them into his SMS screen’s “recipients” textbox; but I was hoping to afford the user the luxury of simply tapping a button.


#2

@clayshannon have you solved it yet?


#3

Thanks, but it’s no longer an issue. - Clay Shannon


#4

Care to share how you solved it ?


#5

I didn’t; I just don’t have time for Meteor right now. - Clay Shannon


#6

As far as I can see, Twilio does not allow setting custom sender-id… this is from Twilio documentation:

From
A Twilio phone number (in E.164 format) or alphanumeric sender ID enabled for the type of message you wish to send. Phone numbers or short codes purchased from Twilio work here. You cannot (for example) spoof messages from your own cell phone number.

I would recommend using either Nexmo or Plivo… they are cheaper then Twilio and both their systems allows you to set a custom sender (text or number)… but keep in mind that there are some country specific restrictions.