TransportAudioCall::getDuration

  1. Bitrix24 API (v. 23.675.0)
  2. sender
  3. TransportAudioCall
  4. getDuration
  • Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/voximplant/transportaudiocall.php
  • Класс: Bitrix\Sender\Integration\VoxImplant\TransportAudioCall
  • Вызов: TransportAudioCall::getDuration
public function getDuration(Message\Adapter $message = null)
{
	$length = 0;
	$fileJson = $message->getConfiguration()->get('AUDIO_FILE');
	if ($fileJson)
	{
		$audio = (new Audio())
			->withJsonString($fileJson)
			->withMessageCode($message->getCode());

		$length = $audio->getDuration();
	}
	$length = $length ?: 20;
	$magic = 5;
	$limit = $this->getCountLimiter()->getLimit();

	return round(($length + $magic) / $limit);
}

Добавить комментарий