\PBXMonitor
Universal PBX calls recodrings viewer class
Synopsis
class PBXMonitor
{
- // constants
- const ICON_PATH = 'skins/calls/';
- const URL_ME = '?module=pbxmonitor';
- const URL_PROFILE = '?module=userprofile&username=';
- const TABLE_CALLS = 'pbxcalls';
- const REFILL_PID = 'PBXCALLS';
- // members
- protected array $allRecords = ;
- protected integer $totalRecordsCount = 0;
- protected integer $filteredRecordsCount = 0;
- protected array $altCfg = ;
- protected string $voicePath = '';
- protected string $archivePath = '';
- protected bool $onlyMobileFlag = true;
- protected array $userTags = ;
- protected bool $ffmpegFlag = false;
- protected string $ffmpegPath = '';
- protected string $baseConverterPath = '';
- protected string $convertedPath = 'exports/';
- protected string $converterLogPath = 'exports/voiceconvert.log';
- protected $pbxCallsDb = '';
- protected integer $onPage = 50;
- // methods
- public void __construct()
- protected void loadConfig()
- protected void initPbxCallsDb()
- protected void detectFfmpeg()
- protected void loadUserTags()
- public void catchFileDownload()
- protected array scanDirectory()
- protected array getCallsDir()
- protected array getArchiveDir()
- public string renderCallsList()
- protected string renderUserTags()
- public void refillCache()
- protected void recordsLoader()
- public void jsonCallsList()
- protected string getSoundcontrols()
- public string renderSoundPlayer()
Constants
| Name | Value |
|---|---|
| ICON_PATH | 'skins/calls/' |
| URL_ME | '?module=pbxmonitor' |
| URL_PROFILE | '?module=userprofile&username=' |
| TABLE_CALLS | 'pbxcalls' |
| REFILL_PID | 'PBXCALLS' |
Members
protected
- $allRecords
—
array
Contains all call records loaded from database - $altCfg
—
array
Contains system alter config as key=>value - $archivePath
—
string
Contains voice recors archive path - $baseConverterPath
—
string
Basic ffmpeg path to search. - $convertedPath
—
string
File path for converted voice files - $converterLogPath
—
string
ffmpeg log path - $ffmpegFlag
—
bool
FFmpeg installed? - $ffmpegPath
—
string
installed ffmpeg path - $filteredRecordsCount
—
int
Contains filtered records count - $onPage
—
int
Default on-page calls number - $onlyMobileFlag
—
bool
Flag for telepathy detection of users - $pbxCallsDb
—
PBX calls cache database abstraction layer - $totalRecordsCount
—
int
Contains count of call records available - $userTags
—
array
Contains user assigned tags as login=>usertags - $voicePath
—
string
Contains default recorded calls path
Methods
protected
- detectFfmpeg() — Detects is ffmpeg available on local system and sets ffmpegFlag and path properties.
- getArchiveDir() — Returns available archived calls files array
- getCallsDir() — Returns available calls files array
- getSoundcontrols() — Returns controls for some recorded call file
- initPbxCallsDb() — Inits calls cache database abstraction layer
- loadConfig() — Loads all required configs and sets some options
- loadUserTags() — Loads existing tagtypes and usertags into protected props for further usage
- recordsLoader() — Performs records filtering, ordering and load
- renderUserTags() — Renders user tags if available
- scanDirectory() — Returns list of all files in directory. Using this instead of rcms_scandir with filters to prevent of much of preg_match callbacks and avoid performance issues.
public
- __construct() — Creates new PBX monitor instance
- catchFileDownload() — Catches file download or convert request
- jsonCallsList() — Renders json recorded calls list
- refillCache() — Refills calls cache with some new calls if found
- renderCallsList() — Returns calls list container
- renderSoundPlayer() — Returns player for some recorded call file