From fdeb3fb1b0bd37bd53b98a5e2d3cc21713176865 Mon Sep 17 00:00:00 2001 From: Mark Crane Date: Fri, 1 Nov 2013 15:50:49 +0000 Subject: [PATCH] Fix an error that occurs on a few systems when adding a domain. --- resources/install/scripts/intercept.lua | 3 ++- resources/switch.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/install/scripts/intercept.lua b/resources/install/scripts/intercept.lua index 67cf593bae..39d11463d5 100644 --- a/resources/install/scripts/intercept.lua +++ b/resources/install/scripts/intercept.lua @@ -55,6 +55,7 @@ if ( session:ready() ) then pin_number = session:getVariable("pin_number"); sounds_dir = session:getVariable("sounds_dir"); domain_name = session:getVariable("domain_name"); + context = session:getVariable("context"); --set the sounds path for the language, dialect and voice default_language = session:getVariable("default_language"); @@ -100,7 +101,7 @@ if ( session:ready() ) then sql = sql .. "and presence_id = '"..extension.."@"..domain_name.."' "; else if (domain_count > 1) then - sql = sql .. "and context = '"..domain_name.."' "; + sql = sql .. "and context = '"..context.."' "; end end if (debug["sql"]) then diff --git a/resources/switch.php b/resources/switch.php index 75032be0ce..6a48a56a1e 100644 --- a/resources/switch.php +++ b/resources/switch.php @@ -160,7 +160,7 @@ foreach($settings_array as $name => $value) { //get the extensions that are assigned to this user if (file_exists($_SERVER['DOCUMENT_ROOT'].PROJECT_PATH."/app/extensions/app_config.php")) { - if (strlen($_SESSION["user_uuid"]) > 0 && count($_SESSION['user']['extension']) == 0) { + if (strlen($_SESSION["domain_uuid"]) > 0 && strlen($_SESSION["user_uuid"]) > 0 && count($_SESSION['user']['extension']) == 0) { //get the user extension list unset($_SESSION['user']['extension']); $sql = "select e.extension, e.user_context, e.extension_uuid, e.outbound_caller_id_name, e.outbound_caller_id_number from v_extensions as e, v_extension_users as u ";