function click_to_call($caller, $called, $site, $callthrough_time) { $command = "click_to_call {$caller} {$called} {$site} {$callthrough_time}"; $socket = new SocketConn(); if ($socket->error == "") { $obj = array("success" => true); $socket->command($command); $sql = "insert into actionlogs (date,performer,log,ip) values (" . time() . ",\"{$_SESSION['extension']}\",\"{$command}\", \"{$_SERVER['REMOTE_ADDR']}\")"; query($sql); } else { $obj = array("success" => false); $obj['message'] = "Can't make call. Please contact your system administrator."; echo out($obj); } }
* In case the file "License" that describes GNU General Public License terms and conditions, * version 3, is missing (initially goes with software source code), you can visit the official site * http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License * version (version 3 as well). * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if (!$_SESSION["extension"]) { echo out(array("success" => false, "message" => "Extension is undefined")); exit; } require_once "php/socketconn.php"; $called = getparam("number"); if (!$called) { echo out(array("success" => false, "message" => "Called number is undefined")); exit; } //$caller = $_SESSION["user"]; $caller = $_SESSION["extension"]; $command = "click_to_call {$caller} {$called}"; $socket = new SocketConn(); $msg = ''; if ($socket->error == "") { $obj = array("success" => true); $socket->command($command); $sql = "insert into actionlogs (date,performer,log,ip) values (" . time() . ",\"{$_SESSION['extension']}\",\"{$command}\", \"{$_SERVER['REMOTE_ADDR']}\")"; query($sql); } else { $obj = array("success" => false); $obj['message'] = "Can't make call. Please contact your system administrator."; } echo out($obj);
* "Sencha Ext JS" project libraries, http://www.sencha.com/products/extjs * "Komunikator" web application is a free/libre and open-source software. Therefore it grants user rights * for distribution and (or) modification (including other rights) of this programming solution according * to GNU General Public License terms and conditions published by Free Software Foundation in version 3. * In case the file "License" that describes GNU General Public License terms and conditions, * version 3, is missing (initially goes with software source code), you can visit the official site * http://www.gnu.org/licenses/ and find terms specified in appropriate GNU General Public License * version (version 3 as well). * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ if ($sda_action == 'start' or $sda_action == 'stop') { if ($sda_action == 'start') { $sda_command = 'external start record.js'; $sda_command2 = 'external start wav.js'; } if ($sda_action == 'stop') { $sda_command = 'external stop record.js'; $sda_command2 = 'external stop wav.js'; } require_once "php/socketconn.php"; $socket = new SocketConn(); if ($socket->error == "") { $socket->command($sda_command); $socket->command($sda_command2); } else { $obj = array("success" => false); $obj['message'] = "Ошибка: некорректная работа модуля call record"; echo out($obj); } $sda_action = ''; }