From af64f66cc7bc020f4814b8ae3727ec05d281ba8f Mon Sep 17 00:00:00 2001 From: markjcrane Date: Mon, 19 Oct 2015 20:58:16 -0600 Subject: [PATCH] Fix a null error and translation for select option voicemail. --- app/call_block/call_block_edit.php | 8 ++++---- resources/install/scripts/app/call_block/index.lua | 11 ++++------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/app/call_block/call_block_edit.php b/app/call_block/call_block_edit.php index b67fa81b57..8cae586146 100644 --- a/app/call_block/call_block_edit.php +++ b/app/call_block/call_block_edit.php @@ -44,7 +44,7 @@ else { //define the call_block_get_extensions function function call_block_get_extensions($select_extension) { - global $db; + global $db, $text; //list voicemail $sql = "select extension, user_context, description from v_extensions "; @@ -55,12 +55,12 @@ else { $prep_statement->execute(); $result = $prep_statement->fetchAll(PDO::FETCH_ASSOC); - echo "\n"; + echo "\n"; foreach ($result as &$row) { $extension = $row["extension"]; $context = $row["user_context"]; $description = $row["description"]; - if ($extension == $select_extension) $selected = "SELECTED"; + if ($extension == $select_extension) $selected = "selected='selected'"; echo " \n"; $selected = ""; } @@ -77,7 +77,7 @@ else { } //get http post variables and set them to php variables - if (count($_POST)>0) { + if (count($_POST) > 0) { $call_block_name = check_str($_POST["call_block_name"]); $call_block_number = check_str($_POST["call_block_number"]); $call_block_action = check_str($_POST["call_block_action"]); diff --git a/resources/install/scripts/app/call_block/index.lua b/resources/install/scripts/app/call_block/index.lua index f6b1a23d94..91c7056b40 100644 --- a/resources/install/scripts/app/call_block/index.lua +++ b/resources/install/scripts/app/call_block/index.lua @@ -177,15 +177,12 @@ This method causes the script to get its manadatory arguments directly from the logger("W", "NOTICE", "number " .. params["cid_num"] .. " blocked with " .. found_count .. " previous hits, domain_name: " .. params["domain_name"]) if (found_action == "Reject") then session:hangup("CALL_REJECTED") - end - if (found_action == "Busy") then + elseif (found_action == "Busy") then session:hangup("USER_BUSY") - end - if (details[0] =="Hold") then + elseif (found_action =="Hold") then session:setAutoHangup(false) - session:execute("transfer", "*9664 XML " .. details[1]) - end - if (details[0] =="Voicemail") then + session:execute("transfer", "*9664") + elseif (details[0] =="Voicemail") then session:setAutoHangup(false) session:execute("transfer", "*99" .. details[2] .. " XML " .. details[1]) end