Re: OTA MMS Settings
Bruno Rodrigues <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <1039354473.27699.20.camel@localhost> |
On Dom, 2002-12-08 at 09:22, Andreas Fink wrote:
> On Sonntag, Dezember 8, 2002, at 01:30 Uhr, Bruno Rodrigues wrote:
>
> > Yes, they do.
> >
> > We are provisioning MMSC OTA to Ericsson T68 and every Nokia that
> > supports MMS (3510, 7650, 7210, etc).
> >
> > I can send some examples if required.
>
> yes. we're interested in examples.
>
> Are they the same for different models?
As I said before, I'm using my own php scripts to build the ota
binary (the ones I've commited to contrib). I don't remember if I've
updated those with the MMSURL, but it's a small patch (just need to
say to my script that mmsurl is tag 87, I guess).
The MMS OTA is the same for nokia and T68.
There were some issues with it. I guess I had to
set MMSURL for T68 AND URL for Nokia 7650.
The dump:
# mms.dump
01062C1F2A6170706c69636174696f6e2f782d7761702d70726f762e62726f777365722d73657474696e67730081EA01016A0045C60801
871511034d4d5300010186071103687474703a2f2f6d6d732f736572766c6574732f6d6d730001867C1103687474703a2f2f6d6d732f73
6572766c6574732f6d6d730001C67F01871511032d000187171103687474703a2f2f6d6d732f736572766c6574732f6d6d73000101C606
0187124901871311033231332e33302e32372e3633000187146101871C11037661732e766f6461666f6e652e7074000187227001872311
0376617300018724110376617300010101
I'm returning the OTA with a perl script,in reply to a MO sms, like
this:
#!/usr/bin/perl
... check keyword and read the corresponding file ...
open(FILE, "$prefix/$msg.dump");
@file= <FILE>;
close(FILE);
$file[0] = pack("H*", $file[0]);
$lf = "\n";
$udh="060504C34F0000";
print "X-Kannel-UDH: ". $udh. $lf;
print "X-Kannel-Coding: 2". $lf;
print "Content-Type: application/octet-stream".$lf;
print $lf;
print $file[0];
The variables I set are:
# mms.data
file=mms
name=MMS
urlname=-
url=http://mms/servlets/mms
mmsurl=http://mms/servlets/mms
bearer=49
ppp_authtype=70
ppp_authname=user
ppp_authsecret=pass
proxy=1.2.3.4
port=61
gprs_accesspointname=foo.vodafone.pt
The script I'm using to write the mms.data and
mms.dump is attached
PS: my php to send wappush si stopped working in here. I haven't changed
my code, so I guess something happened to smsc configuration.
Can you send me and example (kannel.conf, cmd line and xml files) to
send a wappush (text + urllink) through kannel interface ?
--
Bruno Rodrigues <[email protected]>
write.php
(application/x-php, 5 KB)
<?require("config.php");?>
<?
if ( preg_match("/[^a-z0-9A-Z]/", $file)) {
print "Invalid filename";
sai();
}
if ( $apagar != "" ) {
if ( file_exists("$DIR/$file.dump")) {
unlink("$DIR/$file.dump");
}
if ( file_exists("$DIR/$file.dat")) {
unlink("$DIR/$file.data");
}
print "Configuration Deleted";
sai();
}
$string="";
while(list($k,$v) = each($_GET)) {
if ( $v != "" ) {
$fields[$k]= "$v";
}
}
while(list($k,$v) = each($_POST)) {
if ( $v != "" ) {
$fields[$k]= "$v";
#print "$k=$v";
}
}
@rename("$DIR/$file.data", "$DIR/backup/$file.data.".time());
$h = fopen("$DIR/$file.data", "w+");
while(list($k,$v) = each($fields)) {
if ($v != "" && $v != "0") {
#print "$k=$v<br>";
fwrite($h, "$k=$v\n");
}
}
fclose($h);
if ( $fields['debug'] + 0 != "0" ) {
$debug = 1;
} else $debug=0;
$fields['debug'] = "";
#$fields['name'] = urlencode($fields['name']);
#$fields['url'] = urlencode($fields['url']);
$fields['text'] = "";
$fields['text'] .= "%01"; # Transaction ID / Push ID
$fields['text'] .= "%06"; # PDU Type (Push)
$fields['text'] .= "%2C"; # Headers Lenght (content-type + headers)
$fields['text'] .= "%1F"; # ? Length
$fields['text'] .= "%2A" . encode("application/x-wap-prov.browser-settings") . "%00" ; # Content-Type
$fields['text'] .= "%81%EA"; # charset = UTF-8
$fields['text'] .= "%01"; # Version WBXML 1.1
$fields['text'] .= "%01"; # Unknown Public Identifier
$fields['text'] .= "%6A"; # Charset UTF-8
$fields['text'] .= "%00"; # String table lenght
$params = array ( "bearer" => "12", "proxy" => "13", "port" => "14", "name" => "15", "proxy_type" => "16", "url" => "17", "proxy_authname" => "18", "proxy_authsecret" => "19", "sms_smsc_address" => "1A", "ussd_service_code" => "1B", "gprs_accesspointname" => "1C", "ppp_logintype" => "1D", "proxy_logintype" => "1E", "csd_dialstring" => "21", "csd_calltype" => "28", "csd_callspeed" => "29", "ppp_authtype" => "22", "ppp_authname" => "23", "ppp_authsecret" => "24", "mmsurl" => "7C");
$params_with_attr = array ( "bearer", "port", "proxy_type", "ppp_logintype", "proxy_logintype", "csd_calltype", "csd_callspeed", "ppp_authtype");
$fields['text'] .= "%45"; # <CHARACTERISTIC_LIST>
if ( $fields['name'] != "" ) {
$fields['text'] .= "%C6%08%01"; # <CHARACTERISTIC TYPE="NAME">
$fields['text'] .= "%87%15%11"; # <PARM NAME="NAME" VALUE=...
$fields['text'] .= "%03" . encode($fields['name']) ."%00"; # ..."$name"...
$fields['text'] .= "%01"; # .../>
$fields['text'] .= "%01"; # </CHARACTERISTIC>
}
if ( $fields['url'] != "" ) {
$fields['text'] .= "%86%07%11"; # <CHARACTERISTIC TYPE="URL" VALUE=...
$fields['text'] .= "%03" . encode($fields['url']) ."%00"; # ..."$name"...
$fields['text'] .= "%01"; # </CHARACTERISTIC>
}
if ( $fields['mmsurl'] != "" ) {
$fields['text'] .= "%86%7C%11"; # <CHARACTERISTIC TYPE="URL" VALUE=...
$fields['text'] .= "%03" . encode($fields['mmsurl']) ."%00"; # ..."$name"...
$fields['text'] .= "%01"; # </CHARACTERISTIC>
$fields['mmsurl'] = "";
}
if ($fields['name'] != "" && $fields['url'] != "") {
$fields['text'] .= "%C6%7F%01"; # <CHARACTERISTIC TYPE="BOOKMARK">
$fields['text'] .= "%87%15%11"; # <PARM NAME="NAME" VALUE=...
$fields['text'] .= "%03" . encode($fields['urlname']) ."%00"; # ..."$name"...
$fields['text'] .= "%01"; # .../>
$fields['text'] .= "%87%17%11"; # <PARM NAME="URL" VALUE=...
$fields['text'] .= "%03" . encode($fields['url']) ."%00"; # ..."$name"...
$fields['text'] .= "%01"; # .../>
$fields['text'] .= "%01"; # .../>
}
$fields['name'] = "";
$fields['url'] = "";
$fields['text'] .= "%C6%06%01"; # <CHARACTERISTIC TYPE="ADDRESS">
while(list($key, $val) = each($params)) {
if ( $fields[$key] != "" && $fields[$key] != "0" ) {
$fields['text'] .= "%87"; # <PARM> with attributes
$fields['text'] .= "%".$val; # NAME=
if ( in_array($key, $params_with_attr) ) {
$fields['text'] .= "%" . $fields[$key]; # VALUE=CODE
} else {
$fields['text'] .= "%11"; # VALUE=
$fields['text'] .= "%03". encode($fields[$key]) . "%00"; # STRING
}
$fields['text'] .= "%01"; # </PARM>
}
$fields[$key] = "";
}
$fields['text'] .= "%01"; # </CHARACTERISTIC>
$fields['text'] .= "%01"; # </CHARACTERISTIC_LIST>
$fields['text'] = preg_replace("/%(..)/", "$1", $fields['text']);
@rename("$DIR/$file.dump", "$DIR/$file.dump.".time());
$h=fopen("$DIR/$file.dump", "w+");
fwrite($h, $fields['text']);
fclose($h);
print "File '$file' Saved...";
function encode($string) {
$string=join("", unpack("H*", $string));
$string=preg_replace("/(..)/", "%$1", $string);
return $string;
}
sai();
function sai() {
?>
<script>
parent.frames['otamenu'].location=("menu.php?<?=time();?>");
</script>
<?php
exit;
}
?>
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQA980ppbMTNtJey1hkRAhZVAJ9X2nqkV7L3YL1Gu/m90cmGJhVi9wCfbN4l 5J3uzDKcDiGUrOZpgu/uIW4= =vipa -----END PGP SIGNATURE-----