Ticket #3621: callmonitor.module2.patch

File callmonitor.module2.patch, 1.5 kB (added by Nick_Lewis, 3 years ago)
  • old/callmonitor.module

    old new  
    430430      $lastdata = $data_value['lastdata']; 
    431431      $uniqueid = $data_value['uniqueid']; 
    432432      $userfield = $data_value['userfield']; 
     433      $src = $data_value['src']; 
     434      $dst = $data_value['dst']; 
    433435 
    434436      // timestamps 
    435437      $st = trim(strtotime($calldate)); 
     
    508510          } 
    509511        }  
    510512 
    511         // try and match a file using the calldate (if no unique number from database)  
     513        // try and match a file using the calldate (if no unique number from database or no unique number in file)  
    512514        if (!$recording) {  
    513515 
    514516          foreach($files as $key => $path) { 
     517            list($path,$filetype) = explode(".",$path,2); 
    515518            $parts = split("-", $path); 
    516             if (strlen($st)>1 &&  
    517                    (strpos($path,$st)!==FALSE) ||  
    518                    (strpos($path,"auto")!==FALSE && $parts[1] >= $st && $parts[1] <= $et)) { 
    519               $recording = $path; 
     519            if ((strlen($st)>1 && strpos($path,$st)!==FALSE && strlen($uniqueid)<=1) ||  
     520                    (strpos($path,"auto")!==FALSE && $parts[1] >= $st && $parts[1] <= $et && $parts[2] == $src && $parts[3] == $dst)) { 
     521              $recording = $path . "." . $filetype; 
    520522              $files[$key] = '';  // remove it from the recording files so it will not be matched twice 
    521523              break; 
    522524            }