|
MCC/MNC codes are mobile country and network
operator codes.
The submitting script I use for my scripts looks
smth like this :
<table>
<tr><td bgcolor=fefefe>Id:</td>
<td colspan=2><input size=60 name=id
value=0001></td></tr>
<tr><td bgcolor=fefefe>To:</td>
<td colspan=2><input size=60 name=to
value=1234></td></tr>
<tr><td
bgcolor=fefefe>Validity:</td> <td colspan=2><input size=60
name=validity value=10></td></tr>
<tr><td
bgcolor=fefefe>Type:</td><td colspan=2><select
name=type>
<OPTION VALUE=text
SELECTED>text <OPTION VALUE=operator>Operator Logo <OPTION
VALUE=group>Group Logo <OPTION VALUE=ringtone>Ring
Tone <OPTION VALUE=picture>Picture <OPTION VALUE=clean>Restore
logo<OPTION VALUE=vcard>vCard<OPTION
VALUE=vcalendar>vCalendar</SELECT></td></tr>
<tr><td bgcolor=fefefe>Data:</td>
<td colspan=2><textarea cols="60" name="text" rows=4
wrap=virtual></textarea></td></tr>
<tr><td>MCC</td>
<td><input size=3 name=mcc
value=234></td> <tr><td>MNC</td>
<td><input size=3 name=mnc
value=15></td> <tr><td>RouteTo</td>
<td><input size=7 name=RouteTo
value=kstream0></td> <td><input type=submit
value="Send"></td></tr>
</form>
</table>
in the above, mcc/mnc are set for Vodafone
UK.
----- Original Message -----
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
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
|