David J. wrote:
Stefan,
I would just store them as individual $vars, e.g.
$file[0]="abc.wav"
$file[1]="def.wav"
But how could he make this more dynamic?
Could the DSM use some sort of external script to create the list of $vars?
why external script? the question is, do you want to do that in the
same process? if yes, and you want to lits a directory, then you could
use opendir(3)/readdir(3). if you want to exec an external script, you
could use e.g. popen(3). in fact this could be a useful action, sys.popen.
if no, and its a separate process, you could use e.g. xmlrpc (by using
xmlrpc2di module with DI action) or json-rpc (jsonrpc module, DI
action) or what have you.
(Like he suggested he may use a directory this way the files can be
modified easily.)
Also, would SEMS with lame provide MP3 playback or only WAV?
lame is used for mp3 encoding (e.g. writing to mp3 file to be added to
voicemail).
I know SEMS can use LAME, but is that for saving the audio to MP3; or
play back as well?
for playback (decoding), mpg123 library is used.
Stefan
P.S. please keep sems list in CC
Thx.
On 9/15/10 11:54 AM, Stefan Sayer wrote:
Hi,
Антон Загорский wrote:
Hello!
I'm creating a MOH service via DSM. I want to have playlists, so when
one
file ends, a next file from playlist will play. But it is unclear for
me how
to store array of values (files path) in the DSM?
I would just store them as individual $vars, e.g.
$file[0]="abc.wav"
$file[1]="def.wav"
...
In doc/dsm/tutorials/quizconnect/quizconnect_caller.dsm there's an
example how to loop through such an array.
I'm thinking about mod_py to find all files in a directory and take next
file sequentially, but it isn't sounds good...
How about keeping things simple and adding a small sys.ls action to
mod_sys? This would list the directory and save the files to a set of
string variables.
Stefan
С уважением, Антон Загорский
Программист компании Oyster Telecom
Тел.: +7 812 601-0666
Факс: +7 812 601-0593
[email protected]
www.oyster-telecom.ru
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems
--
Stefan Sayer
VoIP Services Consulting and Development
Warschauer Str. 24
10243 Berlin
tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems