mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Create play_file.lua
This commit is contained in:
10
resources/install/scripts/resources/functions/play_file.lua
Normal file
10
resources/install/scripts/resources/functions/play_file.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
function play_file(dbh, domain_name, domain_uuid, file_name)
|
||||
local full_path, is_base64 = find_file(dbh, domain_name, domain_uuid, file_name)
|
||||
if not full_path then
|
||||
log.warningf('Can not find audio file: %s. Try using it in raw mode.', file_name)
|
||||
full_path = file_name
|
||||
else
|
||||
log.noticef('Found `%s` as `%s`%s', file_name, full_path, is_base64 and '(BASE64)' or '')
|
||||
end
|
||||
session:execute("playback", full_path);
|
||||
end
|
||||
Reference in New Issue
Block a user