From 77bdca8a6e06002f749f0a02e56b264f6e5129a2 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Fri, 27 Apr 2018 23:44:54 -0600 Subject: [PATCH] Update destination_edit.php --- app/destinations/destination_edit.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 4b2280c680..d1ebf23fc6 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -93,7 +93,6 @@ $destination_caller_id_number = check_str($_POST["destination_caller_id_number"]); $destination_cid_name_prefix = check_str($_POST["destination_cid_name_prefix"]); $destination_context = check_str($_POST["destination_context"]); - $destination_action = check_str($_POST["destination_action"]); $fax_uuid = check_str($_POST["fax_uuid"]); $destination_enabled = check_str($_POST["destination_enabled"]); $destination_description = check_str($_POST["destination_description"]); @@ -112,8 +111,16 @@ $destination_app = $destination_array[0]; $destination_data = $destination_array[1]; unset($_POST["destination_action"]); + //get the alternate destination app and data + $destination_alternate_array = explode(":", $_POST["destination_alternate_action"], 2); + $destination_alternate_app = $destination_alternate_array[0]; + $destination_alternate_data = $destination_alternate_array[1]; + unset($_POST["destination_alternate_action"]); + //set the application and data $_POST["destination_app"] = $destination_app; $_POST["destination_data"] = $destination_data; + $_POST["destination_alternate_app"] = $destination_alternate_app; + $_POST["destination_alternate_data"] = $destination_alternate_data; //unset the db_destination_number unset($_POST["db_destination_number"]); } @@ -244,6 +251,10 @@ $dialplan["dialplan_xml"] .= " \n"; $dialplan["dialplan_xml"] .= " \n"; $dialplan["dialplan_xml"] .= " \n"; + if (strlen($destination_alternate_app) > 0) { + $dialplan["dialplan_xml"] .= " \n"; + $dialplan["dialplan_xml"] .= " \n"; + } if (strlen($destination_cid_name_prefix) > 0) { $dialplan["dialplan_xml"] .= " \n"; } @@ -268,6 +279,9 @@ $dialplan["dialplan_xml"] .= " \n"; } $dialplan["dialplan_xml"] .= " \n"; + if (strlen($destination_alternate_app) > 0) { + $dialplan["dialplan_xml"] .= " \n"; + } $dialplan["dialplan_xml"] .= " \n"; $dialplan["dialplan_xml"] .= "\n"; } @@ -629,6 +643,8 @@ $destination_context = $row["destination_context"]; $destination_app = $row["destination_app"]; $destination_data = $row["destination_data"]; + $destination_alternate_app = $row["destination_alternate_app"]; + $destination_alternate_data = $row["destination_alternate_data"]; $fax_uuid = $row["fax_uuid"]; $destination_enabled = $row["destination_enabled"]; $destination_description = $row["destination_description"]; @@ -838,6 +854,9 @@ echo "\n"; $destination_action = $destination_app.":".$destination_data; echo $destination->select('dialplan', 'destination_action', $destination_action); + echo "
\n"; + $destination_alternate_action = $destination_alternate_app.":".$destination_alternate_data; + echo $destination->select('dialplan', 'destination_alternate_action', $destination_alternate_action); echo "\n"; echo "\n"; }