pure python for sms

Paul Boddie paul at boddie.org.uk
Fri Aug 31 09:44:32 EDT 2007


On 31 Aug, 15:36, Gerardo Herzig <gher... at fmed.uba.ar> wrote:
> Neil Hodgson wrote:
> >    This is likely to cost some money similar to sending an SMS from a
> >'phone.

[...]

> Well, im not triyng to send a SMS `FROM' a cellphone, im trying to send
> a SMS `TO' a cellphone.

Yes, but he did write "similar to", meaning that regardless of how the
message is prepared, sending it may cost someone some money - the
typical "financial effect" when you send a message from an actual
telephone.

> Here (in Argentina) are several sites who lets you send a sms for free. You also can receive
> SMS responses via this pagehttp://sms.personal.com.ar/Mensajes/msn.htm

I guess you're thinking about a library like SMSLib:

http://smslib.org/

This seems to combine the two most obvious ways of sending such
messages: communicate with a device already located on the GSM
network; communicate with a gateway which relays messages to the GSM
network.

> While my tries using this page via urllib failed, i dont want to depend
> on an external page anyway. The  python class you  send to me looks like
> a  pay site (if not, i dont see why the tokenpay() and getbalance()
> methods :)
>
> I was also avaiable to send a sms in the form of an plain email
> __cellphone_number at i_used_to_be_cool_smtp.com, but it not seems to work
> this way no longer. Again, i dont want to do it that way anyway.

Yes, both of the above (use of a Web site or an e-mail relay) rely on
existing services. If you don't want to do that, you'll need to
connect directly to your own GSM-capable device, I imagine.

> Thats why im looking for a python implementation of that funcionality.

I don't know how well SMSLib works with Jython or whether you could
take a PyLucene-like approach and wrap it for CPython using SWIG or
some other wrapper technology in conjunction with gcj, but that's one
approach. Another is to look into libraries which communicate with
mobile devices: I extended one called t616hack [1] and made it almost
capable of telling my T610 telephone to send messages, but another
candidate would be python-gammu [2]. A while back someone stumbled
across a GSM hardware module which has embedded Python as a feature
[3], but I imagine that a lot of GSM-capable hardware uses AT-like
commands to support such activities.

Of course, I've probably covered an area that you're not directly
interested in, but someone has to provide a link to the GSM network,
either in the network infrastructure or by using some kind of GSM
device. If you're not a GSM network operator then it's likely that
you're either going to need to deal with a network operator, perhaps
indirectly, or you'll need to join the GSM network with a suitable
device in the "normal" way.

Paul

[1] http://www.python.org/pypi/t616hack
[2] http://cihar.com/gammu/python/
[3] http://www.telit.co.it/product.asp?productId=113




More information about the Python-list mailing list