On Sun, Nov 19, 2006 at 03:18:51PM +0200, Tzahi Fadida wrote:
> If icq can send to orange (and i think it can) you can use the script i use
> to send sms using icq. It is called vicq and it is a console script.

I used it and had some problems. I'm enclosing a PERL program I wrote
to use it which was able to work around the problems.

There are some important notes:

The caller ID/return address in the SMS are worthless. 

It works for everywhere I've tried.

You can change the signature in the PERL program, (see $mysig), but
I could not get it to set the return number.

You do need to maintain an ICQ account. At this point AFAIK, they still
are free.

You can do what you want with the PERL program, and I am not resposible
for what you do with it.

Geoff.

----
#!/usr/bin/perl

if (@ARGV < 2)
        {
        printf("sendsms2.p: send SMS via ICQ. Parameters <phone number> 
<message>\n");
        printf("Don't forget to put quotes around message\n");
        exit;
        }

$mysig = "Geoffrey S. Mendelson, +972-544-608-069";

$number = @ARGV[0];
$msg = @ARGV[1];
#
#       get rid of letters, special characters, except + and spaces.
#
$number =~ tr /abcdefghijklmnopqurstuvwxyz/22233344455566670778889990/;
$number =~ tr /-_,/   /;

$real_number = ""; 
for ($n = 0; $n < length($number); $n++)
        {
        $c = substr($number,$n,1);
        if ($c eq " ")
                {
                next;
                }
        $real_number = $real_number . $c;
        }
#
#       GSM format: leading plusses get removed, number stays intact.
#
        $c = substr($real_number,0,1); 
        $c2 = substr($real_number,1,1); 
        if ( $c eq "+")
                {
                $real_number = substr($real_number,1);
                }
#
#       Leading zero, Israeli dialing rules.
#
        if ( $c eq "0")
                {
#
#               00 international number, strip 00, 
#               country code and number remain.
#
                if ($c2 eq "0")
                        {
                        $real_number = substr($real_number,2);
                        }
#
#               01 international number with carrier code, strip 01x, 
#               country code and number remain.
#
                if ($c2 eq "1")
                        {
                        $real_number = substr($real_number,3);
                        }
#
#               02 Jerusalem number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "2")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               03 Tel Aviv, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "3")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               04 Haifa number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "4")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               05 Cellular number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "5")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               06 Beer Sheva number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "6")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               07 Alternate voice carrier number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "7")
                        {
                        $real_number = "972". substr($real_number,1);
                        }
#
#               08 Modiin number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "8")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
#
#               09 ?? number, strip 0, number remains.
#               prefix with 972
#
                if ($c2 eq "9")
                        {
                        $real_number = "972" . substr($real_number,1);
                        }
                }
#
#       Anything else is probably a country code. leave alone.
#
printf("real number \"%s\"\n",$real_number);
#
#       Build command to send message.
#
$command = "online";
$command = $command . "\n";
$command = $command . "sms ";
$command = $command . "$real_number";
$command = $command . "/";
if (length($mysig) > 0)
        {
        $command = $command . "From: ";
        $command = $command . $mysig;
        }

$command = $command . " \"";
$command = $command . $msg;
$command = $command . "\"";

printf("command: \"%s\"\n",$command);

open (vicq,"|vicq -b -o -t 10");
printf vicq ("%s",$command);
close vicq;

---

-- 
Geoffrey S. Mendelson, Jerusalem, Israel [EMAIL PROTECTED]  N3OWJ/4X1GM
IL Voice: (07)-7424-1667  Fax ONLY: 972-2-648-1443 U.S. Voice: 1-215-821-1838 
Visit my 'blog at http://geoffstechno.livejournal.com/

=================================================================
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]

Reply via email to