提交 fed7ec8a authored 作者: Chad Phillips's avatar Chad Phillips

force playback_delimiter channel variable to be set when multiple files are…

force playback_delimiter channel variable to be set when multiple files are specified for the play_file action.
上级 917418fb
...@@ -18,8 +18,8 @@ jester.help_map.play.actions.play.params = { ...@@ -18,8 +18,8 @@ jester.help_map.play.actions.play.params = {
1. A full file path 1. A full file path
2. A relative file path from the FreeSWITCH 'sounds' directory 2. A relative file path from the FreeSWITCH 'sounds' directory
3. A phrase prefixed with 'phrase:', eg, 'phrase:invalid_sound'. 3. A phrase prefixed with 'phrase:', eg, 'phrase:invalid_sound'.
To play several files together in a group, pass a table of names instead, eg. 'file = { "foo", "bar", "phrase:goodbye" }'.]], To play several files together in a group, pass a table of names instead, eg. 'file = { "/tmp/foo.wav", "bar.wav", "phrase:goodbye" }'. Internally, Jester uses an ampersand (&) as the default delimiter for playback of mulitple files; to override this, set the 'playback_delimiter' variable in either the global or profile configuration file.]],
repetitions = [[(Optional) How many times to repeat the file(s). Default is 1.]], repetitions = [[(Optional) How many times to repeat the file(s). Default is 1.]],
wait = [[(Optional) How long to wait between repetitions, in milliseconds. Default is no wait.]], wait = [[(Optional) How long to wait between repetitions, in milliseconds. Default is no wait.]],
keys = [[(Optional) See 'help sequences keys'.]], keys = [[(Optional) See 'help sequences keys'.]],
...@@ -74,7 +74,7 @@ jester.help_map.play.actions.play_valid_file.params = { ...@@ -74,7 +74,7 @@ jester.help_map.play.actions.play_valid_file.params = {
1. Full file paths 1. Full file paths
2. Relative file paths from the FreeSWITCH 'sounds' directory 2. Relative file paths from the FreeSWITCH 'sounds' directory
3. A phrase prefixed with 'phrase:', eg, 'phrase:invalid_sound' (note that this will always be considered a valid file) 3. A phrase prefixed with 'phrase:', eg, 'phrase:invalid_sound' (note that this will always be considered a valid file)
List the files in the order you would prefer them to be searched, eg. 'file = { "mycustomgreeting", "phrase:invalid_entry" }'.]], List the files in the order you would prefer them to be searched, eg. 'file = { "mycustomgreeting", "phrase:invalid_entry" }'.]],
repetitions = [[(Optional) How many times to repeat the file(s). Default is 1.]], repetitions = [[(Optional) How many times to repeat the file(s). Default is 1.]],
wait = [[(Optional) How long to wait between repetitions, in milliseconds. Default is no wait.]], wait = [[(Optional) How long to wait between repetitions, in milliseconds. Default is no wait.]],
......
...@@ -24,7 +24,11 @@ function play_file(action) ...@@ -24,7 +24,11 @@ function play_file(action)
if action.file then if action.file then
-- A list of files was passed, join them in order. -- A list of files was passed, join them in order.
if type(action.file) == "table" then if type(action.file) == "table" then
action.file = table.concat(action.file, "&") local delimiter = jester.conf.playback_delimiter or "&"
-- Ensure this channel variable is properly set, or playback of multiple
-- files will not work.
jester.set_variable("playback_delimiter", delimiter)
action.file = table.concat(action.file, delimiter)
end end
local rep = reps(action) local rep = reps(action)
for i = 1, rep do for i = 1, rep do
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论