{
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']);
}
. ' -c callmonitor'
. ' ' . escapeshellarg($title)
. ' ' . escapeshellarg($msg)
+ . ' > /dev/null 2>&1 &'
);
}
}