diff options
Diffstat (limited to 'vmail-model.lua')
-rw-r--r-- | vmail-model.lua | 8 |
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 |