Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

T-Mobile Web-to-SMS Gateway

743 views
Skip to first unread message

Paul Takemura

unread,
Sep 23, 2007, 2:58:13 AM9/23/07
to
I monitor servers using Nagios and require notification. I have a T-
Mobile cell phone and was receiving SMS text messages through T-
Mobile's Email-to-SMS gateway. According to the article at
http://en.wikipedia.org/wiki/SMS_gateways , however, the gateway
service was discontinued in August 2007. Indeed, I had not received
any notification when a server went down, and subsequent testing
resulted in very sporadic and unpredictable receipt of SMS messages.
But T-Mobile's Web-to-SMS gateway is reliable; messages sent through
this gateway are received almost immediately. See
https://wmg.tmomail.net/customer_site/jsp/messaging_lo.jsp

I wrote a short Tcl script to send a message to my phone through that
gateway:

#!/usr/bin/tclsh8.4
package require http
package require tls

http::register https 443 ::tls::socket

set formdata [http::formatQuery trackResponses "No" Send.x "Yes"
DOMAIN_NAME "@tmomail.com" min "1234567890" require_sender "Nagios"
text "emergency" msgTermsUse "1" Send "1"]

set token [http::geturl https://wmg.tmomail.net/customer_site/jsp/messaging_lo.jsp
-query $formdata]

exit 0

The "1234567890" should be replaced by your T-Mobile phone number.
Note that I had to add the tls package to my system, and that was a
bit of an experience because I had forgotten how Tcl knew where
packages lived. The script should have more error-checking; I'll work
on improving it and will post any updates later. I had tried a Perl
script earlier in the day, but after installing numerous layers of
dependencies, I still was not able to get things to work. The Tcl
solution was relatively easy to program.

Paul Takemura
oneIgloo.com

Cameron Laird

unread,
Sep 23, 2007, 10:12:06 AM9/23/07
to
In article <1190530693.9...@o80g2000hse.googlegroups.com>,
.
.
.
Me, too; I have Nagios monitors sending SMS to my cellular
handset. Thanks to Wojciech Kocjan for writing the original,
which we've documented in a couple of places, most recently
<URL: http://roundup.enfoldsystems.com/aei/issue143 >.

There's an even easier way to achieve the result you describe.
While I'm all for leaving unchanged something that already
works for you, I'll mention here for others that might want
to follow up on your work that e-mail to
12345...@tmomail.net
achieves the same result.

If there's interest, I'll publish other IP-to-SMS services.

Paul Takemura

unread,
Sep 23, 2007, 1:17:40 PM9/23/07
to
On Sep 23, 7:12 am, cla...@lairds.us (Cameron Laird) wrote:
> In article <1190530693.972283.138...@o80g2000hse.googlegroups.com>,

> Paul Takemura <itaz...@gmail.com> wrote:
>
> >I monitor servers using Nagios and require notification. I have a T-
> >Mobile cell phone and was receiving SMS text messages through T-
> >Mobile's Email-to-SMS gateway. According to the article at
> >http://en.wikipedia.org/wiki/SMS_gateways, however, the gateway
> 1234567...@tmomail.net

> achieves the same result.
>
> If there's interest, I'll publish other IP-to-SMS services.

I used to used the email method (12345...@tmomail.net) but it no
longer works, at least not reliably, and at least for me. I was
surprised to read in the Wikipedia article I cited that the service
had been discontinued in August 2007. It's still possible to use the
web, so that's what motivated me to write the script.

Paul Takemura

unread,
Sep 24, 2007, 4:53:40 PM9/24/07
to
On Sep 22, 11:58 pm, Paul Takemura <itaz...@gmail.com> wrote:
> I monitor servers using Nagios and require notification. I have a T-
> Mobile cell phone and was receiving SMS text messages through T-
> Mobile's Email-to-SMS gateway. According to the article athttp://en.wikipedia.org/wiki/SMS_gateways, however, the gateway

> service was discontinued in August 2007. Indeed, I had not received
> any notification when a server went down, and subsequent testing
> resulted in very sporadic and unpredictable receipt of SMS messages.
> But T-Mobile's Web-to-SMS gateway is reliable; messages sent through
> this gateway are received almost immediately. Seehttps://wmg.tmomail.net/customer_site/jsp/messaging_lo.jsp

>
> I wrote a short Tcl script to send a message to my phone through that
> gateway:
>
> #!/usr/bin/tclsh8.4
> package require http
> package require tls
>
> http::register https 443 ::tls::socket
>
> set formdata [http::formatQuery trackResponses "No" Send.x "Yes"
> DOMAIN_NAME "@tmomail.com" min "1234567890" require_sender "Nagios"
> text "emergency" msgTermsUse "1" Send "1"]
>
> set token [http::geturlhttps://wmg.tmomail.net/customer_site/jsp/messaging_lo.jsp

> -query $formdata]
>
> exit 0
>
> The "1234567890" should be replaced by your T-Mobile phone number.
> Note that I had to add the tls package to my system, and that was a
> bit of an experience because I had forgotten how Tcl knew where
> packages lived. The script should have more error-checking; I'll work
> on improving it and will post any updates later. I had tried a Perl
> script earlier in the day, but after installing numerous layers of
> dependencies, I still was not able to get things to work. The Tcl
> solution was relatively easy to program.
>
> Paul Takemura
> oneIgloo.com

For completeness, here's what I did to add the necessary TLS package:
1. I downloaded the file tls1.5.0-linux-x86.tar from Sourceforge:
http://sourceforge.net/project/showfiles.php?group_id=13248

2. There are three files within the tar file:

libtls1.50.so
pkgIndex.tcl
tls.tcl

3. I copied libtls1.50.so to /usr/lib/tcl8.4 and set the permissions
to
555 owned by root:root.

4. In the directory /usr/lib/tcl8.4, I created a directory named
tls1.5

5. I copied the pkgIndex.tcl and tls.tcl files to the
/usr/lib/tcl8.4/tls1.5 directory.

That's it!

I realize that libtls1.50.so does not belong in /usr/lib/tcl8.4, but
this
setup worked without any changes to the pkgIndex.tcl file and without
running any commands. Now I need to learn more about packages. YMMV.

Paul Takemura


0 new messages