2 namespace callnotifier;
4 class Logger_CallEcho implements Logger
6 public function log($type, $arData)
10 $this->displayStart($arData['call']);
13 $this->displayFinished($arData['call']);
19 protected function displayStart(CallMonitor_Call $call)
21 echo 'Starting ' . $this->getTypeName($call)
22 . ' call from ' . $call->from
23 . ' to ' . $call->to . "\n";
26 protected function displayFinished(CallMonitor_Call $call)
28 echo 'Finished ' . $this->getTypeName($call)
29 . ' call from ' . $call->from
31 . ', length ' . date('H:i:s', $call->end - $call->start - 3600)
35 protected function getTypeName($call)
37 return $call->type == CallMonitor_Call::INCOMING
38 ? 'incoming' : 'outgoing';