Debian Codegraph @

contrib/php-admin/sendota.php

raw
1 <html>
2 <head>
3 <title>SMS OTA Message Sender</title>
4 </head>
5 <body bgcolor="#FFFFFF" text="#000000">
6
7 <?php
8 include("config.inc");
9 include("functions.inc");
10
11 if ($submit)
12 {
13 $text = "%01%06%04%03%94%81%EA%00%01%45%C6%06%01%87%12";
14 $text .= (strcasecmp($connection,"data") == 0) ? "%45" : "%FF";
15 $text .= "%01";
16 $text .= "%87%13%11%03";
17 $text .= octstr_append_cstr($otaip);
18 $text .= "%00%01";
19 $text .= "%87%14";
20 $text .= (strcasecmp($bearer,"Cont") == 0) ? "%60" : "%61";
21 $text .= "%01";
22 $text .= "%87%21%11%03";
23 $text .= octstr_append_cstr($otaphone);
24 $text .= "%00%01";
25 $text .= "%87%22";
26 $text .= (strcasecmp($otauth,"secure") == 0) ? "%71" : "%70";
27 $text .= "%01";
28 $text .= "%87%23%11%03";
29 $text .= octstr_append_cstr($otalogin);
30 $text .= "%00%01";
31 $text .= "%87%24%11%03";
32 $text .= octstr_append_cstr($otapassword);
33 $text .= "%00%01";
34 $text .= "%87%28";
35 $text .= (strcasecmp($calltype,"isdn") == 0) ? "%73" : "%FF";
36 $text .= "%01";
37 $text .= "%87%29";
38 $text .= (strcasecmp($speed,"9600") == 0) ? "%6B" : "%6C";
39 $text .= "%01%01";
40 $text .= "%86%07%11%03";
41 $text .= octstr_append_cstr($otalocation);
42 $text .= "%00%01";
43 $text .= "%C6%08%01";
44 $text .= "%87%15%11%03";
45 $text .= octstr_append_cstr($otaservice);
46 $text .= "%00%01";
47 $text .= "%01%01";
48
49 $URL = "/cgi-bin/sendsms?username=".USERNAME."&password=".PASSWORD."&from=".GLOBAL_SENDER."&to=$to&udh=%06%05%04%C3%4F%C0%02&text=$text";
50 echo "Sending the OTA SMS Text message <b>\"$text\"</b> (length: ".strlen($text).") to the phone <b>$to</b>...<br>\n";
51 http_send($URL,SENDSMS_PORT);
52 echo "<address><a href=\"$PHP_SELF\">Back to Send OTA SMS Message</a></address>\n";
53
54 } else {
55
56 ?>
57
58 <h1>OTA SMS Message Sender</h1>
59 <form name="sendota" method="post" action="<?php echo "$PHP_SELF" ?>">
60 <p>
61 Telephone number:
62 <br>
63 <input type="text" size="30" name="to">
64 </p>
65 <p>
66 Configuration:
67 <table border=0>
68 <tr><td>Location:</td><td><input type="text" size="30" name="otalocation"> <i>(ie. http://wap.yoursite.com)</i></td></tr>
69 <tr><td>Service Name:</td><td><input type="text" size="30" name="otaservice"> <i>(ie. You Wapsite)</i></td></tr>
70 <tr><td>IP address:</td><td><input type="text" size="30" name="otaip"> <i>(ie. 192.168.1.1)</i></td></tr>
71 <tr><td>Phone number:</td><td><input type="text" size="30" name="otaphone"> <i>(ie. 4512345678)</i></td></tr>
72 <tr><td>Bearer type:</td><td><select name="bearer"><option name="data" selected>data<option name="sms">SMS</select> <i>(ie. data)</i></td></tr>
73 <tr><td>Connection type:</td><td><select name="connection"><option name="temp" selected>Temp<option name="cont">cont</select> <i>(ie. temp)</i></td></tr>
74 <tr><td>Call type:</td><td><select name="calltype"><option name="ISDN" selected>ISDN<option name="Analog">Analog</select> <i>(ie. ISDN)</i></td></tr>
75 <tr><td>Speed:</td><td><select name="speed"><option name="9600" selected>9600<option name="14400">14400</select> <i>(ie. 9600)</i></td></tr>
76 <tr><td>PPP security:</td><td><select><option name="Off" selected>Off<option name="On">On</select> <i>(ie. Off)</i></td></tr>
77 <tr><td>Authentication:</td><td><select name="otaauth"><option name="Normal" selected>Normal<option name="Secure">Secure</select> <i>(ie. Normal)</i></td></tr>
78 <tr><td>Login:</td><td><input type="text" size="30" name="otalogin"> <i>(ie. login)</i></td></tr>
79 <tr><td>Password:</td><td><input type="password" size="30" name="otapassword"> <i>(ie. secret)</i></td></tr>
80 </table>
81 </p>
82 <input type="submit" value="Send Message" name="submit">
83 <input type="reset" value="Reset">
84 <br>
85 </form>
86
87 <?php
88 }
89 ?>
90
91 <p>
92 </p>
93 <hr>
94 <table border="0" width="100%">
95 <tr>
96 <td width="50%"><address><a href="index.html">Back to admin</a></address></td>
97 <td width="50%" align="right"><address>Visit the Kannel homepage at <a href="http://www.kannel.org">www.kannel.org</a>.</address></td>
98 </tr>
99 </table>
100 </body>
101 </html>