/
mikopbx
/
ModuleBeelinePbx
Обзор
Документация
Войти
/
mikopbx
/
ModuleBeelinePbx
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
master
Models/CallHistory.php
234 строки
7 KB
boffart
Инициализация модуля ModuleBeelinePbx
08 июл 2026, 17:11
08 июл 2026, 17:11
1cc4e1a
Код
Авторство
О чём код?
<?php /* * MikoPBX - free phone system for small business * Copyright © 2017-2024 Alexey Portnov and Nikolay Beketov * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with this program. * If not, see <https://www.gnu.org/licenses/>. */ namespace Modules\ModuleBeelinePbx\Models; use MikoPBX\Modules\Models\ModulesModelsBase; /** * История звонков, импортированная из Облачной АТС Билайн. * * @package Modules\ModuleBeelinePbx\Models * * @Indexes( * [name='start', columns=['start'], type=''], * [name='UNIQUEID', columns=['UNIQUEID'], type=''], * [name='linkedid', columns=['linkedid'], type=''] * ) */ class CallHistory extends ModulesModelsBase { /** * @Primary * @Identity * @Column(type="integer", nullable=false) */ public $id; /** * Время начала звонка. * @Column(type="string", nullable=true) */ public ?string $start = ''; /** * Время завершения звонка. * @Column(type="string", nullable=true) */ public ?string $endtime = ''; /** * Время ответа на звонок. * @Column(type="string", nullable=true) */ public ?string $answer = ''; /** * Исходящий канал. * @Column(type="string", nullable=true) */ public ?string $src_chan = ''; /** * Номер источника. * @Column(type="string", nullable=true) */ public ?string $src_num = ''; /** * Имя источника (для строк Beeline — имя сотрудника при исходящем звонке). * @Column(type="string", nullable=true) */ public ?string $src_name = ''; /** * Канал назначения. * @Column(type="string", nullable=true) */ public ?string $dst_chan = ''; /** * Номер назначения. * @Column(type="string", nullable=true) */ public ?string $dst_num = ''; /** * Имя назначения (для строк Beeline — имя сотрудника при входящем звонке). * @Column(type="string", nullable=true) */ public ?string $dst_name = ''; /** * Уникальный идентификатор звонка (fs-beeline-{externalTrackingId}). * @Column(type="string", nullable=true) */ public ?string $UNIQUEID = ''; /** * Связанный идентификатор звонка. * @Column(type="string", nullable=true) */ public ?string $linkedid = ''; /** * DID (номер, на который поступил входящий звонок). * @Column(type="string", nullable=true) */ public ?string $did = ''; /** * Результат звонка (ANSWERED/NOANSWER). * @Column(type="string", nullable=true) */ public ?string $disposition = ''; /** * Путь к файлу записи разговора. * @Column(type="string", nullable=true) */ public ?string $recordingfile = ''; /** * Аккаунт источника (fs-beeline). * @Column(type="string", nullable=true) */ public ?string $from_account = ''; /** * Аккаунт назначения. * @Column(type="string", nullable=true) */ public ?string $to_account = ''; /** * Статус дозвона. * @Column(type="string", nullable=true) */ public ?string $dialstatus = ''; /** * Имя приложения. * @Column(type="string", nullable=true) */ public ?string $appname = ''; /** * Признак перевода звонка. * @Column(type="integer", nullable=true) */ public ?string $transfer = ''; /** * Признак приложения. * @Column(type="string", length=1, nullable=true) */ public ?string $is_app = ''; /** * Длительность звонка в секундах. * @Column(type="integer", nullable=true) */ public ?string $duration = ''; /** * Тарифицируемая длительность в секундах. * @Column(type="integer", nullable=true) */ public ?string $billsec = ''; /** * Признак завершённой обработки. * @Column(type="string", length=1, nullable=true) */ public ?string $work_completed = ''; /** * Идентификатор звонка источника. * @Column(type="string", nullable=true) */ public ?string $src_call_id = ''; /** * Идентификатор звонка назначения. * @Column(type="string", nullable=true) */ public ?string $dst_call_id = ''; /** * Расширенный идентификатор звонка. * @Column(type="string", nullable=true) */ public ?string $verbose_call_id = ''; /** * Признак трансферного звонка. * @Column(type="integer", nullable=true) */ public ?string $a_transfer = '0'; /** * externalTrackingId звонка из Beeline API. Используется для скачивания записи * через GET /v2/records/{extTrackingId}/{userId}/download. * @Column(type="string", nullable=true) */ public ?string $bee_ext_tracking_id = ''; /** * userId абонента Beeline (сторона АТС). Второй параметр эндпоинта скачивания записи. * @Column(type="string", nullable=true) */ public ?string $bee_user_id = ''; /** * Состояние загрузки записи разговора: * pending — отвеченный звонок, запись ещё не запрашивалась, * ok — mp3 успешно сохранён, * none — записи нет (пропущенный звонок, нет externalTrackingId, RecordNotFound), * gone — запись недоступна (истёк срок хранения в Beeline). * @Column(type="string", length=16, nullable=true) */ public ?string $bee_rec_status = ''; public function initialize(): void { $this->setSource('bee_cdr'); parent::initialize(); } }