diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-08-04 23:26:16 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-08-04 23:26:16 +0200 |
| commit | 29ff32499e239e6189b80ef3b9e76384920205a7 (patch) | |
| tree | bce5a98c6bae87490b1ef863acf0f08485b80675 /src/callnotifier/CallMonitor.php | |
| parent | b8217d4cb0bdfea171cde633b0a196fc7dfd4a9d (diff) | |
| download | auerswald-callnotifier-29ff32499e239e6189b80ef3b9e76384920205a7.tar.gz auerswald-callnotifier-29ff32499e239e6189b80ef3b9e76384920205a7.zip | |
begin work on call detaillers (load name from ldap, load location from opengeodb)
Diffstat (limited to 'src/callnotifier/CallMonitor.php')
| -rw-r--r-- | src/callnotifier/CallMonitor.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/callnotifier/CallMonitor.php b/src/callnotifier/CallMonitor.php index 428136f..7c6168c 100644 --- a/src/callnotifier/CallMonitor.php +++ b/src/callnotifier/CallMonitor.php @@ -13,12 +13,24 @@ class CallMonitor { protected $currentCalls = array(); + /** + * Array of objects that are able to load details for a call + * + * @var array + */ + protected $detaillers = array(); + public function __construct($config, $log) { $this->config = $config; $this->log = $log; } + public function addDetailler(CallMonitor_Detailler $detailler) + { + $this->detaillers[] = $detailler; + } + public function handle(EDSS1_Message $msg) { $callId = $msg->callRef; @@ -82,6 +94,7 @@ class CallMonitor unset($this->currentCalls[$otherCallId]); } } + $this->loadCallDetails($call); $this->log->log('startingCall', array('call' => $call)); break; @@ -131,6 +144,19 @@ class CallMonitor } return $number; } + + /** + * Load details for a call, e.g. the name of the calling person + * or the area + * + * @return void + */ + protected function loadCallDetails($call) + { + foreach ($this->detaillers as $detailler) { + $detailler->loadCallDetails($call); + } + } } ?> |
