Example #1
0
 //call forward config
 if (permission_exists('call_forward')) {
     $call_forward = new call_forward();
     $call_forward->domain_uuid = $_SESSION['domain_uuid'];
     $call_forward->domain_name = $_SESSION['domain_name'];
     $call_forward->extension_uuid = $extension_uuid;
     $call_forward->accountcode = $accountcode;
     $call_forward->forward_all_destination = $forward_all_destination;
     $call_forward->forward_all_enabled = $forward_all_enabled;
     $call_forward->forward_caller_id_uuid = $forward_caller_id_uuid;
     //$call_forward->set();
     //unset($call_forward);
 }
 //do not disturb (dnd) config
 if (permission_exists('do_not_disturb')) {
     $dnd = new do_not_disturb();
     $dnd->domain_uuid = $_SESSION['domain_uuid'];
     $dnd->domain_name = $_SESSION['domain_name'];
     $dnd->extension_uuid = $extension_uuid;
     $dnd->enabled = $dnd_enabled;
     //$dnd->set();
     //$dnd->user_status();
     //unset($dnd);
 }
 //if follow me is enabled then process it last
 if ($follow_me_enabled == "true") {
     //call forward
     $call_forward->set();
     unset($call_forward);
     //dnd
     $dnd->set();
Example #2
0
 //hunt_group information used to determine if this is an add or an update
 $sql = "select * from v_hunt_groups ";
 $sql .= "where domain_uuid = '{$domain_uuid}' ";
 $sql .= "and hunt_group_extension = '{$extension}' ";
 $prep_statement_2 = $db->prepare(check_sql($sql));
 $prep_statement_2->execute();
 $result2 = $prep_statement_2->fetchAll(PDO::FETCH_NAMED);
 foreach ($result2 as &$row2) {
     if ($row2["hunt_group_type"] == 'dnd') {
         $dnd_action = "update";
         $dnd_uuid = $row2["hunt_group_uuid"];
     }
 }
 unset($prep_statement_2, $result, $row2);
 //add or update dnd
 $dnd = new do_not_disturb();
 $dnd->domain_uuid = $domain_uuid;
 $dnd->dnd_uuid = $dnd_uuid;
 $dnd->domain_name = $_SESSION['domain_name'];
 $dnd->extension = $extension;
 if ($user_status == "Do Not Disturb") {
     $dnd->enabled = "true";
 } else {
     //for other status disable dnd
     if ($dnd_action == "update") {
         $dnd->enabled = "false";
     }
 }
 //$dnd->debug = false;
 $dnd->set();
 unset($dnd);