# fetchtimeout

### fetchtimeout <a href="#fetchtimeout" id="fetchtimeout"></a>

**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

{% tabs %}
{% tab title="fetch\_timeout.vxml" %}

```php
<?xml version="1.0"?>
<vxml version="2.0">
  <property name="fetchtimeout" value="20s"/>
  <form>
    <block>
      <goto next="fetch_script.php"/>
    </block>
  </form>
</vxml>
```

{% endtab %}

{% tab title="fetch\_script.php" %}

```php
<?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>
```

{% endtab %}
{% endtabs %}

### 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.plumvoice.com/dev/voicexml/properties/fetchtimeout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
