3namespace Bitrix\Im\V2\Call;
5use Bitrix\Im\Call\Call;
6use Bitrix\Im\Model\CallTable;
7use Bitrix\Call\Call\PlainCall;
8use Bitrix\Call\Call\BitrixCall;
9use Bitrix\Call\Call\ConferenceCall;
10use Bitrix\Main\Type\DateTime;
23 $type === Call::TYPE_PERMANENT => ConferenceCall::class,
24 $provider === Call::PROVIDER_BITRIX => BitrixCall::class,
25 $provider === Call::PROVIDER_PLAIN => PlainCall::class,
26 default => Call::class
39 ?
string $callUuid =
null,
44 return $providerClass::createWithEntity(
$type,
$provider, $entityType,
$entityId, $initiatorId, $callUuid, $scheme);
54 return $providerClass::createWithArray(
$fields);
64 return $providerClass::createCallInstance(
$fields);
125 $date = (
new DateTime())->add(
"-{$depthHours} hour");
127 $query = CallTable::query()
130 ->where(
'START_DATE',
'>=', $date)
131 ->where(
'CALL_USER.USER_ID',
$userId)
133 $activeCalls =
$query->exec()->fetchAll();
135 return $activeCalls ?: [];
144 $date = (
new DateTime())->add(
"-{$depthHours} hour");
146 $query = CallTable::query()
149 ->where(
'START_DATE',
'>=', $date)
150 ->where(
'CALL_USER.USER_ID',
$userId)
154 $activeCall =
$query->exec()->fetchAll();
156 return (
bool)$activeCall;
168 $query = CallTable::query()
170 ->where(
'TYPE',
$type)
172 ->where(
'ENTITY_TYPE', $entityType)
174 ->whereNot(
'STATE', Call::STATE_FINISHED)
175 ->whereNull(
'END_DATE')
176 ->addFilter(
'>START_DATE', (
new DateTime)->add(
'-12 hours'))
177 ->setOrder([
'ID' =>
'DESC'])
181 $callFields =
$query->exec()->fetch();
183 return $callFields ?:
null;
188 $callFields = CallTable::query()
190 ->where(
"UUID", $uuid)
196 return $callFields ?:
null;
if(!Loader::includeModule('messageservice')) $provider
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static searchActiveCall(int $type, string $provider, string $entityType, string $entityId)
static hasUserActiveCalls(int $userId, int $depthHours=12)
static getCallInstance(string $provider, array $fields)
static createWithEntity(int $type, string $provider, string $entityType, string $entityId, int $initiatorId, ?string $callUuid=null, ?int $scheme=null)
static getProviderClass(string $provider, int $type)
static search(int $type, string $provider, string $entityType, string $entityId)
static createWithArray(string $provider, array $fields)
static searchActiveByUuid(string $provider, string $uuid)
static searchActive(int $type, string $provider, string $entityType, string $entityId)
static getUserActiveCalls(int $userId, int $depthHours=12)
static searchByUuid(string $uuid)
static includeModule($moduleName)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)