Differences

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

Link to this comparison view

developer_guide:voicexml_references:elements:link [2015/10/27 12:58] (current)
borja created
Line 1: Line 1:
 +====== < link > ======
  
 +===== Description =====
 +
 +A < link > element may have one or more grammars. ​ The grammars are in the scope of the element containing this <​link>​ element. ​ When the user input matches one of the linked grammars, it activates the < link > to either throw an event, or transition to another document or dialog.
 +
 +===== Syntax =====
 +
 +<​code>​
 +<link
 +next="​URI"​
 +expr="​ECMAScript_Expression"​
 +event="​event"​
 +dtmf="​DTMF Sequence"​
 +fetchaudio="​URI"​
 +fetchhint="​prefetch"​ | "​safe"​
 +fetchtimeout="​time_interval"​
 +maxage="​time_interval"​
 +maxstale="​time_interval">​
 +child_elements
 +</​link>​
 +</​code>​
 +
 +===== Attributes =====
 +
 +|next|The next attribute is the URI to transition when a match is recognized. ​ This attribute is required. ​ One and only one of the next, expr, event or eventexpr attributes are required.|
 +|expr|The expr attribute is an expression that yields the URI to transition when a match is recognized. ​ This attribute is required. ​ One and only one of the next, expr, event or eventexpr attributes are required.|
 +|event|The event attribute is the event to throw when the user input matches one of the linked grammars. ​ This attribute is required. ​ One and only one of the next, expr, event or eventexpr attributes are required.|
 +|eventexpr|An ECMAScript expression evaluating to the name of the event to throw when the user matches one of the link grammars.One and only one of the next, expr, event or eventexpr attributes are required.|
 +|dtmf|The dtmf attribute indicates the DTMF sequence for this link.  It is equivalent to a simple DTMF <​grammar>​. ​ This attribute can be used concurrently with other grammars, as the link is activated when user input matches a linked grammar or the DTMF sequence. ​ This attribute is optional.|
 +|fetchaudio|The fetchaudio attribute is the URI of audio to play while waiting for the next document to be fetched. ​ This attribute is optional.|
 +|fetchtimeout|The fetchtimeout attribute is the time interval to wait for an audio file to be fetched before playing the alternate content. ​ This attribute is optional.|
 +|fetchhint|The fetchhint attribute defines when the audio file should be retrieved. ​ This attribute is optional. \\ * prefetch – the audio file may be downloaded when the page is loaded. \\ * safe – the audio file loads only when needed.|
 +|maxage|The maxage attribute indicates the maximum time in seconds that this document will use this file before fetching another copy.  This attribute is optional.|
 +|maxstale|The maxstale attribute indicates the maximum time in seconds that this document will use the file that exceeded the maxage time.  This attribute is optional.|
 +
 +===== Parents =====
 +
 +<​code>​
 +<​field>,​ <​form>,​ <​initial>,​ <​vxml>​
 +</​code>​
 +
 +===== Children =====
 +
 +<​code>​
 +<​grammar>​
 +</​code>​
 +
 +===== Extensions =====
 +
 +<​code>​
 +None.
 +</​code>​
 +
 +===== Limitations/​Restrictions =====
 +
 +<​code>​
 +None.
 +</​code>​
 +
 +===== Example Code =====
 +
 +<​code>​
 +<?xml version="​1.0"?>​
 +<vxml version="​2.0"​ xmlns="​http://​www.w3.org/​2001/​vxml">​
 + <​link event="​goodbye"​ dtmf="​1"/>​
 + <​catch event="​goodbye">​
 +  <​prompt>​Thank you for trying this script, goodbye.</​prompt>​
 +  <​exit/>​
 + </​catch>​
 + <​form>​
 +  <field name="​hello"​ type="​digits">​
 +   <​prompt>​Say hello</​prompt>​
 +   <​noinput>​Say something</​noinput>​
 +   <​filled>​
 +    <​prompt>​Hello,​ world!</​prompt>​
 +   </​filled>​
 +  </​field>​
 + </​form>​
 +</​vxml>​
 +</​code>​