diff --git a/protected/controllers/IvrController.php b/protected/controllers/IvrController.php index 0d0adb8f2..80d62b4cb 100755 --- a/protected/controllers/IvrController.php +++ b/protected/controllers/IvrController.php @@ -250,8 +250,8 @@ public function setAttributesModels($attributes, $models) public function actionDeleteAudio() { - shell_exec('rm -rf ' . $this->uploaddir . '/idIvrDidWork_*_' . $_POST['id_ivr'] . '*'); - shell_exec('rm -rf ' . $this->uploaddir . '/idIvrDidNoWork_*_' . $_POST['id_ivr'] . '*'); + shell_exec('rm -rf ' . $this->uploaddir . 'idIvrDidWork_' . $_POST['id_ivr'] . '*'); + shell_exec('rm -rf ' . $this->uploaddir . 'idIvrDidNoWork_' . $_POST['id_ivr'] . '*'); echo json_encode(array( $this->nameSuccess => true, $this->nameMsg => $this->msgSuccess, diff --git a/protected/controllers/PlayAudioController.php b/protected/controllers/PlayAudioController.php index 7048bc579..96d2cb969 100755 --- a/protected/controllers/PlayAudioController.php +++ b/protected/controllers/PlayAudioController.php @@ -26,7 +26,17 @@ class PlayAudioController extends Controller public function actionIndex() { - $file_name = $this->magnusFilesDirectory . 'sounds/' . $_GET['audio']; + if (preg_match('/queue-periodic/', $_GET['audio'])) { + $file_name = '/var/lib/asterisk/sounds/' . $_GET['audio']; + + if (file_exists($file_name . '.gsm')) { + $file_name .= '.gsm'; + } else { + $file_name .= '.wav'; + } + } else { + $file_name = $this->magnusFilesDirectory . 'sounds/' . $_GET['audio']; + } if (!file_exists($file_name)) { exit('