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 "<p>$error_description ($error_number)<br>\n";
//  echo "The SMS message was NOT sent!</p>\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("06050415820000");
        $text="00000000000001";
        break;
    case "operator":
        $udh="&udh=".symbolize("06050415820000");
        $text=$code."00480E01".$text;
        break;
    case "group":
        $udh="&udh=".symbolize("06050415830000");
        $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="0B0504158A00000003010".$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="0B0504158100000003AA0".$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="0B0504158A00000003010".$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("06050423F40000");
        break;   
    case "vcalendar":
        $udh="&udh=".symbolize("0B050423F5000000");
        break;               
}
if ($udh) $data="symbolize($text);else
$data="urlencode($text);       "

Hope this helps someone.
Bye.
----- Original Message -----
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 it
will for that other guy (miguel) who is asking.

Thanks for the convertors, I think I have a use for those!

-steve

Alexei Pashkovsky wrote:
those are obsolete.


----- Original Message -----
From: "Steve Rapaport" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 19, 2001 7:49 PM
Subject: 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 Rapaport
Under Construction







-- 
Steve Rapaport
Under Construction

Reply via email to