Sending SMS...

F

Fazer

Hello,

Can anyone point me to a way on how to send a SMS message using Python?

Thanks,
 
J

Jarek Zgoda

Fazer said:
Thanks, but how would I implement that? Any ideas?

Just send appropriately crafted HTTP request to the gateway's webserver
using httplib. You should analyze page source to get some basic things
like http field names and a name of script, where you should send your
data (form action="script_name").

Also, be aware, that 1rstWap.com (and many other free SMS web gateways)
require prior user registration, that can not be handled by program
(they show user some picture with text that need to be entered
correctly).
 
P

Peter Hansen

Jarek said:
Also, be aware, that 1rstWap.com (and many other free SMS web gateways)
require prior user registration, that can not be handled by program
(they show user some picture with text that need to be entered
correctly).

Kind of defeats the value of suggesting that he use this as
a way of sending using Python, doesn't it?

-Peter
 
J

Jarek Zgoda

Peter Hansen said:
Kind of defeats the value of suggesting that he use this as
a way of sending using Python, doesn't it?

Yes - if this should be service/daemon app and you don't have a user
that can perform prior registration.

No - if this will be usual GUI app with user equipped with monitor,
keyboard and mouse, sitting in front of it.

And again no - if you don't need "worldwide" functionality of gateways
like 1rstWap and stick to local telcos.
 
F

Fazer

Jarek Zgoda said:
Just send appropriately crafted HTTP request to the gateway's webserver
using httplib. You should analyze page source to get some basic things
like http field names and a name of script, where you should send your
data (form action="script_name").

Also, be aware, that 1rstWap.com (and many other free SMS web gateways)
require prior user registration, that can not be handled by program
(they show user some picture with text that need to be entered
correctly).


Thanks for your reply. I thought I would have to use sockets but I
guess http would be easier.
 
G

Guenther Starnberger

Fazer wrote:

hello,
Can anyone point me to a way on how to send a SMS message using Python?

an alternative to the already suggested SMS-webgateway would be to use the
ICQ-SMS-gateway ('worldwide' SMSs, no advertisements).

either use libicq2000[1] directly (but afaik there are no python bindings
yet), or setup a local jabber[2] server with an aim-transport[3] to which
you can connect with python by using jabberpy[4].

cu
/gst

[1] http://libicq2000.sf.net/
[2] http://www.jabber.org/about/overview.html
[3] http://aim-transport.jabberstudio.org/
[4] http://jabberpy.sourceforge.net/
 
J

Jarek Zgoda

Guenther Starnberger said:
either use libicq2000[1] directly (but afaik there are no python bindings
yet), or setup a local jabber[2] server with an aim-transport[3] to which
you can connect with python by using jabberpy[4].

Shouldn't public Jabber server with AIM transport be sufficient? I never
tried such approach, but it sounds interesting since Jabber is getting
more and more audience here in Poland.

Also, there is another Jabber library available, PyXMPP. Its author
claims it's faster and more robust (it is based on libxml2, not expat).
I didn't tried it yet due to some system inconsistencies (libxml2 is
heavily used by GNOME2 and Python bindings are tightly tied to
particular version of library), but it sounds promising.
 
G

Guenther Starnberger

Jarek Zgoda wrote:

hello,
either use libicq2000[1] directly (but afaik there are no python bindings
yet), or setup a local jabber[2] server with an aim-transport[3] to which
you can connect with python by using jabberpy[4].

Shouldn't public Jabber server with AIM transport be sufficient? I never
tried such approach, but it sounds interesting since Jabber is getting
more and more audience here in Poland.

yop - it should be possible, but AOL already blocks some public jabber
servers from login to ICQ/AIM. if people start using large (well known)
jabber servers to relay their SMS for free, it's likely that they soon will
be blocked too :/

cu
/gst
 
J

Jarek Zgoda

Peter Hansen said:
Kind of defeats the value of suggesting that he use this as
a way of sending using Python, doesn't it?

Ah, and one thing I forgot for the first time -- you are not limited to
"free" gateways. You can always buy a service from your telco.
 
A

Alan Kennedy

Fazer said:
Can anyone point me to a way on how to send a SMS message using Python?

If you can read Java APIs, and don't mind working jython, then take a
look
at OpenSMPP, an open source implementation of the SMPP protocol.

The dates may look a little stale, i.e. last work done nearly two
years ago, but I'm fairly sure that most of the core stuff is working
and stable. OpenSMPP was written by Aldiscon (a Dublin company), who
were then taken over by Logica. Logica maintained the Open Source
committment.

http://opensmpp.logica.com/

Then there are various solutions where you can put a GSM card in your
PC, or cables to link an actual mobile handset to your PC, and rx/tx
SMS through those.

HTH,
 
P

Peter Hansen

Jarek said:
Yes - if this should be service/daemon app and you don't have a user
that can perform prior registration.

No - if this will be usual GUI app with user equipped with monitor,
keyboard and mouse, sitting in front of it.

You're right.... Sorry, I misread your first post as suggesting
that each message, not just the registration, required the human
confirmation. (Yes, you were quite clear in what you wrote....
I must have been skimming or something. :-( )

-Peter
 
F

Fazer

Guenther Starnberger said:
Fazer wrote:

hello,
Can anyone point me to a way on how to send a SMS message using Python?

an alternative to the already suggested SMS-webgateway would be to use the
ICQ-SMS-gateway ('worldwide' SMSs, no advertisements).

either use libicq2000[1] directly (but afaik there are no python bindings
yet), or setup a local jabber[2] server with an aim-transport[3] to which
you can connect with python by using jabberpy[4].

cu
/gst

[1] http://libicq2000.sf.net/
[2] http://www.jabber.org/about/overview.html
[3] http://aim-transport.jabberstudio.org/
[4] http://jabberpy.sourceforge.net/

Wow, thanks for the reply! It was really helpful. Exactly what I was looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

SMPP sending chinese message to smsc 1
SMS 0
Sending SMS using python script 6
python & sms 4
Axios 403 error when sending get request 3
pure python for sms 4
Sending Error when attaching files 1
sms port 2

Members online

No members online now.

Forum statistics

Threads
474,164
Messages
2,570,898
Members
47,439
Latest member
shasuze

Latest Threads

Top