Check if a soundfile allready exist


I’m working on a routine to record voiceprompts in a organized and menu driven way.

( enter the number you want to start, play the current version, menu with accept listen again rerecord and after accept the routine jumps to the next voiceprompt)

With the routine it is, with a quality telephone, possible to record a voicepromptset with an acceptable soundquality.

What I’m looking for is a way to check if the soundfile allready exist and, if not, trigger the routine to jump to an extension that plays a soundfile with the message that the file hasn’t been recorded yet instead of the soundfile itself. If you know a system call or a agi script please let me know.



-= Info about application ‘System’ =-

Execute a system command

System(command): Executes a command by using system(). If the command
fails, the console should report a fallthrough.
Result of execution is returned in the SYSTEMSTATUS channel variable:
FAILURE Could not execute the specified command
SUCCESS Specified command successfully executed

Old behaviour:
If the command itself executes but is in error, and if there exists
a priority n + 101, where ‘n’ is the priority of the current instance,
then the channel will be setup to continue at that priority level.
Note that this jump functionality has been deprecated and will only occur
if the global priority jumping option is enabled in extensions.conf.

so, if you write script /sbin/
if test -e $1
echo "ok"
error :wink:
and then use
exten =>1,1,System(/sbin/ /tmp/filename.wav)
exten =>1,2,Noop(‘file exist’)
exten =>1,101,Noop(‘file not exist’)