all loggers support call type and MSN filtering now
[auerswald-callnotifier.git] / src / callnotifier / Logger / CallNotifySend.php
index d5cb9dd5ea6ac087cf226a657a51277609a7aee4..74c930e0ef6f1b1b4c9604ab6a801c8ef0f84fb8 100644 (file)
@@ -7,12 +7,23 @@ class Logger_CallNotifySend extends Logger_CallBase
     {
         switch ($type) {
         case 'startingCall':
-            $this->displayStart($arData['call']);
+            $displayMethod = 'displayStart';
             break;
         case 'finishedCall':
-            $this->displayFinished($arData['call']);
+            $displayMethod = 'displayFinished';
             break;
+        default:
+            return;
         }
+
+        $call = $arData['call'];
+        if (!$this->hasValidType($call)) {
+            return;
+        }
+        if (!$this->hasValidMsn($call)) {
+            return;
+        }
+        $this->$displayMethod($arData['call']);
     }
 
 
@@ -54,11 +65,12 @@ class Logger_CallNotifySend extends Logger_CallBase
         exec(
             'notify-send'
             . ' -u low'
-            . ' --expire-time=1000'
+            . ' --expire-time=5000'
             . ' -i phone'
             . ' -c callmonitor'
             . ' ' . escapeshellarg($title)
             . ' ' . escapeshellarg($msg)
+            . ' > /dev/null 2>&1 &'
         );
     }
 }