\Asterisk
Asterisk PBX basic integration class
Synopsis
class Asterisk
{
- // constants
- const URL_ME = '?module=asterisk';
- const CACHE_PATH = 'exports/';
- // members
- protected array $config = ;
- protected array $NumAliases = ;
- protected $result_LoginByNumber;
- protected $result_NumberLogin;
- protected $result_NumberLoginUniq;
- protected $allrealnames;
- protected $alladdress;
- protected $messages = '';
- protected string $cacheTime = '';
- protected array $altCfg = ;
- protected string $recordingsPath = '';
- protected bool $recordingsCELTab = '';
- protected string $recordingsFormat = '';
- protected bool $getFullCDRCELData = false;
- protected bool $extMobilesON = false;
- private $connected;
- private $AsteriskDB;
- // methods
- public void __construct()
- protected void loadAlter()
- protected array AsteriskLoadConf()
- protected void initMessages()
- protected void initCache()
- protected void AsterikCacheInfoClean()
- protected array AsteriskGetConf()
- protected MySQLDB AsteriskConnectDB()
- public array AsteriskQuery()
- protected array AsteriskLoadNumAliases()
- protected array AsteriskGetNumAliases()
- public string AsteriskConfigForm()
- public string AsteriskAliasesForm()
- public void AsteriskDeleteAlias()
- public void AsteriskCreateAlias()
- public void AsteriskUpdateConfig()
- public string panel()
- protected string AsteriskGetCommentsForUser()
- protected string AsteriskGetSWStatus()
- public mixed AsteriskGetInfoApi()
- protected string AsteriskFormatTime()
- protected void AsteriskGetLoginByNumberQuery()
- protected void AsteriskGetUserAllRealnames()
- protected void AsteriskGetFulladdress()
- protected string AsteriskGetNumAlias()
- protected array AsteriskGetLoginByNumber()
- protected mixed AsteriskGetCDR()
- public string renderAsteriskCDR()
- public void ajaxAvaibleCDR()
- public string initPlayer()
- public string getSoundControls()
- protected void getSoundcontrolsHTML5()
- public void catchFileDownload()
- protected array getCallsRecords()
- public array|string getLoginsByMobile()
- public array|string getContractsByMobile()
- public array|string getUserData()
- public array|string addUserMobile()
Constants
Name | Value |
---|---|
URL_ME | '?module=asterisk' |
CACHE_PATH | 'exports/' |
Members
private
- $AsteriskDB
- $connected
protected
- $NumAliases
—
array
Contains Ubstorage data for Number Alias Asterisk as key=>value - $alladdress — array
- $allrealnames — array
- $altCfg
—
array
System alter.ini config as key=>value - $cacheTime
—
int
Comments caching time - $config
—
array
Contains Ubstorage data for Asterisk as key=>value - $extMobilesON
—
bool
Placeholder for MOBILES_EXT alter.ini option - $getFullCDRCELData
—
bool
Placeholder for ASTERISK_GET_FULL_CDR_CEL_DATA alter.ini option - $messages
—
Contains system mussages object placeholder - $recordingsCELTab
—
bool
Determines whether to use CEL table and contains CEL table name - $recordingsFormat
—
string
Contains default recorded files file extensions - $recordingsPath
—
string
Contains default recorded calls path - $result_LoginByNumber
—
array
Contains Login and mobiles from MySQL Databases as login=>data - $result_NumberLogin
—
array
Contains mobiles and Login from MySQL Databases as Number=>Login - $result_NumberLoginUniq
—
array
Contains only unniq mobiles and Login from MySQL Databases as Number=>Login
Methods
protected
- AsterikCacheInfoClean() — Check for last cache data and if need clean
- AsteriskConnectDB() — Initialises connection with Asterisk database server and selects needed db
- AsteriskFormatTime() — Converts per second time values to human-readable format
- AsteriskGetCDR() — Gets Asterisk CDR data from database and manage cache Load AsteriskGetLoginByNumberQuery, AsteriskGetUserAllRealnames, AsteriskGetFulladdress
- AsteriskGetCommentsForUser() — Get comment for user
- AsteriskGetConf() — Gets Asterisk config from DB, or sets default values
- AsteriskGetFulladdress() — Returns user address by some user login
- AsteriskGetLoginByNumber() — Gets Ubilling user login by number mobile
- AsteriskGetLoginByNumberQuery() — Gets Login by caller number from DB
- AsteriskGetNumAlias() — Returns human readable alias from phone book by phone number
- AsteriskGetNumAliases() — Get numbers aliases from database, or set default empty array
- AsteriskGetSWStatus() — Get status switch for user
- AsteriskGetUserAllRealnames() — Returns all of users realnames records as login=>realname array
- AsteriskLoadConf() — Load Asterisk config
- AsteriskLoadNumAliases() — Load numbers aliases
- getCallsRecords() — Returns available calls files array
- getSoundcontrolsHTML5()
- initCache() — Initalizes system cache object for further usage
- initMessages() — Inits system messages helper object for further usage
- loadAlter() — Loads system alter config into private property for further usage
public
- __construct()
- AsteriskAliasesForm() — Returns number aliases aka phonebook form
- AsteriskConfigForm() — Returns Asterisk module configuration form
- AsteriskCreateAlias() — Create aliases for number on Ubstorage
- AsteriskDeleteAlias() — Delete aliase for number on Ubstorage
- AsteriskGetInfoApi() — Get status switch and other for user, if his bumber have database. Use only in remote API.
- AsteriskQuery() — Another database query execution
- AsteriskUpdateConfig() — Update parametrs for Asterisk configs on Ubstorage
- addUserMobile() — Adds or creates user mobiles with max mobiles count threshold support
- ajaxAvaibleCDR() — Parse Asterisk RAW CDR data
- catchFileDownload() — Catches file download
- getContractsByMobile() — Returns all contracts for a given phone number or a part of phone number
- getLoginsByMobile() — Returns all logins for a given phone number or a part of phone number
- getSoundControls() — Returns controls for some recorded call file
- getUserData() — Returns some user data by login with optional auth by login + password
- initPlayer() — Inits gsm/wav player for further usage
- panel() — Returns CDR date selection form
- renderAsteriskCDR() — Returns container of Asterisk