• Модуль: voximplant
  • Путь к файлу: ~/bitrix/modules/voximplant/classes/general/vi_rest.php
  • Класс: CVoxImplantRestService
  • Вызов: CVoxImplantRestService::startInfoCallWithSound
static function startInfoCallWithSound($params, $n, $server)
{
	$permissions = SecurityPermissions::createWithCurrentUser();
	if (!$permissions->canPerform(SecurityPermissions::ENTITY_CALL, SecurityPermissions::ACTION_PERFORM, SecurityPermissions::PERMISSION_ANY))
	{
		throw new BitrixRestAccessException();
	}

	$params['FROM_LINE'] ??= null;
	$params['TO_NUMBER'] ??= null;
	$params['URL'] ??= null;

	$fromLine = $params['FROM_LINE'];
	$toNumber = $params['TO_NUMBER'];
	$soundUrl = $params['URL'];

	$infoCallResult = CVoxImplantOutgoing::StartInfoCallWithSound($fromLine, $toNumber, $soundUrl);
	if (!$infoCallResult->isSuccess())
	{
		throw new BitrixRestRestException(implode('; ', $infoCallResult->getErrorMessages()));
	}

	$infoCallData = $infoCallResult->getData();
	$result = [
		'RESULT' => true,
		'CALL_ID' => $infoCallData['CALL_ID']
	];

	return $result;
}