Server IP : 80.87.202.40 / Your IP : 216.73.216.169 Web Server : Apache System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64 User : bitrix ( 600) PHP Version : 8.2.27 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/bitrix/ext_www/rospirotorg.ru/bitrix/modules/im/lib/V2/Call/ |
Upload File : |
<?php namespace Bitrix\Im\V2\Call; use Bitrix\Call\JwtCall; use Bitrix\Im\V2\Rest\PopupDataItem; use Bitrix\Main\Loader; class CallToken implements PopupDataItem { protected ?int $chatId = null; protected ?int $userId = null; protected string $token = ''; public function __construct(?int $chatId, ?int $userId) { if (isset($chatId) && Loader::includeModule('call')) { $this->token = JwtCall::getCallToken($chatId, $userId); $this->chatId = $chatId; $this->userId = $userId; } } public function update(): void { if (Loader::includeModule('call')) { $this->token = \Bitrix\Call\JwtCall::updateCallToken((int)$this->chatId, (int)$this->userId); } } public function getToken(): string { return $this->token; } public function getChatId(): ?int { return $this->chatId; } public static function getRestEntityName(): string { return 'callInfo'; } public function toRestFormat(array $option = []): ?array { return [ 'token' => $this->token, 'chatId' => $this->chatId, ]; } public function merge(PopupDataItem $item): PopupDataItem { return $this; } }