forked from jens-maus/fritzbox_api_php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfritzbox_diversity0on.php
More file actions
37 lines (32 loc) · 859 Bytes
/
fritzbox_diversity0on.php
File metadata and controls
37 lines (32 loc) · 859 Bytes
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
<?php
$diversity = 0; // set to the interlan ID of the call diversion, the first one has ID 0;
$mode = 1; // set the mode to 0 or 1 do disable or enable the call diversion
try
{
// load the fritzbox_api class
require_once('fritzbox_api.class.php');
$fritz = new fritzbox_api();
// init the output message
$message = date('Y-m-d H:i') . ' ';
// update the setting
$formfields = array(
'getpage' => '../html/de/menus/menu2.html',
'telcfg:settings/Diversity' . $diversity . '/Active' => $mode,
);
$fritz->doPostForm($formfields);
}
catch (Exception $e)
{
$message .= $e->getMessage();
}
// log the result
if ( isset($fritz) && is_object($fritz) && get_class($fritz) == 'fritzbox_api' )
{
$fritz->logMessage($message);
}
else
{
echo($message);
}
$fritz = null; // destroy the object to log out
?>