Merge multiple files in dialplan [System + sox + dialplan]


I have multiple dynamic files to be played as IVR. In that we want to ask for DTMF input. Below is not working. Will u pls guide us what is wrong here ?

[quote]exten => _X.,n,Playback(file1&file2&file3&file4)
exten => _X.,n,System(/usr/bin/sox -m file1.wav file2.wav file3.wav file4.wav NewFile.wav)
;exten => _X.,n,Playback(NewFile)
exten => _X.,n,Read(RESPONSE,NewFile,1,10)

Thank you.

any help ?

Provided file1,file2,file3,file4 are in Asterisk sounds path and in proper format supported by Asterisk, following should work. Read can take and play mutliple files with &

;exten => _X.,n,Playback(file1&file2&file3&file4)
exten => _X.,n,Read(RESPONSE,file1&file2&file3&file4,1,10)

Satish Barot

The sox command was a mix of the audio (i.e. all three played at the same time), not a consecutive playing of the sounds. That may have been a mistake, of course.

Thank you for your reply.

We are having asterisk - 1.4. In Asterisk 1.4: the “filename” field does not accept concatenation (file1&file2&file…). It does work in 1.8.4 and possibly earlier versions.

Ok, I understand that the sox wont be useful here, So, is there any other way to concatenate multiple files and then play them ?

sox will concatenate, but only if you leave out the -m

Sox concatenate multiple files into new single file.

I tried with and without m option but its not creating any new file. And hence not playing it.

You probably don’t have write permission on the directory. Use another directory and give a full path when playing it back.

I have created new directory and changed it permission too. But still its not creating new file and not playing the file.

[quote]mkdir /home/testing/
chmod -Rf 777 /home/testing/[/quote]

Try using full path for files in Sox and Playback.

–Satish Barot