From a0ab52d36901e7c0c4976f43dcb69b73e6fcd1b5 Mon Sep 17 00:00:00 2001 From: emaktech Date: Wed, 3 Mar 2021 15:48:17 -0500 Subject: [PATCH] CDR - Don't Check Filesystem for Recording on Load I have been debugging slow loading on our CDR pages for the last few days now. One issue that we have encountered is that currently as the page loads, it checks the filesystem for each file one at a time. In our case, we move recordings to object storage after 1 week, so each time we check for a file it passes api calls which take over 1 second each to return a result. This causes this page to not load at all for us in many cases. Regardless, this current method is unnecessarily I/O intensive and really page load is probably not the time to be checking for each file one by one. So this PR is the simplest solution - remove the check entirely. I would contend that the administrator should remove the record_path from the database if the file was removed so this should be acceptable. This solves this particular issue for us, but would need feedback from others if not checking for files makes sense. --- app/xml_cdr/xml_cdr.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/xml_cdr/xml_cdr.php b/app/xml_cdr/xml_cdr.php index 05d889091b..adf9c25588 100644 --- a/app/xml_cdr/xml_cdr.php +++ b/app/xml_cdr/xml_cdr.php @@ -762,7 +762,7 @@ } //recording if (permission_exists('xml_cdr_recording') && (permission_exists('xml_cdr_recording_play') || permission_exists('xml_cdr_recording_download'))) { - if ($record_path != '' && file_exists($record_path.'/'.$record_name)) { + if ($record_path != '') { $content .= " "; if (permission_exists('xml_cdr_recording_play')) { $content .= "";