IVR: Better support for the use of base64 Recordings, added option to use Phrases in a couple places, fixed the Exit Sound. (Note: A selected Sound with the same file name as a Recording will get trumped.)
This commit is contained in:
@@ -441,7 +441,7 @@ $text['description-extension']['fr-fr'] = "Choisir le numéro d'extension.";
|
||||
$text['description-extension']['pt-br'] = "Atribua a extensão e números ao dispositivo";
|
||||
$text['description-extension']['pl'] = "Wprowadź numer wewnętrzny. Domyślna konfiguracja pozwala na 2-7 cyfrowe numery wewnętrzne";
|
||||
|
||||
$text['description-exit_sound']['en-us'] = "Played when leaving the menu.";
|
||||
$text['description-exit_sound']['en-us'] = "Played when leaving the menu, after selecting an option.";
|
||||
$text['description-exit_sound']['es-cl'] = "Reproducir cuando se deje el menú.";
|
||||
$text['description-exit_sound']['pt-pt'] = "É tocado quando se abandona o menu.";
|
||||
$text['description-exit_sound']['fr-fr'] = "Joué lorsque l'on quitte ce menu.";
|
||||
|
||||
+138
-59
@@ -431,27 +431,25 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_long == $file && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
}
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_long == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_long == $recording_filename && strlen($ivr_menu_greet_long) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$recording_filename."'>".$recording_name."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
@@ -529,27 +527,25 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$name = $row["recording_name"];
|
||||
$file = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_short == $file && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$file."' selected='selected'>".$file."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$file."'>".$file."</option>\n";
|
||||
}
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
if ($ivr_menu_greet_short == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_greet_short == $recording_filename && strlen($ivr_menu_greet_short) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$recording_filename."'>".$recording_name."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
@@ -647,7 +643,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
$ivr_menu_option_param = str_replace($_SESSION['domain_name'], "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("\${domain_name}", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("\${domain}", "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = ucfirst(trim($ivr_menu_option_param));
|
||||
$ivr_menu_option_param = str_replace(".".$_SESSION['domain_uuid'], "", $ivr_menu_option_param);
|
||||
$ivr_menu_option_param = str_replace("//", "/", $ivr_menu_option_param);
|
||||
//$ivr_menu_option_param = ucfirst(trim($ivr_menu_option_param));
|
||||
echo " <tr>\n";
|
||||
echo " <td class='vtable'>\n";
|
||||
echo " ".$field['ivr_menu_option_digits'];
|
||||
@@ -859,7 +857,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " ".$text['label-invalid_sound']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width=\"70%\" class='vtable' align='left'>\n";
|
||||
echo "<select name='ivr_menu_invalid_sound' class='formfld' style='width: 400px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null)." required='required'>\n";
|
||||
echo "<select name='ivr_menu_invalid_sound' class='formfld' style='width: 350px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null)." required='required'>\n";
|
||||
//misc optgroup
|
||||
if (if_group("superadmin")) {
|
||||
echo "<optgroup label='Misc'>\n";
|
||||
@@ -869,27 +867,24 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
if ($dh = opendir($_SESSION['switch']['recordings']['dir']."/")) {
|
||||
$tmp_selected = false;
|
||||
$files = Array();
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
while($file = readdir($dh)) {
|
||||
if($file != "." && $file != ".." && $file[0] != '.') {
|
||||
if(is_dir($_SESSION['switch']['recordings']['dir'] . "/" . $file)) {
|
||||
//this is a directory
|
||||
}
|
||||
else {
|
||||
if ($ivr_menu_invalid_sound == $_SESSION['switch']['recordings']['dir']."/".$file && strlen($ivr_menu_invalid_sound) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."' selected=\"selected\">".$file."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$file."'>".$file."</option>\n";
|
||||
}
|
||||
}
|
||||
foreach ($recordings as &$row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
if ($ivr_menu_invalid_sound == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_invalid_sound == $recording_filename && strlen($ivr_menu_invalid_sound) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$recording_filename."'>".$recording_name."</option>\n";
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
@@ -957,7 +952,91 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
echo " ".$text['label-exit_sound']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td class='vtable' align='left'>\n";
|
||||
echo " <input class='formfld' type='text' name='ivr_menu_exit_sound' maxlength='255' value=\"$ivr_menu_exit_sound\">\n";
|
||||
echo "<select name='ivr_menu_exit_sound' class='formfld' style='width: 350px;' ".((if_group("superadmin")) ? "onchange='changeToInput(this);'" : null)." required='required'>\n";
|
||||
//misc optgroup
|
||||
if (if_group("superadmin")) {
|
||||
echo "<optgroup label='Misc'>\n";
|
||||
echo " <option value='phrase:'>phrase:</option>\n";
|
||||
echo " <option value='say:'>say:</option>\n";
|
||||
echo " <option value='tone_stream:'>tone_stream:</option>\n";
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//recordings
|
||||
$tmp_selected = false;
|
||||
if (count($recordings) > 0) {
|
||||
echo "<optgroup label='Recordings'>\n";
|
||||
foreach ($recordings as &$row) {
|
||||
$recording_name = $row["recording_name"];
|
||||
$recording_filename = $row["recording_filename"];
|
||||
if ($ivr_menu_exit_sound == $_SESSION['switch']['recordings']['dir']."/".$recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else if ($ivr_menu_exit_sound == $recording_filename && strlen($ivr_menu_exit_sound) > 0) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='".$recording_filename."' selected='selected'>".$recording_name."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='".$recording_filename."'>".$recording_name."</option>\n";
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//phrases
|
||||
$sql = "select * from v_phrases where domain_uuid = '".$domain_uuid."' ";
|
||||
$prep_statement = $db->prepare(check_sql($sql));
|
||||
$prep_statement->execute();
|
||||
$result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
||||
if (count($result) > 0) {
|
||||
echo "<optgroup label='Phrases'>\n";
|
||||
foreach ($result as &$row) {
|
||||
if ($ivr_menu_exit_sound == "phrase:".$row["phrase_name"].".".$domain_uuid) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."' selected='selected'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='phrase:".$row["phrase_name"].".".$domain_uuid."'>".$row["phrase_name"]."</option>\n";
|
||||
}
|
||||
}
|
||||
unset ($prep_statement);
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//sounds
|
||||
$dir_path = $_SESSION['switch']['sounds']['dir'];
|
||||
recur_sounds_dir($_SESSION['switch']['sounds']['dir']);
|
||||
if (count($dir_array) > 0) {
|
||||
echo "<optgroup label='Sounds'>\n";
|
||||
foreach ($dir_array as $key => $value) {
|
||||
if (strlen($value) > 0) {
|
||||
if (substr($ivr_menu_exit_sound, 0, 71) == "\$\${sounds_dir}/\${default_language}/\${default_dialect}/\${default_voice}/") {
|
||||
$ivr_menu_exit_sound = substr($ivr_menu_exit_sound, 71);
|
||||
}
|
||||
if ($ivr_menu_exit_sound == $key) {
|
||||
$tmp_selected = true;
|
||||
echo " <option value='$key' selected='selected'>$key</option>\n";
|
||||
}
|
||||
else {
|
||||
echo " <option value='$key'>$key</option>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
//select
|
||||
if (if_group("superadmin")) {
|
||||
if (!$tmp_selected) {
|
||||
echo "<optgroup label='Selected'>\n";
|
||||
if (file_exists($_SESSION['switch']['recordings']['dir']."/".$ivr_menu_exit_sound)) {
|
||||
echo " <option value='".$_SESSION['switch']['recordings']['dir']."/".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
||||
}
|
||||
else if (substr($ivr_menu_exit_sound, -3) == "wav" || substr($ivr_menu_exit_sound, -3) == "mp3") {
|
||||
echo " <option value='".$ivr_menu_exit_sound."' selected='selected'>".$ivr_menu_exit_sound."</option>\n";
|
||||
}
|
||||
echo "</optgroup>\n";
|
||||
}
|
||||
unset($tmp_selected);
|
||||
}
|
||||
echo "</select>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-exit_sound']."\n";
|
||||
echo "</td>\n";
|
||||
|
||||
Reference in New Issue
Block a user