1 package GSM::SMS::OTA::Config;
8 @EXPORT = qw( OTA_BEARER_CSD
10 OTA_CONNECTIONTYPE_TEMPORARY
11 OTA_CONNECTIONTYPE_CONTINUOUS
15 OTA_CSD_CALLTYPE_ANALOGUE
16 OTA_CSD_CALLSPEED_9600
17 OTA_CSD_CALLSPEED_AUTO
18 OTA_CSD_CALLSPEED_14400
23 sub OTAConfig_makestream {
24 my ($bearer, $connection, $auth, $type, $speed, $proxy, $home, $uid, $pwd, $phone, $name) = @_;
28 if ( $bearer eq "CSD" ) {
29 $_bearer = OTA_BEARER_CSD;
31 elsif ( $bearer eq "SMS" ) {
32 $_bearer = OTA_BEARER_SMS;
35 # print "Unknown bearer type: $bearer!\n";
41 if ( $connection eq "TEMPORARY" ) {
42 $_connection = OTA_CONNECTIONTYPE_TEMPORARY;
44 elsif ( $connection eq "CONTINUOUS" ) {
45 $_connection = OTA_CONNECTIONTYPE_CONTINUOUS;
48 # print "Unknown connection type: $connection!\n";
54 if ( $auth eq "PAP" ) {
55 $_auth = OTA_CSD_AUTHTYPE_PAP;
57 elsif ( $auth eq "CHAP" ) {
58 $_auth = OTA_CSD_AUTHTYPE_CHAP;
61 # print "Unknwon authentication type: $auth!\n";
67 if ( $type eq "ISDN" ) {
68 $_type = OTA_CSD_CALLTYPE_ISDN;
70 elsif ( $type eq "ANALOGUE" ) {
71 $_type = OTA_CSD_CALLTYPE_ANALOGUE;
74 # print "Unknown calltype: $type!\n";
80 if ( $speed eq "9600" ) {
81 $_speed = OTA_CSD_CALLSPEED_9600;
83 elsif ( $speed eq "AUTO" ) {
84 $_speed = OTA_CSD_CALLSPEED_AUTO;
86 elsif ( $speed eq "14400" ) {
87 $_speed = OTA_CSD_CALLSPEED_14400;
90 # print "Unknown speed: $speed!\n";
95 # We do not check the other parameters
97 my $ota = OTAmakestream(
129 my $_PROXY = OTAencode_8bit( $PROXY );
130 my $_CSD_DIALSTRING = OTAencode_8bit( $CSD_DIALSTRING );
131 my $_CSD_AUTHNAME = OTAencode_8bit( $CSD_AUTHNAME );
132 my $_CSD_AUTHSECRET = OTAencode_8bit( $CSD_AUTHSECRET );
133 my $_URL = OTAencode_8bit( $URL );
134 my $_NAME = OTAencode_8bit( $NAME );
148 018714${CONNECTIONTYPE}
151 018722${CSD_AUTHTYPE}
156 018728${CSD_CALLTYPE}
157 018729${CSD_CALLSPEED}
174 # constant definition
175 use constant OTA_BEARER_CSD => '45';
176 use constant OTA_BEARER_SMS => '41';
177 use constant OTA_CONNECTIONTYPE_TEMPORARY => '60';
178 use constant OTA_CONNECTIONTYPE_CONTINUOUS => '61';
179 use constant OTA_CSD_AUTHTYPE_PAP => '70';
180 use constant OTA_CSD_AUTHTYPE_CHAP => '71';
181 use constant OTA_CSD_CALLTYPE_ISDN => '73';
182 use constant OTA_CSD_CALLTYPE_ANALOGUE => '72';
183 use constant OTA_CSD_CALLSPEED_9600 => '6B';
184 use constant OTA_CSD_CALLSPEED_AUTO => '6A';
185 use constant OTA_CSD_CALLSPEED_14400 => '6C';
186 use constant OTAConfig_PORT => 49999;
194 while (length($ud)) {
195 $msg .= pack('H2',substr($ud,0,2));
206 while (length($ud)) {
207 $msg .= sprintf("%.2X", ord(substr($ud,0,1)));
218 GSM::SMS::OTA::Config
222 Create an "over the air" configuration message to configure a WAP telephone with a proper setting. I only tested this one on Nokia phones (7110). This is very useful to "bulk configurate" WAP telephones.
226 =head2 OTAConfig_makestream
228 $stream = OTAConfig_makestream(
246 TEMPORARY | CONTINUOUS
258 IP address of wap gateway to use
264 Username for dialin authentication
267 Password for dialin authentification
270 Phone number to dial for dial-in connection
273 Nick name you can give for this connection
277 Johan Van den Brande <johan@vandenbrande.com>