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('

' . Yii::t('zii', 'File not found') . '
'); diff --git a/resources/asterisk/IvrAgi.php b/resources/asterisk/IvrAgi.php index c0a379a28..76ccd11a2 100755 --- a/resources/asterisk/IvrAgi.php +++ b/resources/asterisk/IvrAgi.php @@ -40,7 +40,7 @@ public function callIvr(&$agi, &$MAGNUS, &$CalcAgi, &$DidAgi = null, $type = 'iv $work = $MAGNUS->checkIVRSchedule($modelIvr->monFriStart, $modelIvr->satStart, $modelIvr->sunStart); if ($modelIvr->use_holidays == 1) { - $sql = "SELECT * FROM pkg_holidays WHERE day = " . date('Y-m-d') . " LIMIT 1"; + $sql = "SELECT * FROM pkg_holidays WHERE day = '" . date('Y-m-d') . "' LIMIT 1"; $modelHolidays = $agi->query($sql)->fetch(PDO::FETCH_OBJ); if (isset($modelHolidays->id)) { $work = 'closed';