1local log = log or require "resources.functions.log"[app_name or 'play_file'] 2local find_file = require "resources.functions.find_file" 3 4function play_file(dbh, domain_name, domain_uuid, file_name) 5 local full_path, is_base64 = find_file(dbh, domain_name, domain_uuid, file_name) 6 if not full_path then 7 log.warningf('Can not find audio file: %s. Try using it in raw mode.', file_name) 8 full_path = file_name 9 else 10 log.noticef('Found `%s` as `%s`%s', file_name, full_path, is_base64 and '(BASE64)' or '') 11 end 12 session:execute("playback", full_path); 13end 14 15return play_file