mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-03 10:23:50 +00:00
Replace the variable with the path to the sounds directory.
This commit is contained in:
@@ -13,21 +13,6 @@
|
||||
table.insert(xml, [[ <section name="configuration">]]);
|
||||
table.insert(xml, [[ <configuration name="local_stream.conf" description="stream files from local dir">]]);
|
||||
|
||||
--table.insert(xml, [[ <!-- fallback to default if requested moh class isn't found -->]]);
|
||||
--table.insert(xml, [[ <directory name="default" path="]]..sounds_dir..[[/music/default/8000">]]);
|
||||
--table.insert(xml, [[ <param name="rate" value="8000"/>]]);
|
||||
--table.insert(xml, [[ <param name="shuffle" value="true"/>]]);
|
||||
--table.insert(xml, [[ <param name="channels" value="1"/>]]);
|
||||
--table.insert(xml, [[ <param name="interval" value="20"/>]]);
|
||||
--table.insert(xml, [[ <param name="timer-name" value="soft"/>]]);
|
||||
--table.insert(xml, [[ <!-- list of short files to break in with every so often -->]]);
|
||||
--table.insert(xml, [[ <!--<param name="chime-list" value="file1.wav,file2.wav"/>-->]]);
|
||||
--table.insert(xml, [[ <!-- frequency of break-in (seconds)-->]]);
|
||||
--table.insert(xml, [[ <!--<param name="chime-freq" value="30"/>-->]]);
|
||||
--table.insert(xml, [[ <!-- limit to how many seconds the file will play -->]]);
|
||||
--table.insert(xml, [[ <!--<param name="chime-max" value="500"/>-->]]);
|
||||
--table.insert(xml, [[ </directory>]]);
|
||||
|
||||
--run the query
|
||||
sql = "select * from v_music_on_hold ";
|
||||
sql = sql .. "order by music_on_hold_name asc ";
|
||||
@@ -37,8 +22,11 @@
|
||||
x = 0;
|
||||
dbh:query(sql, function(row)
|
||||
|
||||
--replace the variable with the path to the sounds directory
|
||||
music_on_hold_path = row.music_on_hold_path:gsub("$${sounds_dir}", sound_dir);
|
||||
|
||||
--build the xml ]]..row.music_on_hold_name..[["
|
||||
table.insert(xml, [[ <directory name="]]..row.music_on_hold_name..[[" path="]]..row.music_on_hold_path..[[">]]);
|
||||
table.insert(xml, [[ <directory name="]]..row.music_on_hold_name..[[" path="]]..music_on_hold_path..[[">]]);
|
||||
table.insert(xml, [[ <param name="rate" value="]]..row.music_on_hold_rate..[["/>]]);
|
||||
table.insert(xml, [[ <param name="shuffle" value="]]..row.music_on_hold_shuffle..[["/>]]);
|
||||
table.insert(xml, [[ <param name="channels" value="1"/>]]);
|
||||
|
||||
Reference in New Issue
Block a user