Why doesn't this work?

I am trying to put together a method so my customer can record custom MOH messages. This is what I have now

;User MOH Prompt system
exten => 9500,1,NoOP(Custom Music on Hold Recording)
 same => n,Answer()
 same => n,Playback(/var/lib/asterisk/sounds/en/custom/mohmsg)
 same => n,Record(/var/spool/asterisk/tmp/2ndrecording.wav,3,15)
 same => n,Playback(/var/spool/asterisk/tmp/2ndrecording)
 same => n,NoOP()
 same => n,System(/usr/bin/sox /var/spool/asterisk/tmp/2ndrecording.wav /var/spool/asterisk/tmp/mannon1.wav /var/spool/asterisk/tmp/1stmsg.wav)
 same => n,System(/usr/sbin/rasterisk -x 'module reload res_musiconhold.so')
 same => n,Playback(your-msg-has-been-saved)
 same => n,Playback(goodbye)
 same => n,Hangup()

The 2ndrecording.wav file gets created and put in the correct directory and the mannon1.wav file is in the same directory. But the problem is that the final merged file isn’t created. There are no errors in the log files. I have tried the sox with the -m command with no luck. Where can I look to see what is going on?

Does the Sox command work if you run it by hand from the shell after the call has completed?

It may be a file ownership or permission issue.

Try and print the value of ${SYSTEMSTATUS} variable in your dialplan after first System application to see what it returns.

1 Like

Well it wasn’t a permissions issue per se. Different sampling rates. Sox will change it easily. Thanks guys for the help!