Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
CallController.php
1
<?php
2
3
namespace
Bitrix\Im\V2\Controller\Call
;
4
5
use
Bitrix\Im\Call\Call
;
6
use
Bitrix\Im\V2\Call\CallError
;
7
use
Bitrix\Im\V2\Call\CallFactory
;
8
use
Bitrix\Main\Service\MicroService\BaseReceiver
;
9
10
class
CallController
extends
BaseReceiver
11
{
15
public
function
finishCallAction
(
string
$callUuid): ?array
16
{
17
$call = CallFactory::searchActiveByUuid(Call::PROVIDER_BITRIX, $callUuid);
18
19
if
(!isset($call))
20
{
21
$this->
addError
(
new
CallError
(CallError::CALL_NOT_FOUNT));
22
23
return
null
;
24
}
25
26
$isSuccess = $call->getSignaling()->sendFinish();
27
28
if
(!$isSuccess)
29
{
30
$this->
addError
(
new
CallError
(CallError::SEND_PULL_ERROR));
31
32
return
null
;
33
}
34
35
return
[
'result'
=>
true
];
36
}
37
41
public
function
disconnectUserAction
(
string
$callUuid,
int
$userId): ?array
42
{
43
$call = CallFactory::searchActiveByUuid(Call::PROVIDER_BITRIX, $callUuid);
44
45
if
(!isset($call))
46
{
47
$this->
addError
(
new
CallError
(CallError::CALL_NOT_FOUNT));
48
49
return
null
;
50
}
51
52
$isSuccess = $call->getSignaling()->sendHangup($userId, $call->getUsers(),
null
);
53
54
if
(!$isSuccess)
55
{
56
$this->
addError
(
new
CallError
(CallError::SEND_PULL_ERROR));
57
58
return
null
;
59
}
60
61
return
[
'result'
=>
true
];
62
}
63
}
Bitrix\Im\Call\Call
Definition
call.php:22
Bitrix\Im\V2\Call\CallError
Definition
CallError.php:9
Bitrix\Im\V2\Call\CallFactory
Definition
CallFactory.php:8
Bitrix\Im\V2\Controller\Call\CallController
Definition
CallController.php:11
Bitrix\Im\V2\Controller\Call\CallController\disconnectUserAction
disconnectUserAction(string $callUuid, int $userId)
Definition
CallController.php:41
Bitrix\Im\V2\Controller\Call\CallController\finishCallAction
finishCallAction(string $callUuid)
Definition
CallController.php:15
Bitrix\Main\Engine\Controller\addError
addError(Error $error)
Definition
controller.php:1051
Bitrix\Main\Service\MicroService\BaseReceiver
Definition
basereceiver.php:8
Bitrix\Im\V2\Controller\Call
Definition
Background.php:3
modules
im
lib
V2
Controller
Call
CallController.php
Создано системой
1.10.0