コード例 #1
0
ファイル: StartCall.php プロジェクト: hardikk/HNH
<?php

/*+**********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ************************************************************************************/
/**
 * this function starts the call, it writes the caller and called information to database where it is picked up from
 */
echo startCall();
function startCall()
{
    global $current_user, $adb, $log;
    require_once 'include/utils/utils.php';
    require_once 'modules/PBXManager/utils/AsteriskClass.php';
    require_once 'modules/PBXManager/AsteriskUtils.php';
    $id = $current_user->id;
    $number = $_REQUEST['number'];
    $record = $_REQUEST['recordid'];
    $result = $adb->query("select * from vtiger_asteriskextensions where userid=" . $current_user->id);
    $extension = $adb->query_result($result, 0, "asterisk_extension");
    $data = getAsteriskInfo($adb);
    $server = $data['server'];
    $port = $data['port'];
    $username = $data['username'];
    $password = $data['password'];
    $version = $data['version'];
コード例 #2
0
ファイル: functions.php プロジェクト: amor89813/scheduler_IBM
<?php

$p = $_POST;
$res = 'fail';
switch ($p['method']) {
    case 'book':
        $res = book($p);
        break;
    case 'getBookingInfo':
        $res = getBookingInfo($p);
        break;
    case 'startCall':
        $res = startCall($p);
        break;
    case 'generateToken':
        $res = generateToken($p);
        break;
    case 'updateToken':
        $res = updateToken($p);
        break;
    default:
        break;
}
echo $res;
function book($p)
{
    mysql_connect("localhost", "videodesk", "ju87gtS") or die("Impossible de se connecter : " . mysql_error());
    mysql_select_db("simplybook");
    $code = $p['codeid'];
    $token = $p['token'];
    $confirmed = true;