diff --git a/resources/install/scripts/app/provision/index.lua b/resources/install/scripts/app/provision/index.lua index ee322c3321..f0b910f3b7 100644 --- a/resources/install/scripts/app/provision/index.lua +++ b/resources/install/scripts/app/provision/index.lua @@ -54,10 +54,10 @@ dbh = database_handle('system'); --answer - --session:answer(); + session:answer(); --sleep - --session:sleep(500); + session:sleep(500); --get the domain_uuid domain_uuid = session:getVariable("domain_uuid"); @@ -160,7 +160,7 @@ event:addHeader('host', row.server_address); event:addHeader('content-type', 'application/simple-message-summary'); --check sync - event:addHeader('event-string', 'check-sync;reboot=true'); + event:addHeader('event-string', 'check-sync;reboot=false'); --send the event event:fire(); end); @@ -169,14 +169,16 @@ --add the override to the device uuid (login) if (authorized == 'true' and action == "login") then if (device_uuid_alternate ~= nil) then + --send a hangup + session:hangup(); --add the new alternate - sql = [[UPDATE v_devices SET device_uuid_alternate = ']]..device_uuid_alternate..[[']]; - sql = sql .. [[WHERE device_uuid = ']]..device_uuid..[[' ]]; - sql = sql .. [[AND domain_uuid = ']]..domain_uuid..[[' ]]; - if (debug["sql"]) then - freeswitch.consoleLog("NOTICE", "[provision] sql: ".. sql .. "\n"); - end - dbh:query(sql); + sql = [[UPDATE v_devices SET device_uuid_alternate = ']]..device_uuid_alternate..[[']]; + sql = sql .. [[WHERE device_uuid = ']]..device_uuid..[[' ]]; + sql = sql .. [[AND domain_uuid = ']]..domain_uuid..[[' ]]; + if (debug["sql"]) then + freeswitch.consoleLog("NOTICE", "[provision] sql: ".. sql .. "\n"); + end + dbh:query(sql); end end @@ -195,6 +197,8 @@ --found the device send a sync command if (authorized == 'true') then + --send a hangup + session:hangup(); --create the event notify object local event = freeswitch.Event('NOTIFY'); --add the headers @@ -203,7 +207,7 @@ event:addHeader('host', domain); event:addHeader('content-type', 'application/simple-message-summary'); --check sync - event:addHeader('event-string', 'check-sync;reboot=true'); + event:addHeader('event-string', 'check-sync;reboot=false'); --send the event event:fire(); end \ No newline at end of file