Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
ControllerClient.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Call
;
4
5
use
Bitrix\Main\Config\Option
;
6
use
Bitrix\Main\Service\MicroService\BaseSender
;
7
class
ControllerClient
extends
BaseSender
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
}
Bitrix\Im\V2\Call\ControllerClient
Definition
ControllerClient.php:8
Bitrix\Im\V2\Call\ControllerClient\getServiceUrl
getServiceUrl()
Definition
ControllerClient.php:46
Bitrix\Im\V2\Call\ControllerClient\createCall
createCall($callUuid, $secretKey, $initiatorId)
Definition
ControllerClient.php:51
Bitrix\Im\V2\Call\ControllerClient\$customEndpoint
$customEndpoint
Definition
ControllerClient.php:10
Bitrix\Im\V2\Call\ControllerClient\__construct
__construct(string $endpoint=null)
Definition
ControllerClient.php:12
Bitrix\Im\V2\Call\ControllerClient\getEndpoint
getEndpoint()
Definition
ControllerClient.php:22
Bitrix\Im\V2\Call\ControllerClient\$endpoint
$endpoint
Definition
ControllerClient.php:9
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Service\MicroService\BaseSender
Definition
basesender.php:15
Bitrix\Main\Service\MicroService\BaseSender\performRequest
performRequest($action, array $parameters=[])
Definition
basesender.php:26
Bitrix\Im\V2\Call
Definition
BitrixCall.php:3
modules
im
lib
V2
Call
ControllerClient.php
Создано системой
1.10.0