Comment on page
fetchtimeout
Default Value: 30 seconds
The interval to wait for the content to be returned before throwing an error.badfetch event. The value is a Time Designation.
fetch_timeout.vxml
fetch_script.php
<?xml version="1.0"?>
<vxml version="2.0">
<property name="fetchtimeout" value="20s"/>
<form>
<block>
<goto next="fetch_script.php"/>
</block>
</form>
</vxml>
<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\"?>\n";
// sleeping for 25 seconds will hold up the script long enough to exceed the fetch timeout
sleep(25);
?>
<vxml version="2.0">
<form>
<block>
<prompt> You've fetched the other script! </prompt>
</block>
</form>
</vxml>
From this example, “fetchtimeout” is a global property that can be set for all files that are to be fetched. After 20 seconds has passed and the content hasn't been fetched, an error.badfetch event is thrown. In this example, the sleep(25) will hold up the php script long enough to exceed the fetchtimeout of 20 seconds. Note that if you attempt to fetch a script that doesn't exist, an error.badfetch will immediately be thrown, and the fetchtimeout will be ignored.
Note that if you attempt to fetch a script that doesn't exist, an error.badfetch will immediately be thrown, and the fetchtimeout will be ignored.
Last modified 3yr ago