The DeleteFile command is used for deleting your source file what you do not
need anymore from a specified directory. Important to mention that you only
can delete from stated directories like the directory at that location where
you installed the Ozeki Phone System XE, the Voicemails directory which
contains the old, new and the attachment directories of an extension and the
directory of the uploaded files.
This speaks the 2 sentences between the <InitialCommands></InitialCommands> nodes repeatedly with a 5 second delay and scans the pressed numbers at the same time.
By pressing 1 the system will go through your old voicemails array with the ForEach loop and it will play them. If you press 1 again, you can delete the current message with the <DeleteFile></DeleteFile> command.
<?xml version="1.0"?>
<Response>
<UserInput repeat ='true'digits ='1'>
<InitialCommands>
<Speak>This is the voicemail of user $username .</Speak>
<Speak>To listen to your old messages, press 1.</Speak>
<Delay>5</Delay>
</InitialCommands>
<Inputs>
<Input key ='1'>
<ForEach source ='oldvoicemails'>
<Speak>This voicemail has been recorded at $item.date from $item.from .</Speak>
<Play>$item.message</Play>
<UserInput digits ='1' timeout ='3'>
<InitialCommands>
<Speak>To delete this message, press 1.</Speak>
</InitialCommands>
<Inputs>
<Input key ='1'>
<DeleteFile>$item.message</DeleteFile>
</Input>
</Inputs>
</UserInput>
</ForEach>
<Speak>End of old messages.</Speak>
</Input>
</Inputs>
</UserInput>
</Response>