2 namespace callnotifier;
4 class Logger_CallNotifySend extends Logger_CallBase
6 public function log($type, $arData)
10 $displayMethod = 'displayStart';
13 $displayMethod = 'displayFinished';
19 $call = $arData['call'];
20 if (!$this->hasValidType($call)) {
23 if (!$this->hasValidMsn($call)) {
26 $this->$displayMethod($arData['call']);
30 protected function displayStart(CallMonitor_Call $call)
32 $this->addUnsetVars($call);
33 if ($call->type == CallMonitor_Call::INCOMING) {
35 trim($this->getNumberString($call, 'from')),
40 trim($this->getNumberString($call, 'to')),
46 protected function displayFinished(CallMonitor_Call $call)
48 $this->addUnsetVars($call);
49 if ($call->type == CallMonitor_Call::INCOMING) {
50 $title = trim($this->getNumberString($call, 'from'));
51 $msg = 'End of incoming call';
53 $title = trim($this->getNumberString($call, 'to'));
54 $msg = 'End of outgoing call';
59 . ', length ' . date('H:i:s', $call->end - $call->start - 3600)
63 protected function notify($title, $msg)
68 . ' --expire-time=5000'
71 . ' ' . escapeshellarg($title)
72 . ' ' . escapeshellarg($msg)
73 . ' > /dev/null 2>&1 &'