Sending SMS Messages With Ruby

I'm going to need to send SMS messages from a Ruby server I am building currently. I just thought I would ask if anyone here has any experience doing that and would recommend a library, web service, web site I can mechanize, or whatever. Any tips appreciated.

James Edward Gray II

James Edward Gray II wrote:

I'm going to need to send SMS messages from a Ruby server I am building currently. I just thought I would ask if anyone here has any experience doing that and would recommend a library, web service, web site I can mechanize, or whatever. Any tips appreciated.

James Edward Gray II

Most Cellphone providers will let you send SMS via email. Check with the providers for the email address. I do it all the time.

I'm going to need to send SMS messages from a Ruby server I am
building currently. I just thought I would ask if anyone here has
any experience doing that and would recommend a library, web service,
web site I can mechanize, or whatever. Any tips appreciated.

Your two basic entry points into the mobile networks are:

1. Email SMS gateways (each carrier hosts their own, Verizon uses vtext.com).
You send an email to PHONENUMBER@vtext.com, an SMS gets sent to the end
user. These are free for now, but you get no guaranteed delivery, or notice
of receipt, and they're a bit unreliable at times. Most phones will let you
send an SMS to an email address (the phone's software and the carrier must
support it), so you can do 2 way communication if you need it.

2. You can sign up for an SMS aggregator service. SMS aggregators are the
formal entities that handle intra-carrier SMS traffic, so they frequently
offer entry points for third party services. You would get a shortcode (or
share one) and could send and receive with it.

Clickatell is one noteworthy SMS service provider, but there are more and
more out there these days:

Wikipedia's SMS Gateway entry is also helpful:

If you want to go the Email to SMS route, there are lists online to show you
which carriers use which email domain / syntax, so you could brew your own
lib. This obviously means you'd need to know which carrier a person uses so
you know where to send the email, so you'd have to ask the end user. I
suspect there are services out there where they handle that bit for you and
just require the number. Since you can transfer phone numbers between
carriers now it's not as easy to predict which carrier a number is from.

Good luck,
Matt

James Edward Gray II

···

On 1/7/07, James Edward Gray II <james@grayproductions.net> wrote:

--
------------------
Matt Pelletier
http://www.eastmedia.com -- EastMedia
http://www.informit.com/title/0321483502 -- The Mongrel Book
http://identity.eastmedia.com -- OpenID, Identity 2.0

One option is to connect a phone/modem/data card to the server
directly, and use that to send the messages. Most phones provide a
serial port to communicate, and sending SMS is a matter of a few AT
commands (with a few quirks, as usual). It depends on what kind of
messages you want to send (text only/binary/unicode).

Advantages:
- you can send messages to any number your operator is able to send
- you don't need to rely on some third party gateway
- might be more flexible (on some modems you can deliberately set the
sender number even to a text)

Disadvantages:
- may be more expensive compared to email gateways (depending on your
subscription)
- the need for hardware
- more work (though a library/tool for the communication may exist, I
don't know)

Anyway, I would consider this as a last resort, when there is no
sufficient email gw available.

···

On 1/7/07, James Edward Gray II <james@grayproductions.net> wrote:

I'm going to need to send SMS messages from a Ruby server I am
building currently. I just thought I would ask if anyone here has
any experience doing that and would recommend a library, web service,
web site I can mechanize, or whatever. Any tips appreciated.

we are using smstools (meinemullemaus.de) with a serial
cellphone attached to the server.
It works very well, a daemon (smsd) is periodically checking on an outbox
folder (/var/spool/smsd/outbox) and my program is simply writing textfiles
into it. The format of these files is simply:

···

--------
To: <Phone number>

Message to send
--------

martin

On Sunday 07 January 2007 18:09, James Edward Gray II wrote:

I'm going to need to send SMS messages from a Ruby server I am
building currently. I just thought I would ask if anyone here has
any experience doing that and would recommend a library, web service,
web site I can mechanize, or whatever. Any tips appreciated.

James Edward Gray II

Kannel is a pain to configure, but once it's up it will send to urls,
so you can back end it with your favorite ruby web framework. It will
communicate over the net via smpp, or over serial/usb/bluetooth/etc
with a phone you've attached to the computer. Finding a phone that
supports sms over serial correctly is another matter.

http://www.kannel.org/

Kannel is the heavy artillery approach. If you're just trying to let
yourself know a process crashed, I'd stick to email.

Thanks for the tip. This did help.

Looking into this means and Google's simple service:

http://www.google.com/sendtophone

it seems I need to know the provider in either case. Is this always true?

James Edward Gray II

···

On Jan 7, 2007, at 12:15 PM, Sean Bryant wrote:

James Edward Gray II wrote:

I'm going to need to send SMS messages from a Ruby server I am building currently. I just thought I would ask if anyone here has any experience doing that and would recommend a library, web service, web site I can mechanize, or whatever. Any tips appreciated.
James Edward Gray II

Most Cellphone providers will let you send SMS via email. Check with the providers for the email address. I do it all the time.

Choosing an SMS aggregator is definitely what I'd recommend, as they have
direct binds to most US carriers (and in some cases, international carriers)
for reliable message delivery. I do technical support for one such
aggregator. I don't want to advertise on this thread, so e-mail me direct if
you're perhaps interested...

~Myles

···

On 1/7/07, Martin Boese <boesemar@gmx.de> wrote:

we are using smstools (meinemullemaus.de) with a serial
cellphone attached to the server.
It works very well, a daemon (smsd) is periodically checking on an outbox
folder (/var/spool/smsd/outbox) and my program is simply writing textfiles
into it. The format of these files is simply:
--------
To: <Phone number>

Message to send
--------

martin

On Sunday 07 January 2007 18:09, James Edward Gray II wrote:
> I'm going to need to send SMS messages from a Ruby server I am
> building currently. I just thought I would ask if anyone here has
> any experience doing that and would recommend a library, web service,
> web site I can mechanize, or whatever. Any tips appreciated.
>
> James Edward Gray II

Just to add to this, you are at the complete mercy of the destination provider if you use their email gateway. For a while I did this w/ nagios, but the latency between send and arrival on my provider was so high that I was just wasting money (on several levels).

All the ISPs that I know of use the quoted solution (or something very similar), and if time is critical (which it generally is with these sorts of things), you may want to seriously explore that option.

-Erik

···

On 2007-01-07 11:56:11 -0800, Martin Boese <boesemar@gmx.de> said:

we are using smstools (meinemullemaus.de) with a serial cellphone attached to the server.

This service seems to allow me to do it generically:

James Edward Gray II

···

On Jan 7, 2007, at 12:32 PM, James Edward Gray II wrote:

On Jan 7, 2007, at 12:15 PM, Sean Bryant wrote:

James Edward Gray II wrote:

I'm going to need to send SMS messages from a Ruby server I am building currently. I just thought I would ask if anyone here has any experience doing that and would recommend a library, web service, web site I can mechanize, or whatever. Any tips appreciated.
James Edward Gray II

Most Cellphone providers will let you send SMS via email. Check with the providers for the email address. I do it all the time.

Thanks for the tip. This did help.

Looking into this means and Google's simple service:

http://www.google.com/sendtophone

it seems I need to know the provider in either case. Is this always true?

I've used teleflip before just to send to friend's cell phones from my
email, when I don't want to figure out what provider they are on. It
works well enough, though teleflip adds some subject-line type stuff
that may look strange in the recipients cell phone. They have been
around awhile so it seems to be a service that is going to stick
around for awhile...

- Rob

···

On 1/7/07, James Edward Gray II <james@grayproductions.net> wrote:

On Jan 7, 2007, at 12:32 PM, James Edward Gray II wrote:

> On Jan 7, 2007, at 12:15 PM, Sean Bryant wrote:
>
>> James Edward Gray II wrote:
>>> I'm going to need to send SMS messages from a Ruby server I am
>>> building currently. I just thought I would ask if anyone here
>>> has any experience doing that and would recommend a library, web
>>> service, web site I can mechanize, or whatever. Any tips
>>> appreciated.
>>> James Edward Gray II
>>
>> Most Cellphone providers will let you send SMS via email. Check
>> with the providers for the email address. I do it all the time.
>
> Thanks for the tip. This did help.
>
> Looking into this means and Google's simple service:
>
> http://www.google.com/sendtophone
>
> it seems I need to know the provider in either case. Is this
> always true?

This service seems to allow me to do it generically:

http://www.teleflip.com/

James Edward Gray II