Update index.lua (#2473)

Bug fix in per user vm transcription. If domain had transcription enabled but the user did not, then the sql insert of the msg would fail.
This commit is contained in:
konradSC
2017-04-04 21:24:13 -06:00
committed by FusionPBX
parent 5d463f1cd9
commit 0852dee581
@@ -423,7 +423,7 @@
if (storage_type == "base64") then if (storage_type == "base64") then
table.insert(sql, "message_base64, "); table.insert(sql, "message_base64, ");
end end
if (transcribe_enabled == "true") then if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then
table.insert(sql, "message_transcription, "); table.insert(sql, "message_transcription, ");
end end
table.insert(sql, "message_length "); table.insert(sql, "message_length ");
@@ -441,7 +441,7 @@
if (storage_type == "base64") then if (storage_type == "base64") then
table.insert(sql, ":message_base64, "); table.insert(sql, ":message_base64, ");
end end
if (transcribe_enabled == "true") then if (transcribe_enabled == "true") and (voicemail_transcription_enabled == "true") then
table.insert(sql, ":transcription, "); table.insert(sql, ":transcription, ");
end end
table.insert(sql, ":message_length "); table.insert(sql, ":message_length ");