Initial mod_perl-2.0 port.
[www.jankratochvil.net.git] / etmms / Index.pm
1 # $Id$
2 # Contact page Perl template.
3 # Copyright (C) 2003-2005 Jan Kratochvil <project-www.jankratochvil.net@jankratochvil.net>
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; exactly version 2 of June 1991 is required
8
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 # GNU General Public License for more details.
13
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17
18
19 package etmms::Index;
20 require 5.6.0;  # at least 'use warnings;' but we need some 5.6.0+ modules anyway
21 use vars qw($VERSION $CVS_ID);
22 $VERSION=do { my @r=(q$Revision$=~/\d+/g); sprintf "%d.".("%03d"x$#r),@r; };
23 $CVS_ID=q$Id$;
24 use strict;
25 use warnings;
26
27 use My::Web;
28 require CGI;
29 Wrequire 'project::Lib';
30
31
32 sub handler
33 {
34 my $W=My::Web->init(
35                 "title"=>"MMS Center Debugging",
36                 );
37 My::Web->heading();
38
39
40 sub project ($)
41 {
42 my($name)=@_;
43
44         my $name_item=project::Lib->name_to_hashref($name);
45         return a_href "/project/$name/",$name_item->{"name"}.': '.$name_item->{"summary"};
46 };
47
48
49 print <<"HERE";
50 <h1>MMS Center Debugging</h1>
51
52 <p>Here you can find description of very simple but technically interesting hack.
53 You can provide your own MMS Center (MMS=Multimedia Messaging Service) in GSM
54 network instead of the operator's one.</p>
55
56 <p>There is only a limitation of a bearer data service - MMS is usually run
57 over GPRS (General Packet Radio Service) channels while you cannot behave as
58 GPRS callee in GSM network. Fortunately MMS can be run also over CSD (Circuit
59 Switched Data - up to 14400bps) or HSCSD (High Speed CSD - up to 57600bps)
60 services. GPRS is usually known as always-online while CSD/HSCSD you must dial
61 some destination number. GPRS vs. CSD have usually also different GSM operator
62 tariffication but it should not matter much for the short data messages.</p>
63
64 <p>I did not provite a completely mine MMS center. I was involved in pilot MMS
65 Center project where some compatibility issues of MMS message format between
66 MMS phone and MMS center had to be solved. As I did not have technical access
67 to the MMS center itself I setup two mobile phones
68 (@{[ a_href 'http://www.nokia.com/','Nokia' ]} @{[ a_href 'http://www.communicator.org/','Communicator' ]}s)
69 to setup sniffing tunnel. One of the phones were setup in answer mode to
70 simulate the MMS center while the other one called to the real official (and
71 buggy) MMS center accessible as regular service provided by the GSM operator.</p>
72
73 @{[ centerimg 'gate','MMS Sniffing Diagram' ]}
74 @{[ vskip "2ex" ]}
75 @{[ centerimg 'triple.jpeg','MMS Sniffing Mobiles Setup' ]}
76
77 <dl>
78         <dt>Answer side <i>pppd(8)</i> command</dt>
79         <dd><pre>
80 pppd /dev/ttyS5 19200 modem lock crtscts connect "chat -vf /etc/ppp/answer-T68i.chat" @{[ "\\" ]}
81                 noauth debug nodefaultroute 192.168.192.67:192.168.192.68 default-asyncmap
82         </pre></dd>
83         <dt>Answer side <i>/etc/ppp/answer-T68i.chat</i> file</dt>
84         <dd><pre>
85 TIMEOUT 3 "" "ATZ" "OK-ATZ-OK" "" ABORT "BUSY" ABORT "NO CARRIER"
86 ABORT "NO DIAL TONE" ABORT "ERROR" ABORT "VOICE" REPORT CONNECT ""
87 ATL2 OK-ATL2-OK
88 AT+CBST=7,0,1;+DS=3,0,1300,32;+CR=1;+DR=1 OK
89 ""
90 TIMEOUT 300
91 @{[ 'RING \d\d\d\d\d\dATA' ]}
92 CONNECT "" ^M ""
93         </pre></dd>
94
95         <dt>Dial side <i>pppd(8)</i> command</dt>
96         <dd><pre>
97 pppd /dev/ttyS4 19200 modem lock nocrtscts xonxoff connect "chat -vf /etc/ppp/mmsgate.chat" @{[ "\\" ]}
98                 noauth debug nodefaultroute
99         </pre></dd>
100         <dt>Answer side <i>/etc/ppp/mmsgate.chat</i> file</dt>
101         <dd><pre>
102 TIMEOUT 3 "" "ATZ" "OK-ATZ-OK" "" ABORT "BUSY" ABORT "NO CARRIER"
103 ABORT "NO DIAL TONE" ABORT "ERROR" ABORT "VOICE" REPORT CONNECT ""
104 #AT+CBST=7,0,1;+DS=3,0,1300,32;+CR=1;+DR=1 OK
105 ATD+420602900666
106 TIMEOUT 90 CONNECT "" ^M ""
107         </pre></dd>
108 </dl>
109
110 <p>Some decoded data illustration</p>
111 <pre>
112 MMS Message Encapsulation
113         Message-Type: m-retrieve-conf (0x84)
114         Transaction-ID: PVve-6DaCUEAAC5qAAAAAQAAAEoAAAAA
115         MMS-Version: 1.0
116         Date: Aug 15, 2002 19:25:20.000000000
117         From: +4206CENSORED/TYPE=PLMN
118         Subject: testidD
119         To: +4206CENSORED/TYPE=PLMN
120         Message-Class: Informational (0x82)
121         Delivery-Report: No (0x81)
122         Content Type: application/vnd.wap.multipart.related (0x33)
123                 Type: application/smil
124                 Start: AAAA
125         Multipart body
126                 Part: 1
127                         Content Type: application/smil
128                                 Charset: us-ascii (0x0003)
129                         Headers
130                                 Content-Location: AAAA
131                         Data in this part
132                 Part: 2
133                         Content Type: image/gif (0x1d)
134                         Headers
135                                 Content-Location: postcard.gif
136                         Data in this part
137 </pre>
138
139 <p>@{[ a_href 'http://www.sonyericsson.com/T68i/','Sony Ericsson T68i' ]}
140 MMS definition file URL decoded out of the data stream above:
141 @{[ a_href 'http://wap.sonyericssonmobile.com/UAprof/T68R201.xml' ]}</p>
142
143
144 <h2>Completed Subtasks</h2>
145 <ul>
146         <li style="font-size: larger;">@{[ project 'etherealmmse' ]}</li>
147         <li style="font-size: larger;">@{[ project 'etherealwsp' ]}</li>
148 </ul>
149
150 HERE
151
152
153 My::Web->footer();
154 }
155 1;