本文整理汇总了PHP中CPullOptions::GetQueueServerStatus方法的典型用法代码示例。如果您正苦于以下问题:PHP CPullOptions::GetQueueServerStatus方法的具体用法?PHP CPullOptions::GetQueueServerStatus怎么用?PHP CPullOptions::GetQueueServerStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPullOptions
的用法示例。
在下文中一共展示了CPullOptions::GetQueueServerStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CheckModules
function CheckModules()
{
global $APPLICATION;
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus()) {
$this->errors[] = GetMessage('VI_CHECK_PULL');
}
if (!IsModuleInstalled('im')) {
$this->errors[] = GetMessage('VI_CHECK_IM');
}
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/version.php";
if (version_compare("14.9.2", SM_VERSION) == 1) {
$this->errors[] = GetMessage('VI_CHECK_MAIN');
}
if (IsModuleInstalled('intranet')) {
include $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/intranet/install/version.php";
if (version_compare("14.5.6", $arModuleVersion["VERSION"]) == 1) {
$this->errors[] = GetMessage('VI_CHECK_INTRANET');
}
} else {
$this->errors[] = GetMessage('VI_CHECK_INTRANET_INSTALL');
}
if (is_array($this->errors) && !empty($this->errors)) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
} else {
return true;
}
}
示例2: AddShared
public static function AddShared($arMessage, $channelType = 'shared')
{
if (!CPullOptions::GetQueueServerStatus()) {
return false;
}
$arChannel = CPullChannel::GetChannelShared($channelType);
return self::AddByChannel($arChannel['CHANNEL_ID'], $arMessage);
}
示例3: getPullingInfo
/**
* Return some information about P&P, such as publish url
*
* @since 14.5.4
* @return array
*/
protected static function getPullingInfo()
{
$result = array('enabled' => CModule::IncludeModule('pull') && CPullOptions::ModuleEnable());
if ($result['enabled']) {
$result['nginx_used'] = CPullOptions::GetQueueServerStatus();
if ($result['nginx_used']) {
$result['server_protocol'] = CPullOptions::GetQueueServerVersion();
$result['publish_url'] = CPullOptions::GetPublishUrl();
$result['pulling_url'] = CPullOptions::GetListenUrl();
$result['pulling_url_secure'] = CPullOptions::GetListenSecureUrl();
$result['websocket_url'] = CPullOptions::GetWebSocketUrl();
$result['websocket_url_secure'] = CPullOptions::GetWebSocketSecureUrl();
}
}
return $result;
}
示例4: SendPullEvent
public static function SendPullEvent($params)
{
// TODO check params
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
if ($params['COMMAND'] == 'outgoing') {
$config = array("callId" => $params['CALL_ID'], "callIdTmp" => $params['CALL_ID_TMP'] ? $params['CALL_ID_TMP'] : '', "callDevice" => $params['CALL_DEVICE'] == 'PHONE' ? 'PHONE' : 'WEBRTC', "phoneNumber" => $params['PHONE_NUMBER'], "external" => $params['EXTERNAL'] ? true : false, "CRM" => $params['CRM'] ? $params['CRM'] : array());
} else {
if ($params['COMMAND'] == 'timeout') {
$config = array("callId" => $params['CALL_ID'], "failedCode" => intval($params['FAILED_CODE']));
}
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config));
return true;
}
示例5: SendPullEvent
public static function SendPullEvent($params)
{
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
if (empty($params['COMMAND'])) {
return false;
}
$config = array();
if ($params['COMMAND'] == 'inviteTransfer') {
$config = array("callId" => $params['CALL_ID'], "callerId" => $params['CALLER_ID'], "phoneNumber" => $params['PHONE_NAME'], "chatId" => 0, "chat" => array(), "application" => $params['APPLICATION'], "CRM" => $params['CRM']);
} else {
if ($params['COMMAND'] == 'completeTransfer') {
$config = array("callId" => $params['CALL_ID'], "transferUserId" => $params['TRANSFER_USER_ID'], "callDevice" => $params['CALL_DEVICE'], "CRM" => $params['CRM'] ? $params['CRM'] : false);
} else {
$config["callId"] = $params['CALL_ID'];
}
}
if (isset($params['MARK'])) {
$config['mark'] = $params['MARK'];
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config));
return true;
}
示例6: Array
die();
}
if (intval($USER->GetID()) <= 0)
{
echo CUtil::PhpToJsObject(Array('ERROR' => 'AUTHORIZE_ERROR'));
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
die();
}
if (check_bitrix_sessid())
{
if ($_POST['PULL_GET_CHANNEL'] == 'Y')
{
$arChannel = CPullChannel::Get($USER->GetId(), $_POST['CACHE'] == 'Y'? true: false, $_POST['CACHE'] == 'Y'? false: true);
if (is_array($arChannel))
{
$nginxStatus = CPullOptions::GetQueueServerStatus();
$webSocketStatus = CPullOptions::GetWebSocketStatus();
$arChannels = Array($arChannel['CHANNEL_ID']);
if ($nginxStatus)
{
$arChannelShared = CPullChannel::GetShared($_POST['CACHE'] == 'Y'? true: false, $_POST['CACHE'] == 'Y'? false: true);
if ($arChannelShared)
{
$arChannels[] = $arChannelShared['CHANNEL_ID'];
if ($arChannel['CHANNEL_DT'] > $arChannelShared['CHANNEL_DT'])
$arChannel['CHANNEL_DT'] = $arChannelShared['CHANNEL_DT'];
}
}
if ($_POST['MOBILE'] == 'Y')
$pullPath = ($nginxStatus? (CMain::IsHTTPS()? CPullOptions::GetListenSecureUrl($arChannels, true): CPullOptions::GetListenUrl($arChannels, true)): '/bitrix/components/bitrix/pull.request/ajax.php?UPDATE_STATE');
示例7: SendPullEvent
public static function SendPullEvent($params)
{
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
$push = array();
if ($params['COMMAND'] == 'start') {
$config = array("callId" => $params['CALL_ID'], "callDevice" => $params['CALL_DEVICE'] == 'PHONE' ? 'PHONE' : 'WEBRTC', "external" => $params['EXTERNAL'] ? true : false, "CRM" => $params['CRM'] ? $params['CRM'] : false);
} else {
if ($params['COMMAND'] == 'hold' || $params['COMMAND'] == 'unhold') {
$config = array("callId" => $params['CALL_ID']);
} else {
if ($params['COMMAND'] == 'timeout') {
$config = array("callId" => $params['CALL_ID']);
$push['send_immediately'] = 'Y';
$push['advanced_params'] = array("notificationsToCancel" => array('VI_CALL_' . $params['CALL_ID']));
}
}
}
if (isset($params['MARK'])) {
$config['mark'] = $params['MARK'];
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config, 'push' => $push));
return true;
}
示例8: SendPullEvent
public static function SendPullEvent($params)
{
// TODO check $params
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
$push = array();
if ($params['COMMAND'] == 'invite') {
$config = array("callId" => $params['CALL_ID'], "callerId" => $params['CALLER_ID'], "phoneNumber" => $params['PHONE_NAME'], "chatId" => 0, "chat" => array(), "typeConnect" => $params['TYPE_CONNECT'], "portalCall" => $params['PORTAL_CALL'] == 'Y' ? true : false, "portalCallUserId" => $params['PORTAL_CALL'] == 'Y' ? $params['PORTAL_CALL_USER_ID'] : 0, "portalCallData" => $params['PORTAL_CALL'] == 'Y' ? $params['PORTAL_CALL_DATA'] : array(), "config" => $params['CONFIG'] ? $params['CONFIG'] : array(), "CRM" => $params['CRM']);
$callName = $params['CALLER_ID'];
if (isset($params['CRM']['CONTACT']['NAME']) && strlen($params['CRM']['CONTACT']['NAME']) > 0) {
$callName = $params['CRM']['CONTACT']['NAME'];
}
if (isset($params['CRM']['COMPANY']) && strlen($params['CRM']['COMPANY']) > 0) {
$callName .= ' (' . $params['CRM']['COMPANY'] . ')';
} else {
if (isset($params['CRM']['CONTACT']['POST']) && strlen($params['CRM']['CONTACT']['POST']) > 0) {
$callName .= ' (' . $params['CRM']['CONTACT']['POST'] . ')';
}
}
$push['sub_tag'] = 'VI_CALL_' . $params['CALL_ID'];
$push['send_immediately'] = 'Y';
$push['sound'] = 'call.aif';
$push['advanced_params'] = array("notificationsToCancel" => array('VI_CALL_' . $params['CALL_ID']), "androidHighPriority" => true);
if ($params['PORTAL_CALL'] == 'Y') {
$push['message'] = GetMessage('INCOMING_CALL', array('#NAME#' => $params['PORTAL_CALL_DATA']['users'][$params['PORTAL_CALL_USER_ID']]['name']));
} else {
$push['message'] = GetMessage('INCOMING_CALL', array('#NAME#' => $callName));
$push['message'] = $push['message'] . ' ' . GetMessage('CALL_FOR_NUMBER', array('#NUMBER#' => $params['PHONE_NAME']));
}
$push['params'] = array('ACTION' => 'VI_CALL_' . $params['CALL_ID'], 'PARAMS' => $config);
} else {
if ($params['COMMAND'] == 'update_crm') {
$config = array("callId" => $params['CALL_ID'], "CRM" => $params['CRM']);
} else {
if ($params['COMMAND'] == 'timeout' || $params['COMMAND'] == 'answer_self') {
$config = array("callId" => $params['CALL_ID']);
$push['send_immediately'] = 'Y';
$push['advanced_params'] = array("notificationsToCancel" => array('VI_CALL_' . $params['CALL_ID']));
}
}
}
if (isset($params['MARK'])) {
$config['mark'] = $params['MARK'];
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config, 'push' => $push));
return true;
}
示例9: GetConfig
public static function GetConfig($userId, $cache = true, $reopen = false, $mobile = false)
{
$pullConfig = Array();
if (defined('BX_PULL_SKIP_LS'))
$pullConfig['LOCAL_STORAGE'] = 'N';
if (IsModuleInstalled('bitrix24'))
$pullConfig['BITRIX24'] = 'Y';
$arChannel = CPullChannel::Get($userId, $cache, $reopen);
if (is_array($arChannel))
{
$nginxStatus = CPullOptions::GetQueueServerStatus();
$webSocketStatus = false;
$arChannels = Array($arChannel['CHANNEL_ID']);
if ($nginxStatus)
{
if (defined('BX_PULL_SKIP_WEBSOCKET'))
{
$pullConfig['WEBSOCKET'] = 'N';
}
else
{
$webSocketStatus = CPullOptions::GetWebSocketStatus();
}
$arChannelShared = CPullChannel::GetShared($cache, $reopen);
if (is_array($arChannelShared))
{
$arChannels[] = $arChannelShared['CHANNEL_ID'];
$arChannel['CHANNEL_DT'] = $arChannel['CHANNEL_DT'].'/'.$arChannelShared['CHANNEL_DT'];
}
}
if ($mobile || defined('BX_MOBILE') || defined('BX_PULL_MOBILE'))
{
$pullConfig['MOBILE'] = 'Y';
$pullPath = ($nginxStatus? (CMain::IsHTTPS()? CPullOptions::GetListenSecureUrl($arChannels, true): CPullOptions::GetListenUrl($arChannels, true)): '/bitrix/components/bitrix/pull.request/ajax.php?UPDATE_STATE');
}
else
{
$pullPath = ($nginxStatus? (CMain::IsHTTPS()? CPullOptions::GetListenSecureUrl($arChannels): CPullOptions::GetListenUrl($arChannels)): '/bitrix/components/bitrix/pull.request/ajax.php?UPDATE_STATE');
}
$pullPathWs = ($nginxStatus && $webSocketStatus? (CMain::IsHTTPS()? CPullOptions::GetWebSocketSecureUrl($arChannels): CPullOptions::GetWebSocketUrl($arChannels)): '');
return $pullConfig+Array(
'CHANNEL_ID' => implode('/', $arChannels),
'CHANNEL_DT' => $arChannel['CHANNEL_DT'],
'LAST_ID' => $arChannel['LAST_ID'],
'PATH' => $pullPath,
'PATH_WS' => $pullPathWs,
'PATH_COMMAND' => defined('BX_PULL_COMMAND_PATH')? BX_PULL_COMMAND_PATH: '',
'METHOD' => ($nginxStatus? 'LONG': 'PULL'),
'REVISION' => PULL_REVISION,
'ERROR' => '',
);
}
return false;
}
示例10: SendPullEvent
public static function SendPullEvent($params)
{
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
if ($params['COMMAND'] == 'start') {
$config = array("callId" => $params['CALL_ID'], "callDevice" => $params['CALL_DEVICE'] == 'PHONE' ? 'PHONE' : 'WEBRTC', "external" => $params['EXTERNAL'] ? true : false, "CRM" => $params['CRM'] ? $params['CRM'] : false);
} else {
if ($params['COMMAND'] == 'hold' || $params['COMMAND'] == 'unhold') {
$config = array("callId" => $params['CALL_ID']);
} else {
if ($params['COMMAND'] == 'timeout') {
$config = array("callId" => $params['CALL_ID']);
}
}
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config));
return true;
}
示例11: SendPullEvent
public static function SendPullEvent($params)
{
// TODO check params
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
$push = array();
if ($params['COMMAND'] == 'outgoing') {
$config = array("callId" => $params['CALL_ID'], "callIdTmp" => $params['CALL_ID_TMP'] ? $params['CALL_ID_TMP'] : '', "callDevice" => $params['CALL_DEVICE'] == 'PHONE' ? 'PHONE' : 'WEBRTC', "phoneNumber" => $params['PHONE_NUMBER'], "external" => $params['EXTERNAL'] ? true : false, "portalCall" => $params['PORTAL_CALL'] == 'Y' ? true : false, "portalCallUserId" => $params['PORTAL_CALL'] == 'Y' ? $params['PORTAL_CALL_USER_ID'] : 0, "portalCallData" => $params['PORTAL_CALL'] == 'Y' ? $params['PORTAL_CALL_DATA'] : array(), "config" => $params['CONFIG'] ? $params['CONFIG'] : array(), "CRM" => $params['CRM'] ? $params['CRM'] : array());
$push['send_immediately'] = 'Y';
$push['advanced_params'] = array("notificationsToCancel" => array('VI_CALL_' . $params['CALL_ID']));
} else {
if ($params['COMMAND'] == 'timeout') {
$config = array("callId" => $params['CALL_ID'], "failedCode" => intval($params['FAILED_CODE']));
$push['send_immediately'] = 'Y';
$push['advanced_params'] = array("notificationsToCancel" => array('VI_CALL_' . $params['CALL_ID']));
}
}
if (isset($params['MARK'])) {
$config['mark'] = $params['MARK'];
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config, 'push' => $push));
return true;
}
示例12:
</tr>
<tr>
<td width="40%"></td>
<td width="60%"></td>
</tr>
<tr>
<td align="right" width="50%"><?=GetMessage("PULL_OPTIONS_WEBSOCKET")?>:</td>
<td><input type="checkbox" size="40" value="Y" <?=(CPullOptions::GetWebSocket()?' checked':'')?> id="config_websocket" name="websocket" <?=(CPullOptions::GetQueueServerStatus() && CPullOptions::GetQueueServerVersion() > 1 ? '': 'disabled="true"')?>></td>
</tr>
<tr>
<td ><?=GetMessage("PULL_OPTIONS_PATH_TO_WEBSOCKET")?>:</td>
<td><input id="config_path_to_websocket" type="text" size="40" value="<?=htmlspecialcharsbx(CPullOptions::GetWebSocketUrl())?>" name="path_to_websocket" <?=(!CPullOptions::GetQueueServerStatus() || !CPullOptions::GetWebSocketStatus() ? 'disabled="true"': '')?></td>
</tr>
<tr>
<td ><?=GetMessage("PULL_OPTIONS_PATH_TO_WEBSOCKET_SECURE")?>:</td>
<td><input id="config_path_to_websocket_secure" type="text" size="40" value="<?=htmlspecialcharsbx(CPullOptions::GetWebSocketSecureUrl())?>" name="path_to_websocket_secure" <?=(!CPullOptions::GetQueueServerStatus() || !CPullOptions::GetWebSocketStatus() ? 'disabled="true"': '')?></td>
</tr>
<tr>
<td width="40%"></td>
<td width="60%">
<?=GetMessage("PULL_OPTIONS_WEBSOCKET_DESC")?>
</td>
</tr>
<tr>
<td width="40%"></td>
<td width="60%"></td>
</tr>
<tr>
<td width="40%"></td>
<td width="60%"></td>
</tr>
示例13: GetMessage
?>
" name="path_to_websocket" <?php
echo !CPullOptions::GetQueueServerStatus() || !CPullOptions::GetWebSocketStatus() ? 'disabled="true"' : '';
?>
</td>
</tr>
<tr>
<td ><?php
echo GetMessage("PULL_OPTIONS_PATH_TO_LISTENER_SECURE");
?>
:</td>
<td><input id="config_path_to_websocket_secure" type="text" size="40" value="<?php
echo htmlspecialcharsbx(CPullOptions::GetWebSocketSecureUrl());
?>
" name="path_to_websocket_secure" <?php
echo !CPullOptions::GetQueueServerStatus() || !CPullOptions::GetWebSocketStatus() ? 'disabled="true"' : '';
?>
</td>
</tr>
<tr>
<td width="40%"></td>
<td width="60%">
<?php
echo GetMessage("PULL_OPTIONS_WEBSOCKET_DESC");
?>
</td>
</tr>
<?php
if (count($arSites) > 1 || count($arExcludeSites) > 0) {
?>
<tr class="heading">
示例14: SetPhoneActive
public function SetPhoneActive($userId, $active = false)
{
$userId = intval($userId);
if (!$userId) {
return false;
}
CUserOptions::SetOption('voximplant', 'phone_device_active', $active ? true : false, false, $userId);
global $USER, $CACHE_MANAGER;
$USER->Update($userId, array('UF_VI_PHONE' => $active ? 'Y' : 'N'));
if ($active) {
$arUserInfo = $this->GetUserInfo($userId);
if (!$arUserInfo['phone_enable']) {
$USER->Update($userId, array('UF_VI_PHONE' => 'N'));
$CACHE_MANAGER->ClearByTag("USER_NAME_" . $userId);
CUserOptions::SetOption('voximplant', 'phone_device_active', false, false, $userId);
return false;
}
}
$CACHE_MANAGER->ClearByTag("USER_NAME_" . $userId);
if (CModule::IncludeModule('pull') && CPullOptions::GetQueueServerStatus()) {
CPullStack::AddByUser($userId, array('module_id' => 'voximplant', 'command' => 'phoneDeviceActive', 'params' => array('active' => $active ? 'Y' : 'N')));
}
return true;
}
示例15: SendPullEvent
public static function SendPullEvent($params)
{
// TODO check $params
if (!CModule::IncludeModule('pull') || !CPullOptions::GetQueueServerStatus() || $params['USER_ID'] <= 0) {
return false;
}
$config = array();
if ($params['COMMAND'] == 'invite') {
$config = array("callId" => $params['CALL_ID'], "callerId" => $params['CALLER_ID'], "phoneNumber" => $params['PHONE_NAME'], "chatId" => 0, "chat" => array(), "CRM" => $params['CRM']);
} else {
if ($params['COMMAND'] == 'update_crm') {
$config = array("callId" => $params['CALL_ID'], "CRM" => $params['CRM']);
} else {
if ($params['COMMAND'] == 'timeout' || $params['COMMAND'] == 'answer_self') {
$config = array("callId" => $params['CALL_ID']);
}
}
}
CPullStack::AddByUser($params['USER_ID'], array('module_id' => 'voximplant', 'command' => $params['COMMAND'], 'params' => $config));
return true;
}