Re: php-admin/send*.php

2001-11-20 Thread Alexei Pashkovsky



MCC/MNC codes are mobile country and network 
operator codes.
The submitting script I use for my scripts looks 
smth like this :

 
http://localhost/MT.php3">
 
Id: 

 
To: 

 
Validity: 
 
Type:
textOperator LogoGroup LogoRing 
TonePictureRestore 
logovCardvCalendar
 
Data: 

 
MCC 
MNC 
RouteTo 

 

 

 
 
in the above, mcc/mnc are set for Vodafone 
UK.

  - Original Message - 
  From: 
  Steve Rapaport 
  
  To: Alexei Pashkovsky 
  Sent: Tuesday, November 20, 2001 3:27 
  PM
  Subject: RE: php-admin/send*.php
  
  Thanks, Alexei!
   
  I 
  didn't see any operator codes included in the 
  pictures/group/logos.
  Or 
  did you hardcode those?  I know that part had me 
  stumped
  for 
  a couple of days.
   
  -steve
  
-Original Message-From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED]]On Behalf Of Alexei 
PashkovskySent: Monday, November 19, 2001 10:12 AMTo: 
[EMAIL PROTECTED]Cc: [EMAIL PROTECTED]Subject: 
Re: php-admin/send*.php
Ok.
Just a few cuts from my scripts 
(php) :
To encode mnc/mcc from usual 
values:



$code.=substr($mcc,1,1);$code.=substr($mcc,0,1);$code.="F";$code.=substr($mcc,2,1);$code.=substr($mnc,1,1);$code.=substr($mnc,0,1);



Now the binary data codings :



function symbolize($input){
/*this gets a hex string and puts "%" after every second 
char*/    $len = strlen($input);    
$i=0;    for 
($j=0;$j<$len;$j=$j+2){    
$char .= "%" ;    $char .= 
substr($input, $j, 1);    $char 
.= substr($input, $j+1, 1);    }    
return ($char);}
function http_send($URL,$port){ $connection = 
fsockopen(BEARERBOX_HOST,$port,&$error_number,&$error_description,60); if(!$connection) 
{//  echo "$error_description 
($error_number)\n";//  echo "The SMS message was NOT 
sent!\n"; } else {  fputs($connection, "GET $URL 
HTTP/1.0\r\n\r\n");  while (!feof($connection)) {   
$myline = fgets($connection, 128);   
switch($myline)   { case 
(strstr($myline, 'Content-')): break; case 
(strstr($myline, 'HTTP/1')): break; case "": 
break; case "\r\n": 
break; default: echo "\n";   
}  }  fclose ($connection);
 }}
 
switch ($type)    
{ 
    case "text":    
    $udh="";  
    
break;       case 
"clean":    
$udh="&udh=".symbolize("0605041582");    
$text="01";    
break;    case 
"operator":    
$udh="&udh=".symbolize("0605041582");    
$text=$code."00480E01".$text;    
break;    case 
"group":    
$udh="&udh=".symbolize("0605041583");    
$text="00480E01".$text;    
break;    case 
"profile":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i 
= 1; $i <= $count; $i++)    
{    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B0504158A0003010".$count."0".$i;    
$udh.=symbolize($temp);    
$URL="/cgi-bin/sendsms?username=".USERNAME."&smsc=$smsc&password=".PASSWORD."&to=$to$udh&text=$data";    
$URL.="&from=A38700&validity=$validity&priority=$priority&app_id=$sql_id";    
http_send($URL,$port);
    
}    
exit;    break;    
    case 
"ringtone":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i 
= 1; $i <= $count; $i++)    
{   
    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B050415810003AA0".$count."0".$i;    
$udh.=symbolize($temp);    
$URL="/cgi-bin/sendsms?username=".USERNAME."&smsc=$smsc&password=".PASSWORD."&to=$to$udh&text=$data";    
$URL.="&from=A38700&validity=$validity&priority=$priority&app_id=$sql_id";    
http_send($URL,$port);    
}    exit; 
    break;    
case "picture":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i 
= 1; $i <= $count; $i++)    
{    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B0504158A00030

Re: php-admin/send*.php

2001-11-20 Thread Alexei Pashkovsky



Ok.
Just a few cuts from my scripts 
(php) :
To encode mnc/mcc from usual values:



$code.=substr($mcc,1,1);$code.=substr($mcc,0,1);$code.="F";$code.=substr($mcc,2,1);$code.=substr($mnc,1,1);$code.=substr($mnc,0,1);



Now the binary data codings :



function symbolize($input){
/*this gets a hex string and puts "%" after every second 
char*/    $len = strlen($input);    
$i=0;    for 
($j=0;$j<$len;$j=$j+2){    $char 
.= "%" ;    $char .= substr($input, 
$j, 1);    $char .= substr($input, 
$j+1, 1);    }    return 
($char);}
function http_send($URL,$port){ $connection = 
fsockopen(BEARERBOX_HOST,$port,&$error_number,&$error_description,60); if(!$connection) 
{//  echo "$error_description 
($error_number)\n";//  echo "The SMS message was NOT 
sent!\n"; } else {  fputs($connection, "GET $URL 
HTTP/1.0\r\n\r\n");  while (!feof($connection)) {   
$myline = fgets($connection, 128);   
switch($myline)   { case 
(strstr($myline, 'Content-')): break; case 
(strstr($myline, 'HTTP/1')): break; case "": 
break; case "\r\n": 
break; default: echo "\n";   
}  }  fclose ($connection);
 }}
 
switch ($type)    
{ 
    case "text":    
    $udh="";  
    
break;       case 
"clean":    
$udh="&udh=".symbolize("0605041582");    
$text="01";    
break;    case 
"operator":    
$udh="&udh=".symbolize("0605041582");    
$text=$code."00480E01".$text;    
break;    case 
"group":    
$udh="&udh=".symbolize("0605041583");    
$text="00480E01".$text;    
break;    case 
"profile":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i = 
1; $i <= $count; $i++)    
{    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B0504158A0003010".$count."0".$i;    
$udh.=symbolize($temp);    
$URL="/cgi-bin/sendsms?username=".USERNAME."&smsc=$smsc&password=".PASSWORD."&to=$to$udh&text=$data";    
$URL.="&from=A38700&validity=$validity&priority=$priority&app_id=$sql_id";    
http_send($URL,$port);
    
}    
exit;    break;    
    case 
"ringtone":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i = 
1; $i <= $count; $i++)    
{   
    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B050415810003AA0".$count."0".$i;    
$udh.=symbolize($temp);    
$URL="/cgi-bin/sendsms?username=".USERNAME."&smsc=$smsc&password=".PASSWORD."&to=$to$udh&text=$data";    
$URL.="&from=A38700&validity=$validity&priority=$priority&app_id=$sql_id";    
http_send($URL,$port);    
}    exit; 
    break;    case 
"picture":    
$len=strlen($text);    
$count=ceil($len/257);    for ($i = 
1; $i <= $count; $i++)    
{    $temp = 
substr($text,256*($i-1),256*$i);    
$data="symbolize($temp);    
$udh="&udh=";    
$temp="0B0504158A0003010".$count."0".$i;    
$udh.=symbolize($temp);    
$URL="/cgi-bin/sendsms?username=".USERNAME."&smsc=$smsc&password=".PASSWORD."&to=$to$udh&text=$data";    
$URL.="&from=A38700&validity=$validity&priority=$priority&app_id=$sql_id";    
http_send($URL,$port);    
}    
exit;    break;
    case 
"vcard":    
$udh="&udh=".symbolize("06050423F4");    
break;        case 
"vcalendar":    
$udh="&udh=".symbolize("0B050423F500");    
break;    
}if ($udh) 
$data="symbolize($text);else$data="urlencode($text);   " 




Hope this helps someone.
Bye.

  - Original Message - 
  From: 
  Steve 
  Rapaport 
  To: Alexei Pashkovsky 
  Sent: Tuesday, November 20, 2001 2:31 
  AM
  Subject: Re: php-admin/send*.php
  some people have their own implementations, I do.I do too, 
  now, but having examples in the distribution would have made my life much 
  easier, as itwill for that other guy (miguel) who is asking.Thanks 
  for the convertors, I think I have a use for 
  those!-steveAlexei Pashkovsky wrote:
  those are obsolete.- Original Message -From: "Steve Rapaport" <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]>Sent: Monday, November 19, 2001 7:49 PMSubject: Re: php-admin/send*.php
I second that question.  I asked 2 months ago and got no reply.
  Some of the missing scripts (sendgt and sendrt - send logo and ringtone)would be very helpful...Best regards,miguel vitorino--Steve RapaportUnder Construction-- 
Steve Rapaport
Under Construction



Re: php-admin/send*.php

2001-11-19 Thread Steve Rapaport

I second that question.  I asked 2 months ago and got no reply.

>
> Some of the missing scripts (sendgt and sendrt - send logo and ringtone)
>would be very helpful...
>
>Best regards,
>
>miguel vitorino
>
>
>

-- 
Steve Rapaport
Under Construction







php-admin/send*.php

2001-11-19 Thread Miguel Vitorino

 Hi!

 Does anyone know what's the status of contrib/php-admin scripts? In the
last CVS, some of the send*.php scripts are missing and I didn't found a
reference to the person(s) responsible for development.
 Some of the missing scripts (sendgt and sendrt - send logo and ringtone)
would be very helpful...

Best regards,

miguel vitorino