aboutsummaryrefslogtreecommitdiff
path: root/src/callnotifier/CallMonitor.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/callnotifier/CallMonitor.php')
-rw-r--r--src/callnotifier/CallMonitor.php26
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);
+ }
+ }
}
?>