Re: Sending SMS messages to Orange phones

1999-09-07 Thread Nadav Har'El

On Tue Sep  7 17:03:21 1999, Geoffrey S. Mendelson wrote about "Re: Sending SMS 
messages to Orange phones":
 Cellcom is free, but the owner of the phone has to pay extra for the
 message service. You do have to get a login, and each login is limited to
 100 messages in 21 days. This replaces their "Mail Push" service, which 
 the very mention of makes syadmins cringe.

Their current limit is, as far as I know, 20 messages per day, but of course
it's trivial to get around by opening multiple accounts. The old limit was
100 messages in 7 days.

 Orange's costs 20 ag/msg and you have to pay in advance.

That's not true: Orange users get SMS service free with their standard
package, and can receive messages for free. Anyone can send messages to
Orange phones for free form the Internet, by using either Orange.co.il's
own website, or gosms.com's site. 20 ag/msg is the price of gosms.com's
(rather useless, in my view) email gateway to SMSs.
Sending an SMS form an orange phone costs 9 agorot per message, BTW, and it
can even be used to send email from your Orange phone! See gosms.com.


-- 
Nadav Har'El | ##   # | -- Sorry if
Email: [EMAIL PROTECTED]   |  #   #   # |   you can't
Department of Mathematics, Technion  |  #   #   # |   read Hebrew.
Israel Institute of Technology   |  #  ## |   Nadav. ;)
WWW page: http://harel.org.il/nadav  ICQ #13349191

=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]



Re: Sending SMS messages to Orange phones

1999-09-07 Thread Nadav Har'El

Here's a script for cellcom SMSs. It also requires registring in Cellcom's
site (http://text.cellcom.co.il/webp/Cgi/PU/PU_Login.exe?Lang=Eng) to obtain
a username and password.

It also doesn't work with newlines in the message.

---


#!/usr/local/bin/perl -w
# Copyright (C) 1999 Nadav Har'El. All rights reserved.

require 5.004;
use Carp;
use LWP::UserAgent;
use URI::Escape;

#
### User-specific information: later, this information should be got from
### a user configuration file.
# Cellcom SMS service registration: registration is free at at
# http://text.cellcom.co.il/webp/Cgi/PU/PU_Login.exe?Lang=Eng
my $CELLCOMTEXT_USER="username"; my $CELLCOMTEXT_PASSWORD="password";

if($#ARGV+1 != 3){
print STDERR "Usage: $0 phonenum sender message\n";
exit 1;
}

my $phonenum=$ARGV[0];
# remove optional spaces, parantheses, or hyphens from phone number
$phonenum =~ s/[ ()-]//go;
my $sender=$ARGV[1];
my $message=$ARGV[2];

print "Sending to $phonenum: $message ($sender)\n";

##
my ($ua,$req);

$ua = new LWP::UserAgent;
$ua-agent("perl");


if($phonenum =~ m/^05[23][0-9][0-9][0-9][0-9][0-9][0-9]/){
 CELLCOM ###
my ($hiddenfields);
$req = new HTTP::Request 'GET' = 
"http://text.cellcom.co.il/webp/Cgi/PU/PU_CheckLogin.exe?Lang=EngUserName=$CELLCOMTEXT_USERPASSWORD=$CELLCOMTEXT_PASSWORD";
$req-header('Accept' = 'text/html');
$res = $ua-request($req);
if ($res-is_success) {
my (@tmplist,$s);
# look for hidden fields in the returned form (res-content)
# but not RecipientString, which we will change:
@tmplist=split '\n', $res-content;
$hiddenfields="";
foreach $s (grep /"Hidden"/, @tmplist){
next if $s =~ /RecipientString/;
$s =~ s/^.*NAME="//o;
$s =~ s/"[ \t]*VALUE="/=/o;
$s =~ s/"/\/;
$hiddenfields=$hiddenfields . $s;
}
} else {
# TODO: retry several times, sleeping between tries.
print STDERR "Error: " . $res-status_line . "\n";
exit 3;
}
if($hiddenfields eq ""){
# TODO: try to recover somehow (use another account?)
# maybe try to figure out what went wrong by looking
# at $res-content.
print STDERR "Error: bad response from Cellcom's site\n";
exit 4;
}
# now that we have session information ($hiddenfields), send the
# sms.

# TODO: change newlines to spaces, because it seems we don't get
# anything after the first newline. BTW, a newline at the end of
# the message is a way not to the the "(sender)" line! :)
$req = new HTTP::Request 'GET' =
"http://text.cellcom.co.il/webp/Cgi/PU/PU_SendMessage.exe?" .
"$hiddenfieldsSenderName=" . uri_escape($sender, "^A-Za-z") .
"CurrMsg=" . uri_escape($message, "^A-Za-z") .
"Urgency=NormalRecipientString=$phonenum";
$req-header('Accept' = 'text/html');
$res = $ua-request($req);
if ($res-is_success) {
# TODO: check that the returned text is correct, then we'll
# be really sure the message was sent.
if($res-content =~ /Sent successfully/){
print "Sent successfully.\n";
} else {
# TODO: try to recover somehow maybe try to figure out
# what went wrong by looking at $res-content.
print "Error: unexpected response from Celcom's site\n";
exit 6;
}
} else {
# TODO: retry several times, sleeping between tries.
print STDERR "Error: " . $res-status_line . "\n";
exit 5;
}

# TODO: I didn't copy here the old logout code from my old sendsms.
# I'm not sure if it's needed: or worse - what it does. Maybe it
# makes sendsms non-reentrant? So far I didn't get any problems
# because I don't "log out".
# $WGET -O $TMPF 
"http://text.cellcom.co.il/webp/Cgi/PU/PU_Logout.exe?UserName=$CELLCOMTEXT_USERLang=Eng"

} elsif($phonenum =~ m/^054[0-9][0-9][0-9][0-9][0-9][0-9]/){
print STDERR "Sorry, Orange number $phonenum not yet supported.\n";
} elsif($phonenum =~ m/^05[01][0-9][0-9][0-9][0-9][0-9][0-9]/){
print STDERR "Sorry, Pelephone number $phonenum not yet supported.\n";
} else {
print 

Re: Sending SMS messages to Orange phones

1999-09-07 Thread Geoffrey S. Mendelson

Stanislav Malyshev a.k.a Frodo wrote:
 
 For pelephone you can send mail to 9720phonenumber@msg.pelephone.co.il
 and get the message delivered on the screen. No scripts, no cookies, no
 mess.

Not always the case. It's 9720 for 050 numbers, but it's 9723... for
051 numbers. 

This works very well, and IMHO they have a wonderful signature parser.
It works on any CDMA (digital) pele-phone, at no extra cost.

Cellcom is free, but the owner of the phone has to pay extra for the
message service. You do have to get a login, and each login is limited to
100 messages in 21 days. This replaces their "Mail Push" service, which 
the very mention of makes syadmins cringe.

Orange's costs 20 ag/msg and you have to pay in advance.

Geoff.

-- 
Geoffrey S. Mendelson
Tel:  (03) 6944-211  Fax: (03) 6944-225 Email: [EMAIL PROTECTED] 


=
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]