2
0
mirror of https://github.com/ACSPRI/queXS synced 2024-04-02 12:12:16 +00:00

Set VoIP status in database functions

This commit is contained in:
azammitdcarf
2010-08-31 00:51:07 +00:00
parent 02b84a2dd0
commit d88f03d974
2 changed files with 26 additions and 4 deletions

View File

@@ -537,6 +537,28 @@ function get_call_number($call_id)
return false;
}
/**
* Set the extension status in the database
*
* @param int $operator_id The queXS Operator ID
* @param bool the extension status (false for offline, true for online)
*
*/
function set_extension_status($operator_id,$online = true)
{
global $db;
$s = 0;
if ($online) $s = 1;
$sql = "UPDATE `operator`
SET voip_status = '$s'
WHERE operator_id = '$operator_id'";
$db->Execute($sql);
}
/**
* Return the extension status from the database
*

View File

@@ -433,13 +433,13 @@ class voipWatch extends voip {
}
function setExtensionStatus($ext, $online = true)
function setExtensionStatus($ext, $online = true, $msg = false)
{
global $db;
$s = $online ? 1 : 0;
print(T_("Extension") . " $ext " . ($online ? T_("online") : T_("offline")) . "\n");
if ($msg) print(T_("Extension") . " $ext " . ($online ? T_("online") : T_("offline")) . "\n");
$sql = "UPDATE operator
SET voip_status = '$s'
@@ -483,9 +483,9 @@ class voipWatch extends voip {
$s = $this->getExtensionStatus($e);
if ($s == false)
$this->setExtensionStatus($e,false);
$this->setExtensionStatus($e,false,true);
else
$this->setExtensionStatus($e,true);
$this->setExtensionStatus($e,true,true);
}
}