From 71ed41b56701a84132f012f5b1fcb76bee869e6f Mon Sep 17 00:00:00 2001 From: Riccardo Granchi Date: Wed, 5 Nov 2014 09:05:35 +0000 Subject: [PATCH] Fixed phone's redial problem, adding the ability to specify the outbound prefix in inbound route --- app/dialplan_inbound/app_languages.php | 10 +++++ app/dialplan_inbound/dialplan_inbound_add.php | 41 +++++++++++++++++++ 2 files changed, 51 insertions(+) diff --git a/app/dialplan_inbound/app_languages.php b/app/dialplan_inbound/app_languages.php index d83433d13e..df90ccaa84 100644 --- a/app/dialplan_inbound/app_languages.php +++ b/app/dialplan_inbound/app_languages.php @@ -57,6 +57,16 @@ $text['label-action']['pt-pt'] = "Acção"; $text['label-action']['fr-fr'] = "Action"; + $text['label-redial-outbound-prefix']['en-us'] = "Redial outbound prefix"; + $text['label-redial-outbound-prefix']['es-cl'] = "Redial prefijo de salida"; + $text['label-redial-outbound-prefix']['pt-pt'] = "Remarcar prefixo de saída"; + $text['label-redial-outbound-prefix']['fr-fr'] = "Bis préfixe pour sortant"; + + $text['description-redial-outbound-prefix']['en-us'] = "Effective Caller ID Number prefix"; + $text['description-redial-outbound-prefix']['es-cl'] = "Prefijo par Número de Caller ID Efectivo"; + $text['description-redial-outbound-prefix']['pt-pt'] = "Prefixo par Número interno"; + $text['description-redial-outbound-prefix']['fr-fr'] = "Préfixe pour Numéro interne"; + $text['label-limit']['en-us'] = "Limit"; $text['label-limit']['es-cl'] = "Límite"; $text['label-limit']['pt-pt'] = "Limite"; diff --git a/app/dialplan_inbound/dialplan_inbound_add.php b/app/dialplan_inbound/dialplan_inbound_add.php index 259ad94340..39b62cee67 100644 --- a/app/dialplan_inbound/dialplan_inbound_add.php +++ b/app/dialplan_inbound/dialplan_inbound_add.php @@ -23,6 +23,7 @@ Contributor(s): Mark J Crane Luis Daniel Lucio Quiroz + Riccardo Granchi */ include "root.php"; require_once "resources/require.php"; @@ -55,6 +56,7 @@ require_once "resources/paging.php"; //get the http post values and set them as php variables if (count($_POST)>0) { $dialplan_name = check_str($_POST["dialplan_name"]); + $redial_outbound_prefix = check_str($_POST["redial_outbound_prefix"]); $limit = check_str($_POST["limit"]); $public_order = check_str($_POST["public_order"]); $condition_field_1 = check_str($_POST["condition_field_1"]); @@ -370,6 +372,33 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { unset($sql); } + //set redial outbound prefix + if (strlen($redial_outbound_prefix) > 0) { + $dialplan_detail_uuid = uuid(); + $sql = "insert into v_dialplan_details "; + $sql .= "("; + $sql .= "domain_uuid, "; + $sql .= "dialplan_uuid, "; + $sql .= "dialplan_detail_uuid, "; + $sql .= "dialplan_detail_tag, "; + $sql .= "dialplan_detail_type, "; + $sql .= "dialplan_detail_data, "; + $sql .= "dialplan_detail_order "; + $sql .= ") "; + $sql .= "values "; + $sql .= "("; + $sql .= "'$domain_uuid', "; + $sql .= "'$dialplan_uuid', "; + $sql .= "'$dialplan_detail_uuid', "; + $sql .= "'action', "; + $sql .= "'set', "; + $sql .= "'effective_caller_id_number=".$redial_outbound_prefix."\${caller_id_number}', "; + $sql .= "'72' "; + $sql .= ")"; + $db->exec(check_sql($sql)); + unset($sql); + } + //set fax_uuid if (strlen($fax_uuid) > 0) { //get the fax information @@ -931,6 +960,18 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) { echo "\n"; echo "\n"; + echo "\n"; + echo "\n"; + echo " ".$text['label-redial-outbound-prefix'].":\n"; + echo "\n"; + echo "\n"; + echo " \n"; + echo "
\n"; + echo "".$text['description-redial-outbound-prefix']."
\n"; + echo "\n"; + echo "\n"; + echo "\n"; + echo "\n"; echo "\n"; echo " ".$text['label-order'].":\n";