FreeSWITCH: Recordings

0) { foreach ($a_recordings as $recordingent) { $config_recording_list .= $recordingent['filename']."|"; $i++; } } $config_change = 0; if (is_dir($recording_dir)) { if ($dh = opendir($recording_dir)) { while (($file = readdir($dh)) !== false) { if (filetype($recording_dir . $file) == "file") { if (strpos($config_recording_list, $file) === false) { //$handle = fopen($recording_dir.$file,'rb'); //$file_content = fread($handle,filesize($recording_dir.$file)); //fclose($handle); $a_file = split("\.", $file); $recordingent = array(); $recordingent['filename'] = $file; $recordingent['recordingname'] = $a_file[0]; //$recordingent['filecontent'] = base64_encode($file_content); $recordingent['descr'] = 'Auto'; $a_recordings[] = $recordingent; write_config(); unset($file_content); } else { //echo "The file was found.
"; } } } closedir($dh); } } //saved for future use if and when config.xml scales well //enough to save the files inside it //$i = 0; //if (count($a_recordings) > 0) { // foreach ($a_recordings as $recordingent) { // if (!is_file($recording_dir.$recordingent['filename'])) { //echo "not found: ".$recordingent['filename']."
"; //recording not found restore the file from the config.xml //$file_content = $recordingent['filecontent']; //$handle = fopen($recording_dir.$recordingent['filename'],'w'); //fwrite ($handle, base64_decode($file_content)); //unset($file_content); //fclose($handle); //$recordingent['filecontent'] = base64_encode($file_content); // loop through recordings in the config.xml // if the file does not exist remove it from the file system. //unset($a_recordings[$i]); // $config_change = 1; // } // else { //echo "found: ".$recordingent['filename']."
"; // } // $i++; // } //} if ($config_change == 1) { write_config(); $config_change = 0; } //if ($savemsg) print_info_box($savemsg); //if (file_exists($d_hostsdirty_path)): echo"

"; //print_info_box_np("The FreeSWITCH recordings have been changed.
You must apply the changes in order for them to take effect."); //echo"
"; //endif; ?>

Note:
To make a recording dial extension 732673 (record) or you can make a 16bit 8khz/16khz Mono WAV file then copy it to the following directory then refresh the page to play it back. Click on the 'Filename' to download it or the 'Recording Name' to play the audio.

/usr/local/freeswitch/recordings/


0) { foreach ($a_recordings as $recordingent) { ?>
Filename (download) Recording Name (play) Description