• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_rest.php
  • Класс: CVoxImplantRestService
  • Вызов: CVoxImplantRestService::startCallWithDevice
static function startCallWithDevice($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);
	}

	$number = $params['NUMBER'];
	$callParams = $params['PARAMS'];
	$userId = static::getCurrentUserId();

	if (!CVoxImplantUser::GetPhoneActive($userId))
	{
		throw new BitrixRestRestException("User has no phone.", "NO_PHONE", CRestServer::STATUS_NOT_FOUND);
	}

	return  CVoxImplantOutgoing::StartCall($userId, $number, $callParams);
}