Plum DEV Documentation
voicexml:properties:fetchaudiotimeout

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

voicexml:properties:fetchaudiotimeout [2014/05/22 15:13]
adam [Notes]
voicexml:properties:fetchaudiotimeout [2019/09/17 12:29]
Line 1: Line 1:
- 
-=====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. 
- 
-====Example==== 
-**fetch_timeout.vxml** 
-<​code>​ 
-<?xml version="​1.0"?>​ 
-<vxml version="​2.0">​ 
-  <​property name="​fetchtimeout"​ value="​20s"/>​ 
-  <​form>​ 
-    <​block>​ 
-      <goto next="​fetch_script.php"/>​ 
-    </​block>​ 
-  </​form>​ 
-</​vxml>​ 
-</​code>​ 
-**fetch_script.php** 
-<​code>​ 
-<?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>​ 
-</​code>​ 
-====Explanation==== 
- 
-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. 
- 
-====Notes==== 
- 
-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. 
-