load call details on finished calls, too
[auerswald-callnotifier.git] / src / callnotifier / CallMonitor / Detailler / CSV.php
index 22611699204ddeb38da0e58ba8a1812af2008230..ab881dd2f3a88cd05c6971851a202a26b360445a 100644 (file)
@@ -66,9 +66,13 @@ class CallMonitor_Detailler_CSV implements CallMonitor_Detailler
     public function loadCallDetails(CallMonitor_Call $call)
     {
         if ($call->type == CallMonitor_Call::INCOMING) {
-            $call->fromName = $this->loadName($call->from);
+            if (!isset($call->fromName) || $call->fromName === null) {
+                $call->fromName = $this->loadName($call->from);
+            }
         } else {
-            $call->toName = $this->loadName($call->to);
+            if (!isset($call->toName) || $call->toName === null) {
+                $call->toName = $this->loadName($call->to);
+            }
         }
     }