summaryrefslogtreecommitdiffstats
path: root/vmail-model.lua
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2016-07-01 22:04:42 +0000
committerTed Trask <ttrask01@yahoo.com>2016-07-01 22:05:22 +0000
commit729b70d57617193d7b449034491684af5c0799e4 (patch)
treed0b72e9c83c1df8090b05b77676228f03fa8c762 /vmail-model.lua
parent7acf0bc5e9d22ec21a1b8588e505f4263f779ad1 (diff)
downloadacf-freeswitch-vmail-729b70d57617193d7b449034491684af5c0799e4.tar.bz2
acf-freeswitch-vmail-729b70d57617193d7b449034491684af5c0799e4.tar.xz
Fix message playback, support both mp3 and wav audio formats, and modify listmessages HTML view to use HTML5 audio tag
Playback was broken since change from Play link to button Known issue that IE11 audio tag does not support wav format
Diffstat (limited to 'vmail-model.lua')
-rw-r--r--vmail-model.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/vmail-model.lua b/vmail-model.lua
index 37b0c2d..8ebc970 100644
--- a/vmail-model.lua
+++ b/vmail-model.lua
@@ -419,7 +419,7 @@ mymodule.get_config = function()
result.event_socket_ip = cfe({ value=config.event_socket_ip, label="FS Event Socket IP" })
result.event_socket_port = cfe({ value=config.event_socket_port, label="FS Event Socket Port" })
result.event_socket_password = cfe({ value=config.event_socket_password, label="FS Event Socket Password" })
- result.callback_command = cfe({ value=config.callback_command, label="FS API Command for Callback", desc="Use $1 for extension, $2 for wav filename, and $3 for originating user. No other parameters allowed." })
+ result.callback_command = cfe({ value=config.callback_command, label="FS API Command for Callback", desc="Use $1 for extension, $2 for audio filename, and $3 for originating user. No other parameters allowed." })
return cfe({ type="group", value=result, label="Voicemail Config" })
end
@@ -476,6 +476,12 @@ mymodule.download_message = function(self, downloadrequest)
else
file.label = posix.basename(tmp[1].file_path)
file.value = fs.read_file(tmp[1].file_path)
+ file.length = #file.value
+ local option = string.match(file.label, "[^.]*$")
+ if "wav" == option then option = "x-wav"
+ elseif "mp3" == option then option = "mpeg"
+ end
+ file.option = "audio/"..option
-- Mark the message as read
voicemail_read(tmp[1].username, config.domain, downloadrequest.value.message.value)
end