Hi,
You wouldn't be able to catch this 404 error in this implementation of your IVR code as there is no error that is thrown when the audio file can't be fetched. However, as a possible workaround to catch if the audio file was fetched or not, you could do:
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
?>
<vxml version="2.0">
<var name="trackfetch" expr="1"/>
<form>
<block>
<prompt>
I'm going to play an audio file.
</prompt>
<audio src="http://www.ourappserver.com/test.wav">
<value expr="trackfetch++"/>
</audio>
<prompt>
The trackfetch counter is <value expr="trackfetch"/>.
</prompt>
</block>
</form>
</vxml>
From this IVR code example, we use the variable, trackfetch, to keep track of whether our audio file was fetched or not. If the audio file was not fetched, the IVR application will go to the
<value> tag, which gets incremented by 1. If the audio file was fetched, the IVR application will just play the audio file and not go to the
<value> tag. From this IVR code implementation, you could then go into your logs and track where your variable got incremented, which will also tell you which audio files did not get played.
Regards,
Plum Support