Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
call.php
1<?php
2
4
21
23{
24 protected const LOCK_TTL = 15; // in seconds
25
26 public function createAction($type, $provider, $entityType, $entityId, $joinExisting = false)
27 {
28 $currentUserId = $this->getCurrentUser()->getId();
29
30 $lockName = static::getLockNameWithEntityId($entityType, $entityId, $currentUserId);
31 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
32 {
33 $this->errorCollection[] = new Error("Could not get exclusive lock", "could_not_lock");
34 return null;
35 }
36
37 $call = $joinExisting ? CallFactory::searchActive($type, $provider, $entityType, $entityId, $currentUserId) : false;
38
39 try
40 {
41 if ($call)
42 {
43 if (!$call->getAssociatedEntity()->checkAccess($currentUserId))
44 {
45 $this->errorCollection[] = new Error("You can not access this call", 'access_denied');
46 Application::getConnection()->unlock($lockName);
47 return null;
48 }
49
50 $isNew = false;
51 if (!$call->hasUser($currentUserId))
52 {
53 $addedUser = $call->addUser($currentUserId);
54
55 if (!$addedUser)
56 {
57 $this->errorCollection[] = new Error("User limit reached", "user_limit_reached");
58 Application::getConnection()->unlock($lockName);
59 return null;
60 }
61 }
62 }
63 else
64 {
65 $isNew = true;
66
67 try {
68 $call = CallFactory::createWithEntity($type, $provider, $entityType, $entityId, $currentUserId);
69 } catch (\Throwable $e) {
70 $this->addError(new Error($e->getMessage(), $e->getCode()));
71 Application::getConnection()->unlock($lockName);
72 return null;
73 }
74
75 if (!$call->getAssociatedEntity()->canStartCall($currentUserId))
76 {
77 $this->errorCollection[] = new Error("You can not create this call", 'access_denied');
78 Application::getConnection()->unlock($lockName);
79 return null;
80 }
81
82 $initiator = $call->getUser($currentUserId);
83 $initiator->update([
84 'STATE' => CallUser::STATE_READY,
85 'LAST_SEEN' => new DateTime(),
86 'FIRST_JOINED' => new DateTime()
87 ]);
88 }
89 }
90 catch(\Exception $e)
91 {
92 $this->errorCollection[] = new Error(
93 "Can't initiate a call. Server error. (" . ($status ?? "") . ")",
94 "call_init_error");
95
96 Application::getConnection()->unlock($lockName);
97 return null;
98 }
99
100 $users = $call->getUsers();
101 $publicChannels = Loader::includeModule('pull')
102 ? \Bitrix\Pull\Channel::getPublicIds([
103 'TYPE' => \CPullChannel::TYPE_PRIVATE,
104 'USERS' => $users,
105 'JSON' => true
106 ])
107 : []
108 ;
109
110 Application::getConnection()->unlock($lockName);
111
112 return [
113 'call' => $call->toArray(),
114 'connectionData' => $call->getConnectionData($currentUserId),
115 'isNew' => $isNew,
116 'users' => $users,
117 'userData' => Util::getUsers($users),
118 'publicChannels' => $publicChannels,
119 'logToken' => $call->getLogToken($currentUserId),
120 ];
121 }
122
123 public function createChildCallAction($parentId, $newProvider, $newUsers)
124 {
125 $currentUserId = $this->getCurrentUser()->getId();
126
127 $parentCall = Registry::getCallWithId($parentId);
128 if (!$parentCall)
129 {
130 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
131 return null;
132 }
133
134 if(!$this->checkCallAccess($parentCall, $currentUserId))
135 {
136 $this->errorCollection[] = new Error("You do not have access to the parent call", "access_denied");
137 return null;
138 }
139
140 $childCall = $parentCall->makeClone($newProvider);
141
142 $initiator = $childCall->getUser($currentUserId);
143 $initiator->updateState(CallUser::STATE_READY);
144 $initiator->updateLastSeen(new DateTime());
145
146 foreach ($newUsers as $userId)
147 {
148 if(!$childCall->hasUser($userId))
149 {
150 $childCall->addUser($userId)->updateState(CallUser::STATE_CALLING);
151 }
152 }
153
154 $users = $childCall->getUsers();
155 return array(
156 'call' => $childCall->toArray(),
157 'connectionData' => $childCall->getConnectionData($currentUserId),
158 'users' => $users,
159 'userData' => Util::getUsers($users),
160 'logToken' => $childCall->getLogToken($currentUserId)
161 );
162 }
163
164 public function tryJoinCallAction($type, $provider, $entityType, $entityId)
165 {
166 $currentUserId = $this->getCurrentUser()->getId();
167 $call = CallFactory::searchActive($type, $provider, $entityType, $entityId, $currentUserId);
168 if(!$call)
169 {
170 return [
171 'success' => false
172 ];
173 }
174
175 if(!$call->getAssociatedEntity()->checkAccess($currentUserId))
176 {
177 $this->errorCollection[] = new Error("You can not access this call", 'access_denied');
178 return null;
179 }
180
181 if(!$call->hasUser($currentUserId))
182 {
183 $addedUser = $call->addUser($currentUserId);
184 if(!$addedUser)
185 {
186 $this->errorCollection[] = new Error("User limit reached", "user_limit_reached");
187 return null;
188 }
189 $call->getSignaling()->sendUsersJoined($currentUserId, [$currentUserId]);
190 }
191
192 return [
193 'success' => true,
194 'call' => $call->toArray(),
195 'connectionData' => $call->getConnectionData($currentUserId),
196 'logToken' => $call->getLogToken($currentUserId)
197 ];
198 }
199
200 public function interruptAction($callId)
201 {
202 $currentUserId = $this->getCurrentUser()->getId();
203
204 $call = Registry::getCallWithId($callId);
205 if (!$call)
206 {
207 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
208 return null;
209 }
210 if(!$this->checkCallAccess($call, $currentUserId))
211 {
212 $this->errorCollection[] = new Error("You do not have access to the parent call", "access_denied");
213 return null;
214 }
215
216 $call->finish();
217
218 return array(
219 'call' => $call->toArray($currentUserId),
220 'connectionData' => $call->getConnectionData($currentUserId),
221 'logToken' => $call->getLogToken($currentUserId)
222 );
223 }
224
225 public function getAction($callId)
226 {
227 $currentUserId = $this->getCurrentUser()->getId();
228
229 $call = Registry::getCallWithId($callId);
230 if (!$call)
231 {
232 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
233 return null;
234 }
235 if(!$this->checkCallAccess($call, $currentUserId))
236 {
237 $this->errorCollection[] = new Error("You do not have access to the parent call", "access_denied");
238 return null;
239 }
240
241 $users = $call->getUsers();
242 return array(
243 'call' => $call->toArray($currentUserId),
244 'connectionData' => $call->getConnectionData($currentUserId),
245 'users' => $users,
246 'userData' => Util::getUsers($users),
247 'logToken' => $call->getLogToken($currentUserId)
248 );
249 }
250
251 public function inviteAction($callId, array $userIds, $video = "N", $legacyMobile = "N", $repeated = "N")
252 {
253 $isVideo = ($video === "Y");
254 $isLegacyMobile = ($legacyMobile === "Y");
255 $isRepeated = ($repeated === "Y");
256 $currentUserId = $this->getCurrentUser()->getId();
257 $call = Registry::getCallWithId($callId);
258 if (!$call)
259 {
260 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
261 return null;
262 }
263
264 if(!$this->checkCallAccess($call, $currentUserId))
265 return null;
266
267 $call->getUser($currentUserId)->update([
268 'LAST_SEEN' => new DateTime(),
269 'IS_MOBILE' => ($isLegacyMobile ? 'Y' : 'N')
270 ]);
271
272 $lockName = static::getLockNameWithCallId($callId);
273 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
274 {
275 $this->addError(new Error("Could not get exclusive lock", "could_not_lock"));
276 return null;
277 }
278
279 $this->inviteUsers($call, $userIds, $isLegacyMobile, $isVideo, $isRepeated);
280
281 Application::getConnection()->unlock($lockName);
282
283 return true;
284 }
285
286 public function inviteUsers(\Bitrix\Im\Call\Call $call, $userIds, $isLegacyMobile, $isVideo, $isRepeated)
287 {
288 $usersToInvite = [];
289 foreach ($userIds as $userId)
290 {
291 $userId = (int)$userId;
292 if (!$userId)
293 {
294 continue;
295 }
296 if(!$call->hasUser($userId))
297 {
298 if(!$call->addUser($userId))
299 {
300 continue;
301 }
302 }
303 else if ($isRepeated === false && $call->getAssociatedEntity())
304 {
305 $call->getAssociatedEntity()->onExistingUserInvite($userId);
306 }
307 $usersToInvite[] = $userId;
308 $callUser = $call->getUser($userId);
309 if($callUser->getState() != CallUser::STATE_READY)
310 {
311 $callUser->updateState(CallUser::STATE_CALLING);
312 }
313 }
314
315 if (count($usersToInvite) === 0)
316 {
317 $this->addError(new Error("No users to invite", "empty_users"));
318 return null;
319 }
320
321 $sendPush = $isRepeated !== true;
322
323 // send invite to the ones being invited.
324 $call->inviteUsers(
325 $this->getCurrentUser()->getId(),
326 $usersToInvite,
327 $isLegacyMobile,
328 $isVideo,
329 $sendPush
330 );
331
332 // send userInvited to everyone else.
333 $allUsers = $call->getUsers();
334 $otherUsers = array_diff($allUsers, $userIds);
335 $call->getSignaling()->sendUsersInvited(
336 $this->getCurrentUser()->getId(),
337 $otherUsers,
338 $usersToInvite
339 );
340
341 if($call->getState() === \Bitrix\Im\Call\Call::STATE_NEW)
342 {
343 $call->updateState(\Bitrix\Im\Call\Call::STATE_INVITING);
344 }
345 }
346
347 public function cancelAction($callId)
348 {
349 $currentUserId = $this->getCurrentUser()->getId();
350 $call = Registry::getCallWithId($callId);
351 if (!$call)
352 {
353 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
354 return null;
355 }
356
357 if(!$this->checkCallAccess($call, $currentUserId))
358 return null;
359 }
360
361 public function answerAction($callId, $callInstanceId, $legacyMobile = "N")
362 {
363 $isLegacyMobile = $legacyMobile === "Y";
364 $currentUserId = $this->getCurrentUser()->getId();
365 $call = Registry::getCallWithId($callId);
366 if (!$call)
367 {
368 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
369 return null;
370 }
371
372 if(!$this->checkCallAccess($call, $currentUserId))
373 return null;
374
375 $callUser = $call->getUser($currentUserId);
376
377 $lockName = static::getLockNameWithCallId($callId);
378 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
379 {
380 $this->addError(new Error("Could not get exclusive lock", "could_not_lock"));
381 return null;
382 }
383
384 if ($callUser)
385 {
386 $callUser->update([
387 'STATE' => CallUser::STATE_READY,
388 'LAST_SEEN' => new DateTime(),
389 'FIRST_JOINED' => $callUser->getFirstJoined() ? $callUser->getFirstJoined() : new DateTime(),
390 'IS_MOBILE' => $isLegacyMobile ? 'Y' : 'N',
391 ]);
392 }
393
394 Application::getConnection()->unlock($lockName);
395
396 $call->getSignaling()->sendAnswer($currentUserId, $callInstanceId, $isLegacyMobile);
397 }
398
399 public function declineAction(int $callId, $callInstanceId, int $code = 603)
400 {
401 $currentUserId = $this->getCurrentUser()->getId();
402 $call = Registry::getCallWithId($callId);
403 if (!$call)
404 {
405 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
406 return null;
407 }
408
409 if(!$this->checkCallAccess($call, $currentUserId))
410 return null;
411
412 $lockName = static::getLockNameWithCallId($callId);
413 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
414 {
415 $this->addError(new Error("Could not get exclusive lock", "could_not_lock"));
416 return null;
417 }
418
419 $callUser = $call->getUser($currentUserId);
420 if(!$callUser)
421 {
422 $this->addError(new Error("User is not part of the call", "unknown_call_user"));
423 Application::getConnection()->unlock($lockName);
424 return null;
425 }
426
427 if ($callUser->getState() === CallUser::STATE_READY)
428 {
429 $this->addError(new Error("Can not decline in {$callUser->getState()} user state", "wrong_user_state"));
430 Application::getConnection()->unlock($lockName);
431 return null;
432 }
433
434 if($code === 486)
435 {
436 $callUser->updateState(CallUser::STATE_BUSY);
437 }
438 else
439 {
440 $callUser->updateState(CallUser::STATE_DECLINED);
441 }
442 $callUser->updateLastSeen(new DateTime());
443
444 $userIds = $call->getUsers();
445 $call->getSignaling()->sendHangup($currentUserId, $userIds, $callInstanceId, $code);
446
447 if(!$call->hasActiveUsers())
448 {
449 $call->finish();
450 }
451
452 Application::getConnection()->unlock($lockName);
453 }
454
459 public function pingAction($callId, $requestId, $retransmit = true)
460 {
461 $currentUserId = $this->getCurrentUser()->getId();
462 $call = Registry::getCallWithId($callId);
463 if (!$call)
464 {
465 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
466 return null;
467 }
468
469 if(!$this->checkCallAccess($call, $currentUserId))
470 return null;
471
472 $callUser = $call->getUser($currentUserId);
473 if($callUser)
474 {
475 $callUser->updateLastSeen(new DateTime());
476 if($callUser->getState() == CallUser::STATE_UNAVAILABLE)
477 {
478 $callUser->updateState(CallUser::STATE_IDLE);
479 }
480 }
481
482 if($retransmit)
483 {
484 $call->getSignaling()->sendPing($currentUserId, $requestId);
485 }
486
487 return true;
488 }
489
490 public function onShareScreenAction($callId)
491 {
492 $currentUserId = $this->getCurrentUser()->getId();
493 $call = Registry::getCallWithId($callId);
494 if (!$call)
495 {
496 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
497 return null;
498 }
499
500 if(!$this->checkCallAccess($call, $currentUserId))
501 return null;
502
503 $callUser = $call->getUser($currentUserId);
504 if($callUser)
505 {
506 $callUser->update([
507 'SHARED_SCREEN' => 'Y'
508 ]);
509 }
510 }
511
512 public function onStartRecordAction($callId)
513 {
514 $currentUserId = $this->getCurrentUser()->getId();
515 $call = Registry::getCallWithId($callId);
516 if (!$call)
517 {
518 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
519 return null;
520 }
521
522 if(!$this->checkCallAccess($call, $currentUserId))
523 return null;
524
525 $callUser = $call->getUser($currentUserId);
526 if($callUser)
527 {
528 $callUser->update([
529 'RECORDED' => 'Y'
530 ]);
531 }
532 }
533
534 public function negotiationNeededAction($callId, $userId, $restart = false)
535 {
536 $restart = (bool)$restart;
537 $currentUserId = $this->getCurrentUser()->getId();
538 $call = Registry::getCallWithId($callId);
539 if (!$call)
540 {
541 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
542 return null;
543 }
544
545 if(!$this->checkCallAccess($call, $currentUserId))
546 return null;
547
548 $callUser = $call->getUser($currentUserId);
549 if($callUser)
550 {
551 $callUser->updateLastSeen(new DateTime());
552 }
553
554 $call->getSignaling()->sendNegotiationNeeded($currentUserId, $userId, $restart);
555 return true;
556 }
557
558 public function connectionOfferAction($callId, $userId, $connectionId, $sdp, $userAgent)
559 {
560 $currentUserId = $this->getCurrentUser()->getId();
561 $call = Registry::getCallWithId($callId);
562 if (!$call)
563 {
564 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
565 return null;
566 }
567
568 if(!$this->checkCallAccess($call, $currentUserId))
569 return null;
570
571 $callUser = $call->getUser($currentUserId);
572 if($callUser)
573 {
574 $callUser->updateLastSeen(new DateTime());
575 }
576
577 $call->getSignaling()->sendConnectionOffer($currentUserId, $userId, $connectionId, $sdp, $userAgent);
578 return true;
579 }
580
581 public function connectionAnswerAction($callId, $userId, $connectionId, $sdp, $userAgent)
582 {
583 $currentUserId = $this->getCurrentUser()->getId();
584 $call = Registry::getCallWithId($callId);
585 if (!$call)
586 {
587 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
588 return null;
589 }
590
591 if(!$this->checkCallAccess($call, $currentUserId))
592 return null;
593
594 $callUser = $call->getUser($currentUserId);
595 if($callUser)
596 {
597 $callUser->updateLastSeen(new DateTime());
598 }
599
600 $call->getSignaling()->sendConnectionAnswer($currentUserId, $userId, $connectionId, $sdp, $userAgent);
601 return true;
602 }
603
604 public function iceCandidateAction($callId, $userId, $connectionId, array $candidates)
605 {
606 // mobile can alter key order, so we recover it
607 ksort($candidates);
608
609 $currentUserId = $this->getCurrentUser()->getId();
610 $call = Registry::getCallWithId($callId);
611
612 if(!$this->checkCallAccess($call, $currentUserId))
613 return null;
614
615 $callUser = $call->getUser($currentUserId);
616 if($callUser)
617 {
618 $callUser->updateLastSeen(new DateTime());
619 }
620
621 $call->getSignaling()->sendIceCandidates($currentUserId, $userId, $connectionId, $candidates);
622 return true;
623 }
624
625 public function hangupAction($callId, $callInstanceId, $retransmit = true)
626 {
627 $currentUserId = $this->getCurrentUser()->getId();
628 $call = Registry::getCallWithId($callId);
629 if (!$call)
630 {
631 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
632 return null;
633 }
634
635 if(!$this->checkCallAccess($call, $currentUserId))
636 return null;
637
638 $lockName = static::getLockNameWithCallId($callId);
639 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
640 {
641 $this->addError(new Error("Could not get exclusive lock", "could_not_lock"));
642 return null;
643 }
644
645 $callUser = $call->getUser($currentUserId);
646 if($callUser)
647 {
648 $callUser->updateState(CallUser::STATE_IDLE);
649 $callUser->updateLastSeen(new DateTime());
650 }
651
652 if(!$call->hasActiveUsers())
653 {
654 $call->finish();
655 }
656
657 Application::getConnection()->unlock($lockName);
658
659 if($retransmit)
660 {
661 $userIds = $call->getUsers();
662 $call->getSignaling()->sendHangup($currentUserId, $userIds, $callInstanceId);
663 }
664 }
665
666 public function getUsersAction($callId, array $userIds = [])
667 {
668 $currentUserId = $this->getCurrentUser()->getId();
669 $call = Registry::getCallWithId($callId);
670 if (!$call)
671 {
672 $this->addError(new Error(Loc::getMessage("IM_REST_CALL_ERROR_CALL_NOT_FOUND"), "call_not_found"));
673 return null;
674 }
675
676 if(!$this->checkCallAccess($call, $currentUserId))
677 {
678 $this->errorCollection[] = new Error("You do not have access to the call", "access_denied");
679 return null;
680 }
681 if (empty($userIds))
682 {
683 $allowedUserIds = $call->getUsers();
684 }
685 else
686 {
687 $allowedUserIds = array_filter($userIds, function($userId) use ($call, $currentUserId)
688 {
689 return $userId == $currentUserId || $call->hasUser($userId);
690 });
691 }
692
693 if (empty($allowedUserIds))
694 {
695 $this->errorCollection[] = new Error("Users are not part of the call", "access_denied");
696 return null;
697 }
698
699 return Util::getUsers($allowedUserIds);
700 }
701
702 public function getUserStateAction($callId, int $userId = 0)
703 {
704 $currentUserId = (int)$this->getCurrentUser()->getId();
705 $call = Registry::getCallWithId($callId);
706
707 if(!$call || !$this->checkCallAccess($call, $currentUserId))
708 {
709 $this->errorCollection[] = new Error("Call is not found or you do not have access to the call", "access_denied");
710 return null;
711 }
712
713 if ($userId === 0)
714 {
715 $userId = $currentUserId;
716 }
717
718 $lockName = static::getLockNameWithCallId($callId);
719 if (!Application::getConnection()->lock($lockName, static::LOCK_TTL))
720 {
721 $this->addError(new Error("Could not get exclusive lock", "could_not_lock"));
722 return null;
723 }
724
725 $callUser = $call->getUser($userId);
726 if (!$callUser)
727 {
728 $this->addError(new Error("User is not part of the call", "unknown_call_user"));
729 Application::getConnection()->unlock($lockName);
730 return null;
731 }
732
733 Application::getConnection()->unlock($lockName);
734 return $callUser->toArray();
735 }
736
737 public function getCallLimitsAction()
738 {
739 return [
740 'callServerEnabled' => \Bitrix\Im\Call\Call::isCallServerEnabled(),
741 'maxParticipants' => \Bitrix\Im\Call\Call::getMaxParticipants(),
742 ];
743 }
744
745 public function reportConnectionStatusAction(int $callId, bool $connectionStatus)
746 {
747 AddEventToStatFile('im', 'call_connection', $callId, ($connectionStatus ? 'Y' : 'N'));
748 }
749
750 protected function checkCallAccess(\Bitrix\Im\Call\Call $call, $userId)
751 {
752 if(!$call->checkAccess($userId))
753 {
754 $this->errorCollection[] = new Error("You don't have access to the call " . $call->getId() . "; (current user id: " . $userId . ")", 'access_denied');
755 return false;
756 }
757 else
758 {
759 return true;
760 }
761 }
762
763 public static function getLockNameWithEntityId(string $entityType, $entityId, $currentUserId): string
764 {
765 if($entityType === EntityType::CHAT && (Common::isChatId($entityId) || (int)$entityId > 0))
766 {
767 $chatId = \Bitrix\Im\Dialog::getChatId($entityId, $currentUserId);
768
769 return "call_entity_{$entityType}_{$chatId}";
770 }
771
772 return "call_entity_{$entityType}_{$entityId}";
773 }
774
775 protected static function getLockNameWithCallId($callId): string
776 {
777 //TODO: int|string after switching to php 8
778 if (is_string($callId) || is_numeric($callId))
779 {
780 return "im_call_{$callId}";
781 }
782
783 return '';
784 }
785
786 public function configureActions()
787 {
788 return [
789 'getUsers' => [
790 '+prefilters' => [new Engine\ActionFilter\CloseSession()],
791 ],
792 'reportConnectionStatus' => [
793 '+prefilters' => [new Engine\ActionFilter\CloseSession()],
794 ],
795 ];
796 }
797}
const STATE_INVITING
Definition call.php:24
static getCallWithId(int $id)
Definition registry.php:17
static getUsers(array $idList)
Definition util.php:10
static isChatId($id)
Definition common.php:64
static getLockNameWithCallId($callId)
Definition call.php:775
hangupAction($callId, $callInstanceId, $retransmit=true)
Definition call.php:625
answerAction($callId, $callInstanceId, $legacyMobile="N")
Definition call.php:361
tryJoinCallAction($type, $provider, $entityType, $entityId)
Definition call.php:164
createAction($type, $provider, $entityType, $entityId, $joinExisting=false)
Definition call.php:26
iceCandidateAction($callId, $userId, $connectionId, array $candidates)
Definition call.php:604
getUsersAction($callId, array $userIds=[])
Definition call.php:666
onShareScreenAction($callId)
Definition call.php:490
createChildCallAction($parentId, $newProvider, $newUsers)
Definition call.php:123
inviteAction($callId, array $userIds, $video="N", $legacyMobile="N", $repeated="N")
Definition call.php:251
getUserStateAction($callId, int $userId=0)
Definition call.php:702
negotiationNeededAction($callId, $userId, $restart=false)
Definition call.php:534
checkCallAccess(\Bitrix\Im\Call\Call $call, $userId)
Definition call.php:750
onStartRecordAction($callId)
Definition call.php:512
static getLockNameWithEntityId(string $entityType, $entityId, $currentUserId)
Definition call.php:763
connectionOfferAction($callId, $userId, $connectionId, $sdp, $userAgent)
Definition call.php:558
pingAction($callId, $requestId, $retransmit=true)
Definition call.php:459
connectionAnswerAction($callId, $userId, $connectionId, $sdp, $userAgent)
Definition call.php:581
reportConnectionStatusAction(int $callId, bool $connectionStatus)
Definition call.php:745
inviteUsers(\Bitrix\Im\Call\Call $call, $userIds, $isLegacyMobile, $isVideo, $isRepeated)
Definition call.php:286
declineAction(int $callId, $callInstanceId, int $code=603)
Definition call.php:399
static getConnection($name="")
static getMessage($code, $replace=null, $language=null)
Definition loc.php:29