From 192a3fb3865371fb044255750dc25662fb79e706 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Wed, 3 Sep 2014 03:32:46 +0000 Subject: [PATCH] Dialplan destinations do not add the dialplan if the action was not defined --- app/destinations/destination_edit.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/destinations/destination_edit.php b/app/destinations/destination_edit.php index 0eae3fb69b..e72cd63eb6 100644 --- a/app/destinations/destination_edit.php +++ b/app/destinations/destination_edit.php @@ -132,7 +132,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $_POST["domain_uuid"] = $_SESSION['domain_uuid']; //add or update the dialplan if the destination number is set - if (strlen($destination_number) > 0) { + if (strlen($_POST["dialplan_details"][0]["dialplan_detail_data"]) > 0) { //get the array $dialplan_details = $_POST["dialplan_details"]; @@ -231,7 +231,7 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "accountcode=".$destination_accountcode; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; - + //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; } @@ -278,10 +278,10 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $dialplan["dialplan_details"][$y]["dialplan_detail_data"] = "tone_detect_hits=1"; $dialplan["dialplan_details"][$y]["dialplan_detail_order"] = $dialplan_detail_order; $y++; - + //increment the dialplan detail order $dialplan_detail_order = $dialplan_detail_order + 10; - + // execute on tone detect $dialplan["dialplan_details"][$y]["domain_uuid"] = $_SESSION['domain_uuid']; $dialplan["dialplan_details"][$y]["dialplan_detail_tag"] = "action"; @@ -412,7 +412,6 @@ if (count($_POST) > 0 && strlen($_POST["persistformvar"]) == 0) { $db2->sql = "INSERT INTO v_billing_invoices (billing_invoice_uuid, billing_uuid, payer_uuid, billing_payment_date, settled, amount, debt, post_payload,plugin_used, domain_uuid) VALUES ('$billing_invoice_uuid', '$billing_uuid', '$user_uuid', NOW(), $settled, $mc_gross, $balance, '$post_payload', 'DID $destination_number Assigment', '".$_SESSION['domain_uuid']."' )"; $db2->result = $db2->execute(); unset($db2->sql, $db2->result); - } } if ($action == "update") {