2 namespace callnotifier;
4 class Logger_CallEcho extends Logger_CallBase
6 public function log($type, $arData)
10 $this->displayStart($arData['call']);
13 $this->displayFinished($arData['call']);
19 protected function displayStart(CallMonitor_Call $call)
21 $this->addUnsetVars($call);
22 echo 'Starting ' . $this->getTypeName($call)
23 . ' call from ' . trim($this->getNumberString($call, 'from'))
24 . ' to ' . trim($this->getNumberString($call, 'to')) . "\n";
27 protected function displayFinished(CallMonitor_Call $call)
29 $this->addUnsetVars($call);
30 echo 'Finished ' . $this->getTypeName($call)
31 . ' call from ' . trim($this->getNumberString($call, 'from'))
32 . ' to ' . trim($this->getNumberString($call, 'to'))
33 . ', length ' . date('H:i:s', $call->end - $call->start - 3600)
37 protected function getTypeName($call)
39 return $call->type == CallMonitor_Call::INCOMING
40 ? 'incoming' : 'outgoing';