aboutsummaryrefslogtreecommitdiff
path: root/src/callnotifier/Logger
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2012-07-31 07:49:52 +0200
committerChristian Weiske <cweiske@cweiske.de>2012-07-31 07:49:52 +0200
commitdec68e4aaf86f4db07d0a313516319a6d37d88fe (patch)
treea29cc26e8ddf8b7ae967a6593ce2e528203cd072 /src/callnotifier/Logger
parent822f3d0bb9ca915fd853fa2fa737bffdc8e58b40 (diff)
downloadauerswald-callnotifier-dec68e4aaf86f4db07d0a313516319a6d37d88fe.tar.gz
auerswald-callnotifier-dec68e4aaf86f4db07d0a313516319a6d37d88fe.zip
call echo logger
Diffstat (limited to 'src/callnotifier/Logger')
-rw-r--r--src/callnotifier/Logger/CallEcho.php33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/callnotifier/Logger/CallEcho.php b/src/callnotifier/Logger/CallEcho.php
new file mode 100644
index 0000000..fe8b9b4
--- /dev/null
+++ b/src/callnotifier/Logger/CallEcho.php
@@ -0,0 +1,33 @@
+<?php
+namespace callnotifier;
+
+class Logger_CallEcho implements Logger
+{
+ public function log($type, $arData)
+ {
+ switch ($type) {
+ case 'incomingCall':
+ $this->displayIncoming($arData['call']);
+ break;
+ case 'finishedCall':
+ $this->displayFinished($arData['call']);
+ break;
+ }
+ }
+
+
+ protected function displayIncoming(CallMonitor_Call $call)
+ {
+ echo 'Incoming call from ' . $call->from
+ . ' to ' . $call->to . "\n";
+ }
+
+ protected function displayFinished(CallMonitor_Call $call)
+ {
+ echo 'Finished call from ' . $call->from
+ . ' to ' . $call->to
+ . ', length ' . date('H:i:s', $call->end - $call->start - 3600)
+ . "\n";
+ }
+}
+?>