We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

How can I catch 404 error?

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
w2gi
Posts: 46
Joined: Fri Jun 26, 2009 1:35 pm

How can I catch 404 error?

Post by w2gi »

Hi,
I want to catch 404 error thrown in log.

Code: Select all

Cache Miss: http://ivr.somesite.com/prompts/725.wav
Attempting to fetch http://ivr.somesite.com/prompts/725.wav
HTTP/1.1 404 Not Found - http://ivr.somesite.com/prompts/725.wav
Audio segment from the URL http://ivr.somesite.com/prompts/725.wav added to prompt queue
Unrecognized format in pvxPromptConvertCopySource
Failure during pvxPromptConvertCopySource
I tried this, but it doesn't work:

Code: Select all

<catch event="error.badfetch.http.404">
   FOO      
</catch>
Any other methods?


- Saif

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

workaround for your IVR code

Post by support »

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

Post Reply