payfrit-works/twilio/docs/TwilioLib/classes/TwiML.html

889 lines
31 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by colddoc on {ts '2011-06-16 08:20:03'} -->
<TITLE>
Callable
</TITLE>
<META NAME="keywords" CONTENT="TwilioLib.classes.concurrent.Callable interface">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="TwiML";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="##EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
CFML Twilio Library 1.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?TwilioLib/classes/TwiML.html" target="_top"><B>FRAMES</B></A> &nbsp;
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
TwilioLib.classes</FONT>
<BR>
Class TwiML</H2>
<PRE>WEB-INF.cftags.component
<IMG SRC="../../resources/inherit.gif" ALT="extended by ">TwilioLib.classes.TwiML
</PRE>
<HR>
<DL>
<DT>
<PRE>public class <B>TwiML</B>
<DT>extends WEB-INF.cftags.component</DT></PRE>
</DT>
</DL>
<P>
Twilio handles instructions for calls and SMS messages in real time from web applications.
<P>
<HR>
<p>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD>
<CODE><B><A HREF="TwiML.html#init()">init</A></B>(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'])</CODE>
<BR>
</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#append()">append</A></B>(string verb='', [string body=''], struct properties='[runtime expression]', [string childOf=''])</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#buildResponse()">buildResponse</A></B>([any responseDoc], [any appendTo], [any Item])</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#conference()">conference</A></B>(string roomName='', [string muted=''], [string beep=''], [string startConferenceOnEnter=''], [string endConferenceOnExit=''], [string waitUrl=''], [string waitMethod=''], [numeric maxParticipants=''], [string childOf=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <Dial> verb's <Conference> noun allows you to connect to a conference room
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#dial()">dial</A></B>([string number=''], string action='', [string method=''], [string timeout=''], [string hangupOnStar='false'], [string timeLimit=''], [string callerId=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Connects the current caller to an another phone
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#gather()">gather</A></B>(string action, [string method=''], [string timeout=''], [string finishOnKey=''], [string numDigits=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Collects digits that a caller enters into his or her telephone keypad
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#getResponse()">getResponse</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;array</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#getResponseData()">getResponseData</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;string</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#getResponseXml()">getResponseXml</A></B>()</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#hangup()">hangup</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Ends a call
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#number()">number</A></B>(string number='', [string sendDigits=''], [string url=''], [string childOf=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <Dial> verb's <Number> noun specifies a phone number to dial
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#pause()">pause</A></B>([numeric length='1'], [string childOf=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits silently for a specific number of seconds
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#play()">play</A></B>(string url, [numeric loop='1'])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Plays an audio file back to the caller
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#record()">record</A></B>(string action='', [string method=''], [string timeout=''], [string finishOnKey=''], [string maxLength=''], [string transcribe=''], [string transcribeCallback=''], [string playBeep=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Records the caller's voice and returns to you the URL of a file containing the audio recording
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#redirect()">redirect</A></B>(string url, [string method=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Transfers control of a call to the TwiML at a different URL
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#reject()">reject</A></B>([string reason=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Rejects an incoming call to your Twilio number without billing you
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#say()">say</A></B>(string body, [string voice=''], [string language=''], [numeric loop='1'], [string childOf=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Say converts text to speech that is read back to the caller
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;any</CODE></FONT></TD>
<TD><CODE><B><A HREF="TwiML.html#sms()">sms</A></B>([string to=''], [string from=''], [string action=''], [string method=''], [string statusCallback=''])</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sends an SMS message to a phone number during a phone call
</TD>
</TR>
</TR>
</TABLE>
&nbsp;
<a name="methods_inherited_from_class_WEB-INF.cftags.component"><!-- --></a>
<table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableSubHeadingColor" bgcolor="#eeeeff">
<th align="left"><b>Methods inherited from class WEB-INF.cftags.component</b></th>
</tr>
<tr class="TableRowColor" bgcolor="white">
<td>
<code></code>
</td>
</tr>
</tbody></table>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<a name="constructor_detail"><!-- --></a>
</p><table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="1" align="left"><font size="+2">
<b>Constructor Detail</b></font></th>
</tr>
</tbody></table>
<a name="init()"><!-- --></a><h3>
init</h3>
<CODE>public <B>init</B>(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'])</CODE>
<dl>
<dd>
<p>
</p>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>accountSid</code></dd>
<dd><code>authToken</code></dd>
<dd><code>ApiVersion</code></dd>
<dd><code>EndPoint</code></dd>
</dl>
</dd></dl>
<!-- ============ METHOD DETAIL ========== -->
<a name="method_detail"><!-- --></a>
<table summary="" border="1" cellpadding="3" cellspacing="0" width="100%">
<tbody><tr class="TableHeadingColor" bgcolor="#ccccff">
<th colspan="1" align="left"><font size="+2">
<b>Method Detail</b></font></th>
</tr>
</tbody></table>
<a name="append()"><!-- --></a><h3>
append</h3>
<code>private any <B>append</B>(string verb='', [string body=''], struct properties='[runtime expression]', [string childOf=''])</code>
<dl>
<dd>
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>verb</code></dd>
<dd><code>body</code></dd>
<dd><code>properties</code></dd>
<dd><code>childOf</code> - </dd>
</dl>
</dd>
</dl>
<hr>
<a name="buildResponse()"><!-- --></a><h3>
buildResponse</h3>
<code>private any <B>buildResponse</B>([any responseDoc], [any appendTo], [any Item])</code>
<dl>
<dd>
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>responseDoc</code></dd>
<dd><code>appendTo</code></dd>
<dd><code>Item</code></dd>
</dl>
</dd>
</dl>
<hr>
<a name="conference()"><!-- --></a><h3>
conference</h3>
<code>public any <B>conference</B>(string roomName='', [string muted=''], [string beep=''], [string startConferenceOnEnter=''], [string endConferenceOnExit=''], [string waitUrl=''], [string waitMethod=''], [numeric maxParticipants=''], [string childOf=''])</code>
<dl>
<dd>
The <Dial> verb's <Conference> noun allows you to connect to a conference room. Much like how the <Number> noun allows you to connect to another phone number, the <Conference> noun allows you to connect to a named conference room and talk with the other callers who have also connected to that room.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>roomName</code> - Name of the conference room to connect to.</dd>
<dd><code>muted</code> - The 'muted' attribute lets you specify whether a participant can speak on the conference. If this attribute is set to 'true', the participant will only be able to listen to people on the conference. This attribute defaults to 'false'.</dd>
<dd><code>beep</code> - The 'beep' attribute lets you specify whether a notification beep is played to the conference when a participant joins or leaves the conference. This defaults to 'true'.</dd>
<dd><code>startConferenceOnEnter</code> - This attribute tells a conference to start when this participant joins the conference, if it is not already started. This is true by default. If this is false and the participant joins a conference that has not started, they are muted and hear background music until a participant joins where startConferenceOnEnter is true. This is useful for implementing moderated conferences.</dd>
<dd><code>endConferenceOnExit</code> - If a participant has this attribute set to 'true', then when that participant leaves, the conference ends and all other participants drop out. This defaults to 'false'. This is useful for implementing moderated conferences that bridge two calls and allow either call leg to continue executing TwiML if the other hangs up.</dd>
<dd><code>waitUrl</code> - The 'waitUrl' attribute lets you specify a URL for music that plays before the conference has started.</dd>
<dd><code>waitMethod</code> - This attribute indicates which HTTP method to use when requesting 'waitUrl'. It defaults to 'POST'. Be sure to use 'GET' if you are directly requesting static audio files such as WAV or MP3 files so that Twilio properly caches the files.</dd>
<dd><code>maxParticipants</code> - This attribute indicates the maximum number of participants you want to allow within a named conference room. The default maximum number of participants is 40. The value must be a positive integer less than or equal to 40.</dd>
<dd><code>childOf</code> - The verb that this verb should be nested within.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="dial()"><!-- --></a><h3>
dial</h3>
<code>public any <B>dial</B>([string number=''], string action='', [string method=''], [string timeout=''], [string hangupOnStar='false'], [string timeLimit=''], [string callerId=''])</code>
<dl>
<dd>
Connects the current caller to an another phone. If the called party picks up, the two parties are connected and can communicate until one hangs up. If the called party does not pick up, if a busy signal is received, or if the number doesn't exist, the dial verb will finish.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>number</code> - The phone number to dial.</dd>
<dd><code>action</code> - The 'action' attribute takes a URL as an argument. When the dialed call ends, Twilio will make a GET or POST request to this URL including the parameters below.</dd>
<dd><code>method</code> - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.</dd>
<dd><code>timeout</code> - The 'timeout' attribute sets the limit in seconds that is waited for the called party to answer the call. Basically, how long should Twilio let the call ring before giving up and reporting 'no-answer' as the 'DialCallStatus'.</dd>
<dd><code>hangupOnStar</code> - The 'hangupOnStar' attribute lets the calling party hang up on the called party by pressing the '*' key on his phone. When two parties are connected using <Dial>, Twilio blocks execution of further verbs until the caller or called party hangs up. This feature allows the calling party to hang up on the called party without having to hang up her phone and ending her TwiML processing session. When the caller presses '*' Twilio will hang up on the called party. If an 'action' URL was provided, Twilio submits 'completed' as the 'DialCallStatus' to the URL and processes the response. If no 'action' was provided Twilio will continue on to the next verb in the current TwiML document.</dd>
<dd><code>timeLimit</code> - The 'timeLimit' attribute sets the maximum duration of the <Dial> in seconds. For example, by setting a time limit of 120 seconds <Dial> will hang up on the called party automatically two minutes into the phone call. By default, there is a four hour time limit set on calls.</dd>
<dd><code>callerId</code> - The 'callerId' attribute lets you specify the caller ID that will appear to the called party when Twilio calls. By default, when you put a <Dial> in your TwiML response to Twilio's inbound call request, the caller ID that the dialed party sees is the inbound caller's caller ID.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="gather()"><!-- --></a><h3>
gather</h3>
<code>public any <B>gather</B>(string action, [string method=''], [string timeout=''], [string finishOnKey=''], [string numDigits=''])</code>
<dl>
<dd>
Collects digits that a caller enters into his or her telephone keypad. When the caller is done entering data, Twilio submits that data to the provided 'action' URL in an HTTP GET or POST request, just like a web browser submits data from an HTML form. If no input is received before timeout, the process moves through to the next verb in the TwiML document.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>action</code> - The 'action' attribute takes an absolute or relative URL as a value. When the caller has finished entering digits Twilio will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, Twilio will by default make a POST request to the current document's URL.</dd>
<dd><code>method</code> - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.</dd>
<dd><code>timeout</code> - The 'timeout' attribute sets the limit in seconds that Twilio will wait for the caller to press another digit before moving on and making a request to the 'action' URL. For example, if 'timeout' is '10', Twilio will wait ten seconds for the caller to press another key before submitting the previously entered digits to the 'action' URL. Twilio waits until completing the execution of all nested verbs before beginning the timeout period.</dd>
<dd><code>finishOnKey</code> - The 'finishOnKey' attribute lets you choose one value that submits the received data when entered.</dd>
<dd><code>numDigits</code> - The 'numDigits' attribute lets you set the number of digits you are expecting, and submits the data to the 'action' URL once the caller enters that number of digits. For example, one might set 'numDigits' to '5' and ask the caller to enter a 5 digit zip code. When the caller enters the fifth digit of '94117', Twilio will immediately submit the data to the 'action' URL.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="getResponse()"><!-- --></a><h3>
getResponse</h3>
<code>public any <B>getResponse</B>()</code>
<dl>
<dd>
<p>
</p></dd>
</dd>
</dl>
<hr>
<a name="getResponseData()"><!-- --></a><h3>
getResponseData</h3>
<code>public array <B>getResponseData</B>()</code>
<dl>
<dd>
<p>
</p></dd>
</dd>
</dl>
<hr>
<a name="getResponseXml()"><!-- --></a><h3>
getResponseXml</h3>
<code>public string <B>getResponseXml</B>()</code>
<dl>
<dd>
<p>
</p></dd>
</dd>
</dl>
<hr>
<a name="hangup()"><!-- --></a><h3>
hangup</h3>
<code>public any <B>hangup</B>()</code>
<dl>
<dd>
Ends a call. If used as the first verb in a TwiML response it does not prevent Twilio from answering the call and billing your account.
<p>
</p></dd>
</dd>
</dl>
<hr>
<a name="number()"><!-- --></a><h3>
number</h3>
<code>public any <B>number</B>(string number='', [string sendDigits=''], [string url=''], [string childOf=''])</code>
<dl>
<dd>
The <Dial> verb's <Number> noun specifies a phone number to dial. Using the noun's attributes you can specify particular behaviors that Twilio should apply when dialing the number.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>number</code> - The phone number to dial.</dd>
<dd><code>sendDigits</code> - The 'sendDigits' attribute tells Twilio to play DTMF tones when the call is answered. This is useful when dialing a phone number and an extension. Twilio will dial the number, and when the automated system picks up, send the DTMF tones to connect to the extension.</dd>
<dd><code>url</code> - The 'url' attribute allows you to specify a url for a TwiML document that will run on the called party's end, after she answers, but before the parties are connected. You can use this TwiML to privatly play or say information to the called party, or provide a chance to decline the phone call using <Gather> and <Hangup>. The current caller will continue to hear ringing while the TwiML document executes on the other end. TwiML documents executed in this manner are not allowed to contain the <Dial> verb.</dd>
<dd><code>childOf</code> - The verb that this verb should be nested within.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="pause()"><!-- --></a><h3>
pause</h3>
<code>public any <B>pause</B>([numeric length='1'], [string childOf=''])</code>
<dl>
<dd>
Waits silently for a specific number of seconds. If first verb in a TwiML document, Twilio will wait the specified number of seconds before picking up the call.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>length</code> - The 'length' attribute specifies how many seconds Twilio will wait silently before continuing on.</dd>
<dd><code>childOf</code> - The verb that this verb should be nested within.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="play()"><!-- --></a><h3>
play</h3>
<code>public any <B>play</B>(string url, [numeric loop='1'])</code>
<dl>
<dd>
Plays an audio file back to the caller. Twilio retrieves the file from a URL that you provide.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>url</code> - The URL of an audio file that Twilio will retrieve and play to the caller.</dd>
<dd><code>loop</code> - Specifies how many times the audio file is played. The default behavior is to play the audio once. Specifying '0' will cause the the audio file to loop until the call is hung up.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="record()"><!-- --></a><h3>
record</h3>
<code>public any <B>record</B>(string action='', [string method=''], [string timeout=''], [string finishOnKey=''], [string maxLength=''], [string transcribe=''], [string transcribeCallback=''], [string playBeep=''])</code>
<dl>
<dd>
Records the caller's voice and returns to you the URL of a file containing the audio recording. You can optionally generate text transcriptions of recorded calls by setting the 'transcribe' attribute of the <Record> verb to 'true'.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>action</code> - The 'action' attribute takes an absolute or relative URL as a value. When recording is finished Twilio will make a GET or POST request to this URL including the parameters below. If no 'action' is provided, <Record> will default to requesting the current document's URL.</dd>
<dd><code>method</code> - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.</dd>
<dd><code>timeout</code> - The 'timeout' attribute tells Twilio to end the recording after a number of seconds of silence has passed. The default is 5 seconds.</dd>
<dd><code>finishOnKey</code> - The 'finishOnKey' attribute lets you choose a set of digits that end the recording when entered.</dd>
<dd><code>maxLength</code> - The 'maxLength' attribute lets you set the maximum length for the recording in seconds. If you set 'maxLength' to '30', the recording will automatically end after 30 seconds of recorded time has elapsed. This defaults to 3600 seconds (one hour) for a normal recording and 120 seconds (two minutes) for a transcribed recording.</dd>
<dd><code>transcribe</code> - The 'transcribe' attribute tells Twilio that you would like a text representation of the audio of the recording. Twilio will pass this recording to our speech-to-text engine and attempt to convert the audio to human readable text. </dd>
<dd><code>transcribeCallback</code> - The 'transcribeCallback' attribute is used in conjunction with the 'transcribe' attribute. It allows you to specify a URL to which Twilio will make an asynchronous POST request when the transcription is complete.</dd>
<dd><code>playBeep</code> - The 'playBeep' attribute allows you to toggle between playing a sound before the start of a recording. If you set the value to 'false', no beep sound will be played.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="redirect()"><!-- --></a><h3>
redirect</h3>
<code>public any <B>redirect</B>(string url, [string method=''])</code>
<dl>
<dd>
Transfers control of a call to the TwiML at a different URL. All verbs after this method are unreachable and ignored.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>url</code> - An absolute or relative URL for a different TwiML document.</dd>
<dd><code>method</code> - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the <Redirect> URL via HTTP GET or POST. 'POST' is the default.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="reject()"><!-- --></a><h3>
reject</h3>
<code>public any <B>reject</B>([string reason=''])</code>
<dl>
<dd>
Rejects an incoming call to your Twilio number without billing you. This is very useful for blocking unwanted calls. If the first verb in a TwiML document is <Reject>, Twilio will not pick up the call. The call ends with a status of 'busy' or 'no-answer', depending on the verb's 'reason' attribute. Any verbs after <Reject> are unreachable and ignored.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>reason</code> - The reason attribute takes the values 'rejected' and 'busy.' This tells Twilio what message to play when rejecting a call. Selecting 'busy' will play a busy signal to the caller, while selecting 'rejected' will play a standard not-in-service response. If this attribute's value isn't set, the default is 'rejected.'</dd>
</dl>
</dd>
</dl>
<hr>
<a name="say()"><!-- --></a><h3>
say</h3>
<code>public any <B>say</B>(string body, [string voice=''], [string language=''], [numeric loop='1'], [string childOf=''])</code>
<dl>
<dd>
Say converts text to speech that is read back to the caller. Say is useful for development or saying dynamic text that is difficult to pre-record.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>body</code> - The text to be converted to speech.</dd>
<dd><code>voice</code> - The 'voice' attribute allows you to choose a male or female voice to read text back. The default value is 'man'. Allowed Values: man, woman</dd>
<dd><code>language</code> - The 'language' attribute allows you pick a voice with a specific language's accent and pronunciations. Twilio currently supports languages 'en' (English), 'es' (Spanish), 'fr' (French), and 'de' (German). The default is 'en'.</dd>
<dd><code>loop</code> - Specifies how many times you'd like the text repeated. The default is once. Specifying '0' will cause the the this text to loop until the call is hung up.</dd>
<dd><code>childOf</code> - The verb that this verb should be nested within.</dd>
</dl>
</dd>
</dl>
<hr>
<a name="sms()"><!-- --></a><h3>
sms</h3>
<code>public any <B>sms</B>([string to=''], [string from=''], [string action=''], [string method=''], [string statusCallback=''])</code>
<dl>
<dd>
Sends an SMS message to a phone number during a phone call.
<p>
</p></dd>
<dl>
<dt><b>Parameters:</b></dt>
<dd><code>to</code> - The 'to' attribute takes a valid phone number as a value. Twilio will send an SMS message to this number. When sending an SMS during an incoming call, 'to' defaults to the caller. When sending an SMS during an outgoing call, 'to' defaults to the called party. The value of 'to' must be a valid phone number. </dd>
<dd><code>from</code> - The 'from' attribute takes a valid phone number as an argument. This number must be a phone number that you've purchased from or ported to Twilio. When sending an SMS during an incoming call, 'from' defaults to the called party. When sending an SMS during an outgoing call, 'from' defaults to the calling party. This number must be an SMS-capable local phone number assigned to your account.</dd>
<dd><code>action</code> - The 'action' attribute takes a URL as an argument. After processing the <Sms> verb, Twilio will make a GET or POST request to this URL with the form parameters 'SmsStatus' and 'SmsSid'. Using an 'action' URL, your application can receive synchronous notification that the message was successfully enqueued.</dd>
<dd><code>method</code> - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the 'action' URL via HTTP GET or POST. This attribute is modeled after the HTML form 'method' attribute. 'POST' is the default value.</dd>
<dd><code>statusCallback</code> - The 'statusCallback' attribute takes a URL as an argument. When the SMS message is actually sent, or if sending fails, Twilio will make an asynchronous POST request to this URL with the parameters 'SmsStatus' and 'SmsSid'. Note, 'statusCallback' always uses HTTP POST to request the given url.</dd>
</dl>
</dd>
</dl>
<hr>
<!-- ========= START OF NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="##EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
CFML Twilio Library 1.0</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?TwilioLib/classes/TwiML.html" target="_top"><B>FRAMES</B></A> &nbsp;
</FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF NAVBAR ========= -->
<HR>
</BODY>
</HTML>