• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_rest.php
  • Класс: CVoxImplantRestService
  • Вызов: CVoxImplantRestService::interceptCall
static function interceptCall($params, $n, $server)
{
	if ($server->getAuthType() !== BitrixRestSessionAuthAuth::AUTH_TYPE)
	{
		throw new BitrixRestRestException("This method is only available for internal usage.", "WRONG_AUTH_TYPE", CRestServer::STATUS_FORBIDDEN);
	}

	$interceptResult = false;
	$userId = static::getCurrentUserId();
	$callId = CVoxImplantIncoming::findCallToIntercept($userId);
	if ($callId)
	{
		$interceptResult = CVoxImplantIncoming::interceptCall($userId, $callId);
	}

	$result =  [
		'FOUND' => $interceptResult ? 'Y' : 'N'
	];
	if (!$interceptResult)
	{
		$result['ERROR'] = Loc::getMessage('VI_REST_CALL_FOR_INTERCEPT_NOT_FOUND');
	}

	return $result;
}