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:
@@ -537,6 +537,28 @@ function get_call_number($call_id)
|
|||||||
return false;
|
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
|
* Return the extension status from the database
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -433,13 +433,13 @@ class voipWatch extends voip {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function setExtensionStatus($ext, $online = true)
|
function setExtensionStatus($ext, $online = true, $msg = false)
|
||||||
{
|
{
|
||||||
global $db;
|
global $db;
|
||||||
|
|
||||||
$s = $online ? 1 : 0;
|
$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
|
$sql = "UPDATE operator
|
||||||
SET voip_status = '$s'
|
SET voip_status = '$s'
|
||||||
@@ -483,9 +483,9 @@ class voipWatch extends voip {
|
|||||||
$s = $this->getExtensionStatus($e);
|
$s = $this->getExtensionStatus($e);
|
||||||
|
|
||||||
if ($s == false)
|
if ($s == false)
|
||||||
$this->setExtensionStatus($e,false);
|
$this->setExtensionStatus($e,false,true);
|
||||||
else
|
else
|
||||||
$this->setExtensionStatus($e,true);
|
$this->setExtensionStatus($e,true,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user