-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
179 lines (137 loc) · 4.12 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
//
// Beispiele für die verwendung der Fritz Klasse
//
include( 'fritz.php' );
$fritz = new Fritz( '192.168.178.1', 'fritzpasswd' ); // simple instanciating (default username fritz-api)
//$fritz = new Fritz( '192.168.178.1', 'fritzpasswd', 'fritzuser' ); // instanciating with username
//
// call forwarding to number
//
//$backurl = '';
//$uid = 'rul_0'; // rul_0 für ersten eintrag, rul_1 für zweiten, etc
//$number = '0531123123123'; // destination number
//$callerid = 'SIP5';
//echo "Enable rul for num ($number): ";
// Tamper data from fritzbox to find your values!
//$data = array(
// 'mode_new' => 'all',
// 'call_to_sel' => 'tochoose',
// 'num_from' => '',
// 'unknown_num' => 'tochoose',
// 'destination' => 'phone',
// 'num_dest_sel' => 'new_num',
// 'num_dest' => $number, // zielrufnummer
// 'num_out' => '*',
// 'type_action' => '0',
// 'type_diversion' => '0',
// 'apply' => '',
// 'back_to_page' => $backurl,
// 'is_new' => 'false',
// 'uid' => $uid,
// 'caller_id' => $callerid,
// 'mode' => 'call_to',
// 'rul_type' => 'rul'
//);
//echo (int) $fritz->setFormData( "/fon_num/rul_edit.lua", $data );
//
// Rufumleitung auf bekannte Nummer einschalten
//
//$formurl = $fritz->buildUrl( "/fon_num/rul_edit.lua" ); // fon_num/rul_edit.lua
//$backurl = '';
//$uid = 'rul_0'; // rul_0 für ersten eintrag, rul_1 für zweiten, etc
//$number = '0531123123123'; // destination number
//$callerid = 'SIP5';
//echo "Enable rul for num ($number): ";
//$data = array(
// 'mode_new' => 'all',
// 'call_to_sel' => 'tochoose',
// 'num_from' => '',
// 'unknown_num' => 'tochoose',
// 'destination' => 'phone',
// 'num_dest_sel' => '32_0',
// 'num_dest' => $number, // zielrufnummer
// 'num_out' => '*',
// 'type_action' => '0',
// 'type_diversion' => '0',
// 'apply' => '',
// 'back_to_page' => $backurl,
// 'is_new' => 'false',
// 'uid' => $uid,
// 'caller_id' => $callerid,
// 'mode' => 'call_to',
// 'rul_type' => 'rul'
//);
//echo (int) $fritz->setFormData( "/fon_num/rul_edit.lua", $data );
//
// Rufumleitung ausschalten (alle!)
//
//echo "Disable rul: ";
//$data = array(
// 'apply' => '',
// 'back_to_page' => ''
//);
//echo (int) $fritz->setFormData( "/fon_num/rul_list.lua", $data );
//
// Rufumleitung ausschalten (nur die erste)
//
echo "Disable rul: ";
$data = array(
'rul_1' => 'on',
'apply' => '',
'back_to_page' => ''
);
echo (int) $fritz->setFormData( "/fon_num/rul_list.lua", $data );
//// GetInfo (string)
//echo "Model: " . $fritz->getInfo( 'model' ) . "<br />"; // Get FritzBox Model
//echo "Serial: " . $fritz->getInfo( 'serial' ) . "<br />"; // Get FritzBox Serialnumber
//echo "Version: " . $fritz->getInfo( 'version' ) . "<br />"; // Get FritzBox Software-Version
//echo "Uptime: " . $fritz->getInfo( 'uptime' ) . "<br />"; // Get FritzBox Uptime
//echo "Log: <br />" . $fritz->getInfo( 'log', 10 ) . "<br />"; // Get FritzBox last 17 lines
// Last reconnect (datetime)
//echo $fritz->getLastConnection() . " Uhr";
//echo '<br />';
// Downlink speed (float)
//echo $fritz->getDownSpeed() . " Mbit/s Down";
//echo '<br />';
// Uplink speed (float)
//echo $fritz->getUpSpeed() . " Mbit/s Up";
//echo '<br />';
// Get sid (string)
// echo $fritz->getSID();
// Get WAN status (array)
//echo '<pre>';
//print_r( $fritz->statusWAN() );
//echo '</pre>';
// Get Callerlist (array)
//echo '<pre>';
//print_r( $fritz->getCallerlist() );
//echo '</pre>';
// Get Phonebook (array)
//echo '<pre>';
//print_r( $fritz->getPhonebook() );
//echo '</pre>';
// Anrufbeantworter Ein/Ausschalten
//$fritz->setTam( 'on' ); // Einschalten
//$fritz->setTam( 'off' ); // Ausschalten
// Anrufbeantworter Anruferliste (array)
//echo '<pre>';
//print_r( $fritz->getTamList() );
//echo '</pre>';
// Wifi 2.4 GHz
//$fritz->setWifi( true, '2.4' ); // Einschalten
//$fritz->setWifi( false, '2.4' ); // Ausschalten
// Wifi 5 GHz
//$fritz->setWifi( true, '5' ); // Einschalten
//$fritz->setWifi( false, '5' ); // Ausschalten
// Guest-Wifi
//$fritz->guestWifi( true ); // Einschalten
//$fritz->guestWifi( false ); // Ausschalten
//
// Use this commands with care!!
//
// Reconnect
//$fritz->reconnectDSL();
// Reboot
//$fritz->reboot();
?>