\WhyDoYouCall
Missed calls notification subsystem
Synopsis
class WhyDoYouCall
{
- // constants
- const CACHE_FILE = 'exports/whydoyoucall.dat';
- const CACHE_RECALLED = 'exports/whydoyourecall.dat';
- const URL_PROFILE = '?module=userprofile&username=';
- const URL_ME = '?module=whydoyoucall';
- const TABLE_STATS = 'wdycinfo';
- // members
- protected array $altCfg = ;
- protected $telepathy = ;
- protected bool $onlyMobileFlag = false;
- protected string $askoziaUrl = '';
- protected string $askoziaLogin = '';
- protected string $askoziaPassword = '';
- protected $messages = '';
- protected array $allUserNames = ;
- protected array $allUserAddress = ;
- protected $statsDb = '';
- // methods
- public void __construct()
- protected void loadConfig()
- protected void initMessages()
- protected void initTelepathy()
- protected void initStatsDb()
- public array fetchAskoziaCalls()
- public void pollUnansweredCalls()
- protected string userLoginTelepathy()
- public string panel()
- public string renderMissedCallsReport()
- public string renderRecalledCallsReport()
- public void saveStats()
- protected string statsDateForm()
- public string renderNightModeCalls()
- public string getAskoziaNightModeCalls()
- public string renderStats()
- protected string cutString()
- protected string colorMissed()
- protected string renderStatsEditForm()
- public void saveEditedStats()
- public void jsonPreviousStats()
Constants
Name | Value |
---|---|
CACHE_FILE | 'exports/whydoyoucall.dat' |
CACHE_RECALLED | 'exports/whydoyourecall.dat' |
URL_PROFILE | '?module=userprofile&username=' |
URL_ME | '?module=whydoyoucall' |
TABLE_STATS | 'wdycinfo' |
Members
protected
- $allUserAddress
—
array
Contains array of all available users address as login=>fulladdress - $allUserNames
—
array
Contains array of all available user names as login=>reanlnames - $altCfg
—
array
System alter.ini config as key=>value - $askoziaLogin
—
string
Askozia PBX administrators login - $askoziaPassword
—
string
Askozia PBX administrators password - $askoziaUrl
—
string
Askozia PBX web-interface URL - $messages
—
System messages helper object placeholder - $onlyMobileFlag
—
bool
Contains only mobile flag mapped from WDYC_ONLY_MOBILE config option - $statsDb
—
Stats database abstraction layer placeholder - $telepathy
—
Telepathy object placeholder
Methods
protected
- colorMissed() — Do some coloring of missed counts
- cutString() — Cuts string to some normal length
- initMessages() — Creates message helper object for further usage
- initStatsDb() — Inits stats database abstraction layer
- initTelepathy() — Inits telepathy object instance
- loadConfig() — Preloads alter config, for further usage as key=>value
- renderStatsEditForm() — Renders stats records editing form
- statsDateForm() — Returns date search form
- userLoginTelepathy() — Trys to detect user login by phone number
public
- __construct()
- fetchAskoziaCalls() — Askozia PBX data fetching and processing
- getAskoziaNightModeCalls() — Fetches unanswered night-mode calls from Askozia
- jsonPreviousStats() — Renders json for previous calls stats
- panel() — Renders module controls
- pollUnansweredCalls() — Fetches unanswered calls data from Askozia and stored it into cache
- renderMissedCallsReport() — Renders report of missed calls that required to be processed
- renderNightModeCalls() — Renders unanswered night-mode calls
- renderRecalledCallsReport() — Returns report of recalled numbers
- renderStats() — Renders previous days stats
- saveEditedStats() — Catches existing stats modification request and performs editing
- saveStats() — Saves day unansweres/recalls stats into database