diff --git a/app/call_flows/app_config.php b/app/call_flows/app_config.php index aeaa615769..475f61b1c0 100644 --- a/app/call_flows/app_config.php +++ b/app/call_flows/app_config.php @@ -132,4 +132,12 @@ $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "Enter the description."; $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_sound_on"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "Select the sound when on."; + $z++; + $apps[$x]['db'][$y]['fields'][$z]['name'] = "call_flow_sound_off"; + $apps[$x]['db'][$y]['fields'][$z]['type'] = "text"; + $apps[$x]['db'][$y]['fields'][$z]['description']['en'] = "Select the sound when off."; + $z++; ?> diff --git a/app/call_flows/app_languages.php b/app/call_flows/app_languages.php index f7e220fd14..6ed6cf66ff 100644 --- a/app/call_flows/app_languages.php +++ b/app/call_flows/app_languages.php @@ -120,6 +120,26 @@ $text['label-alternate_destination']['sv-se'] = "Alternativ Destination"; $text['label-alternate_destination']['uk'] = ""; $text['label-alternate_destination']['de-at'] = "Alternatives Ziel"; +$text['label-sound_on']['en-us'] = "Sound"; +$text['label-sound_on']['es-cl'] = ""; +$text['label-sound_on']['pt-pt'] = ""; +$text['label-sound_on']['fr-fr'] = ""; +$text['label-sound_on']['pt-br'] = ""; +$text['label-sound_on']['pl'] = ""; +$text['label-sound_on']['sv-se'] = ""; +$text['label-sound_on']['uk'] = ""; +$text['label-sound_on']['de-at'] = ""; + +$text['label-sound_off']['en-us'] = "Alternate Sound"; +$text['label-sound_off']['es-cl'] = ""; +$text['label-sound_off']['pt-pt'] = ""; +$text['label-sound_off']['fr-fr'] = ""; +$text['label-sound_off']['pt-br'] = ""; +$text['label-sound_off']['pl'] = ""; +$text['label-sound_off']['sv-se'] = ""; +$text['label-sound_off']['uk'] = ""; +$text['label-sound_off']['de-at'] = ""; + $text['header-call_flows']['en-us'] = "Call Flows"; $text['header-call_flows']['es-cl'] = "flujo de Llamada"; $text['header-call_flows']['pt-pt'] = "Fluxo de Chamadas"; @@ -260,4 +280,24 @@ $text['description-alternate_destination']['sv-se'] = "Välj den alternativa des $text['description-alternate_destination']['uk'] = ""; $text['description-alternate_destination']['de-at'] = "Wählen Sie ein alternatives Ziel."; +$text['description-sound_on']['en-us'] = "Select the sound when on."; +$text['description-sound_on']['es-cl'] = ""; +$text['description-sound_on']['pt-pt'] = ""; +$text['description-sound_on']['fr-fr'] = ""; +$text['description-sound_on']['pt-br'] = ""; +$text['description-sound_on']['pl'] = ""; +$text['description-sound_on']['sv-se'] = ""; +$text['description-sound_on']['uk'] = ""; +$text['description-sound_on']['de-at'] = ""; + +$text['description-sound_off']['en-us'] = "Select the sound when off."; +$text['description-sound_off']['es-cl'] = ""; +$text['description-sound_off']['pt-pt'] = ""; +$text['description-sound_off']['fr-fr'] = ""; +$text['description-sound_off']['pt-br'] = ""; +$text['description-sound_off']['pl'] = ""; +$text['description-sound_off']['sv-se'] = ""; +$text['description-sound_off']['uk'] = ""; +$text['description-sound_off']['de-at'] = ""; + ?> \ No newline at end of file diff --git a/app/call_flows/call_flow_edit.php b/app/call_flows/call_flow_edit.php index 1380c69912..1560528bb7 100644 --- a/app/call_flows/call_flow_edit.php +++ b/app/call_flows/call_flow_edit.php @@ -61,6 +61,8 @@ else { $call_flow_anti_label = check_str($_POST["call_flow_anti_label"]); $call_flow_alternate_destination = check_str($_POST["call_flow_alternate_destination"]); $call_flow_description = check_str($_POST["call_flow_description"]); + $call_flow_sound_on = check_str($_POST["call_flow_sound_on"]); + $call_flow_sound_off = check_str($_POST["call_flow_sound_off"]); $dialplan_uuid = check_str($_POST["dialplan_uuid"]); //seperate the action and the param @@ -139,7 +141,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "call_flow_anti_label, "; $sql .= "call_flow_anti_app, "; $sql .= "call_flow_anti_data, "; - $sql .= "call_flow_description "; + $sql .= "call_flow_description, "; + $sql .= "call_flow_sound_on, "; + $sql .= "call_flow_sound_off "; $sql .= ")"; $sql .= "values "; $sql .= "("; @@ -158,7 +162,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "'$call_flow_anti_label', "; $sql .= "'$call_flow_anti_app', "; $sql .= "'$call_flow_anti_data', "; - $sql .= "'$call_flow_description' "; + $sql .= "'$call_flow_description', "; + $sql .= "'$call_flow_sound_on', "; + $sql .= "'$call_flow_sound_off' "; $sql .= ")"; $db->exec(check_sql($sql)); unset($sql); @@ -184,7 +190,9 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $sql .= "call_flow_anti_label = '$call_flow_anti_label', "; $sql .= "call_flow_anti_app = '$call_flow_anti_app', "; $sql .= "call_flow_anti_data = '$call_flow_anti_data', "; - $sql .= "call_flow_description = '$call_flow_description' "; + $sql .= "call_flow_description = '$call_flow_description', "; + $sql .= "call_flow_sound_on = '$call_flow_sound_on', "; + $sql .= "call_flow_sound_off = '$call_flow_sound_off' "; $sql .= "where domain_uuid = '$domain_uuid' "; $sql .= "and call_flow_uuid = '$call_flow_uuid'"; $db->exec(check_sql($sql)); @@ -381,6 +389,8 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $call_flow_anti_app = $row["call_flow_anti_app"]; $call_flow_anti_data = $row["call_flow_anti_data"]; $call_flow_description = $row["call_flow_description"]; + $call_flow_sound_on = $row["call_flow_sound_on"]; + $call_flow_sound_off = $row["call_flow_sound_off"]; $dialplan_uuid = $row["dialplan_uuid"]; //if superadmin show both the app and data @@ -416,6 +426,152 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $document['title'] = $text['title-call_flow-add']; } +//get the recordings + $sql = "select recording_name, recording_filename from v_recordings "; + $sql .= "where domain_uuid = '".$_SESSION["domain_uuid"]."' "; + $sql .= "order by recording_name asc "; + $prep_statement = $db->prepare(check_sql($sql)); + $prep_statement->execute(); + $recordings = $prep_statement->fetchAll(PDO::FETCH_ASSOC); + + if (if_group("superadmin")) { + echo "\n"; + echo "\n"; + } + + function sound_select_list($var, $name, $description_name, $load_sound=false) { + global $text, $recordings, $db; + + echo "