Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
ControllerClient.php
1<?php
2
3namespace Bitrix\Im\V2\Call;
4
8{
9 protected $endpoint;
10 protected $customEndpoint;
11
12 public function __construct(string $endpoint = null)
13 {
14 parent::__construct();
15
16 if ($endpoint)
17 {
18 $this->customEndpoint = $endpoint;
19 }
20 }
21
22 protected function getEndpoint()
23 {
24 if (is_null($this->endpoint))
25 {
26 $endpoint = Option::get('im', 'call_server_url');
27
28 if (!empty($endpoint))
29 {
30 if (!(mb_strpos($endpoint, 'https://') === 0 || mb_strpos($endpoint, 'http://') === 0))
31 {
32 $endpoint = 'https://' . $endpoint;
33 }
34 $this->endpoint = $endpoint;
35 }
36 }
37
38 return $this->endpoint;
39 }
40
46 protected function getServiceUrl(): string
47 {
48 return $this->getEndpoint();
49 }
50
51 public function createCall($callUuid, $secretKey, $initiatorId)
52 {
53 return $this->performRequest(
54 'callcontroller.Controller.InternalApi.createCall',
55 [
56 'uuid' => $callUuid,
57 'secretKey' => $secretKey,
58 'initiatorUserId' => $initiatorId,
59 ]
60 );
61 }
62}
createCall($callUuid, $secretKey, $initiatorId)
performRequest($action, array $parameters=[])