├── .gitignore
├── docs
├── resources
│ └── inherit.gif
├── TwilioLib
│ ├── package-frame.html
│ ├── classes
│ │ ├── package-frame.html
│ │ ├── package-summary.html
│ │ ├── Utils.html
│ │ ├── RESTClient.html
│ │ ├── RESTResponse.html
│ │ ├── RESTRequest.html
│ │ └── TwiML.html
│ ├── package-summary.html
│ └── TwilioLib.html
├── overview-frame.html
├── stylesheet.css
├── allclasses-frame.html
├── index.html
└── overview-summary.html
├── console
├── twiliologo-animated.gif
├── script.js
├── Panel.cfm
├── index.cfm
└── ProcessRequest.cfm
├── TwilioSettings.cfm
├── CHANGELOG.txt
├── settings.xml
├── samples
├── Client.cfm
├── Validation.cfm
├── REST-BadHttpMethod.cfm
├── REST-BadParameter.cfm
├── TwiML-BadInput.cfm
├── REST-Buy-A-Number.cfm
├── REST.cfm
└── TwiML.cfm
├── README.md
├── Application.cfc
├── styles.css
├── LICENSE.txt
├── lib
├── TwilioLib.cfc
└── classes
│ ├── Utils.cfc
│ ├── RESTRequest.cfc
│ ├── RESTResponse.cfc
│ ├── RESTClient.cfc
│ └── Capability.cfc
└── index.cfm
/.gitignore:
--------------------------------------------------------------------------------
1 | colddoc
2 | dist
3 | .DS_Store
--------------------------------------------------------------------------------
/docs/resources/inherit.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonfill/ColdFusion-Twilio-Library/HEAD/docs/resources/inherit.gif
--------------------------------------------------------------------------------
/console/twiliologo-animated.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jasonfill/ColdFusion-Twilio-Library/HEAD/console/twiliologo-animated.gif
--------------------------------------------------------------------------------
/TwilioSettings.cfm:
--------------------------------------------------------------------------------
1 |
|
25 | Classes
26 |
27 |
28 | 29 | TwilioLib 30 | 31 | 32 | |
| 23 | CFML Twilio Library 1.0 | 24 |
|---|
| All Classes
30 |
31 |
32 | Packages
33 | |
46 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /docs/stylesheet.css: -------------------------------------------------------------------------------- 1 | /* Javadoc style sheet */ 2 | 3 | /* Define colors, fonts and other style attributes here to override the defaults */ 4 | 5 | /* Page background color */ 6 | body { background-color: #FFFFFF } 7 | 8 | /* Headings */ 9 | h1 { font-size: 145% } 10 | 11 | /* Table colors */ 12 | .TableHeadingColor { background: #CCCCFF } /* Dark mauve */ 13 | .TableSubHeadingColor { background: #EEEEFF } /* Light mauve */ 14 | .TableRowColor { background: #FFFFFF } /* White */ 15 | 16 | /* Font used in left-hand frame lists */ 17 | .FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif } 18 | .FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } 19 | .FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif } 20 | 21 | /* Navigation bar fonts and colors */ 22 | .NavBarCell1 { background-color:#EEEEFF;} /* Light mauve */ 23 | .NavBarCell1Rev { background-color:#00008B;} /* Dark Blue */ 24 | .NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;} 25 | .NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;} 26 | 27 | .NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 28 | .NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF;} 29 | 30 | -------------------------------------------------------------------------------- /docs/TwilioLib/classes/package-frame.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 ||
25 | Classes
26 |
27 |
28 | 29 | RESTClient 30 | 31 | 32 | RESTRequest 33 | 34 | 35 | RESTResponse 36 | 37 | 38 | TwiML 39 | 40 | 41 | Utils 42 | 43 | 44 | |
|
24 |
25 | RESTClient
26 | 27 | 28 | RESTRequest 29 | 30 | 31 | RESTResponse 32 | 33 | 34 | TwiML 35 | 36 | 37 | TwilioLib 38 | 39 | 40 | Utils 41 | 42 | 43 | 44 | |
45 |
" + data + "
" ); 36 | $tabs.tabs("select", tab_counter); 37 | }); 38 | 39 | } 40 | }); 41 | 42 | $('.add-tab').click(function(e){ 43 | e.preventDefault(); 44 | var tab_title = $(this).attr('rel'); 45 | loadResourceUrl = $(this).attr('href'); 46 | tab_counter++; 47 | $tabs.tabs( "add", "#tabs-" + tab_counter, tab_title ); 48 | }); 49 | 50 | $( "#workspace-tabs span.ui-icon-close" ).live( "click", function() { 51 | var index = $( "li", $tabs ).index( $( this ).parent() ); 52 | $tabs.tabs( "remove", index ); 53 | }); 54 | 55 | $('form').live("submit", function(e){ 56 | e.preventDefault(); 57 | var formId = $(this).attr('id'); 58 | $('#result-' + formId).html('
37 |
38 |
|
53 | 54 | CFML Twilio Library 1.0 55 | 56 | | 57 |||||
| 62 | 63 | FRAMES 64 | 65 | | 66 | 67 ||||||
77 | 78 |
| 81 | Class Summary | 82 ||
|---|---|
| TwilioLib | 88 |89 | Base lib 90 | | 91 |
105 |
106 |
|
121 | 122 | CFML Twilio Library 1.0 123 | 124 | | 125 |||||
| 130 | 131 | FRAMES 132 | 133 | | 134 | 135 ||||||
36 |
37 |
|
52 | 53 | CFML Twilio Library 1.0 54 | 55 | | 56 |||||
| 61 | 62 | FRAMES 63 | 64 | | 65 | 66 ||||||
| 81 | Packages | 82 |
|---|
| TwilioLib | 87 |
| TwilioLib.classes | 91 |
97 |
107 |
108 |
|
123 | 124 | CFML Twilio Library 1.0 125 | 126 | | 127 |||||
| 132 | 133 | FRAMES 134 | 135 | | 136 | 137 ||||||
56 |
61 | 62 |
72 |
75 |
93 |
76 |
79 | Account Sid:
77 |
78 |
80 |
83 | Auth Token:
81 |
82 |
84 |
92 | Default Format:
85 |
86 |
90 |
91 |
Thank you for downloading the CFML library for Twilio. If you have made it to this point you obviously know what Twilio is and have an interest in leveraging the awesome service that they provide. If you need more information on Twilio you can view the following links: 10 |
The CFML library for Twilio was put together with the goal of taking the simple Twilio API and making it even easier for CFML developers to consume.
20 |21 | A few things you will need to do prior to running any of the samples below: 22 |
This project is hosted on RIAForge. 57 |
Copyright (c) 2011 Jason Fill (@jasonfill)
65 |Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66 |The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
67 |THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
68 | 69 | 70 | -------------------------------------------------------------------------------- /docs/TwilioLib/classes/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |
37 |
38 |
|
53 | 54 | CFML Twilio Library 1.0 55 | 56 | | 57 |||||
| 62 | 63 | FRAMES 64 | 65 | | 66 | 67 ||||||
77 | 78 |
| 81 | Class Summary | 82 ||
|---|---|
| RESTClient | 88 |89 | 90 | | 91 |
| RESTRequest | 97 |98 | 99 | | 100 |
| RESTResponse | 106 |107 | 108 | | 109 |
| TwiML | 115 |116 | Twilio handles instructions for calls and SMS messages in real time from web applications. 117 | | 118 |
| Utils | 124 |125 | 126 | | 127 |
141 |
142 |
|
157 | 158 | CFML Twilio Library 1.0 159 | 160 | | 161 |||||
| 166 | 167 | FRAMES 168 | 169 | | 170 | 171 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |TwilioLib.classes.Utils 87 |
public class Utils 98 |
107 | 108 | 109 | 110 | 111 | 112 |
| 115 | Constructor Summary | 116 ||
|---|---|
120 | init(any accountSid, any authToken)
121 | 122 | 123 | |
124 | |
| 134 | Method Summary | 135 ||
|---|---|
140 | private string |
141 | generateSignature(string signKey, string signMessage)
142 | 143 | 144 | |
145 |
149 | private string |
150 | preparePostVars(string qString)
151 | 152 | 153 | |
154 |
158 | boolean |
159 | validateRequest([struct CgiInfo='[runtime expression]'], [struct HttpResponseInfo='[runtime expression]'])
160 | 161 | 162 | 163 | Validates the request is coming from Twilio 164 | |
165 |
| Methods inherited from class WEB-INF.cftags.component | 177 |
|---|
180 |
181 |
182 |
183 | |
184 |
190 | 191 | 192 | 193 | 194 | 195 | 196 |
| 199 | Constructor Detail | 200 |
|---|
public init(any accountSid, any authToken)
207 | 211 |
212 | 213 |accountSidauthToken| 233 | Method Detail | 234 |
|---|
private string generateSignature(string signKey, string signMessage)
240 |
241 | 245 |
signKeysignMessageprivate string preparePostVars(string qString)
265 |
266 | 270 |
qStringpublic boolean validateRequest([struct CgiInfo='[runtime expression]'], [struct HttpResponseInfo='[runtime expression]'])
288 |
289 | 293 |
CgiInfoHttpResponseInfo
317 |
318 |
|
333 | 334 | CFML Twilio Library 1.0 335 | 336 | | 337 |||||
| 342 | 343 | FRAMES 344 | 345 | | 346 | 347 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |twilio.TwilioLib 87 |
public class TwilioLib 98 |
104 | Base lib 105 |
106 | 107 | 108 |
111 | 112 | 113 | 114 | 115 | 116 |
| 119 | Constructor Summary | 120 ||
|---|---|
124 | init(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'], [string DefaultReturnFormat='[runtime expression]'])
125 | 126 | 127 | |
128 | |
| 138 | Method Summary | 139 ||
|---|---|
144 | any |
145 | getUtils()
146 | 147 | 148 | 149 | Creates a new Twilio utility object 150 | |
151 |
155 | any |
156 | newRequest(string Resource, string Method='GET', struct Vars='[runtime expression]')
157 | 158 | 159 | 160 | Creates a new REST request object 161 | |
162 |
166 | any |
167 | newResponse()
168 | 169 | 170 | 171 | Creates a new TwiML response object 172 | |
173 |
| Methods inherited from class WEB-INF.cftags.component | 185 |
|---|
188 |
189 |
190 |
191 | |
192 |
198 | 199 | 200 | 201 | 202 | 203 | 204 |
| 207 | Constructor Detail | 208 |
|---|
public init(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'], [string DefaultReturnFormat='[runtime expression]'])
215 | 219 |
220 | 221 |accountSid - The AccountSid provided by Twilio.authToken - The AuthToken provided by Twilio.ApiVersion - The version of the Twilio API to be used.EndPoint - The Twilio API endpoint.DefaultReturnFormat - The default return format that should be used. This can be overridden in for REST request as well.| 247 | Method Detail | 248 |
|---|
public any getUtils()
254 |
255 | 259 |
public any newRequest(string Resource, string Method='GET', struct Vars='[runtime expression]')
270 |
271 | 275 |
Resource - The resource that is to be consumed.Method - The HTTP method to be used.Vars - Any variables that are to be sent with the request.public any newResponse()
297 |
298 | 302 |
317 |
318 |
|
333 | 334 | CFML Twilio Library 1.0 335 | 336 | | 337 |||||
| 342 | 343 | FRAMES 344 | 345 | | 346 | 347 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |twilio.classes.RESTClient 87 |
public class RESTClient 98 |
107 | 108 | 109 | 110 | 111 | 112 |
| 115 | Constructor Summary | 116 ||
|---|---|
120 | init(any accountSid, any authToken, any ApiVersion, any EndPoint, any DefaultResponse='xml')
121 | 122 | 123 | |
124 | |
| 134 | Method Summary | 135 ||
|---|---|
140 | private struct |
141 | buildUrl(any resource='', any requestObj='')
142 | 143 | 144 | 145 | Builds the full URL for the resource being accessed 146 | |
147 |
151 | any |
152 | sendRequest(string Resource, string Method='GET', struct Vars='[runtime expression]')
153 | 154 | 155 | 156 | Constructs the HTTP request and sends it off to Twilio 157 | |
158 |
162 | private string |
163 | verifyParameterKey(string parameter, any requestObj)
164 | 165 | 166 | 167 | Verifies the parameter key is a valid key for any Twilio REST resource and ensures that the key is in the proper case 168 | |
169 |
| Methods inherited from class WEB-INF.cftags.component | 181 |
|---|
184 |
185 |
186 |
187 | |
188 |
194 | 195 | 196 | 197 | 198 | 199 | 200 |
| 203 | Constructor Detail | 204 |
|---|
public init(any accountSid, any authToken, any ApiVersion, any EndPoint, any DefaultResponse='xml')
211 | 215 |
216 | 217 |accountSidauthTokenApiVersionEndPointDefaultResponse| 243 | Method Detail | 244 |
|---|
private struct buildUrl(any resource='', any requestObj='')
250 |
251 | 255 |
resourcerequestObjpublic any sendRequest(string Resource, string Method='GET', struct Vars='[runtime expression]')
275 |
276 | 280 |
Resource - The resource that is being requested.Method - The HTTP method that is being used to request the resource, valid methods include: GET, POST, PUT, DELETE.Vars - The parameters that are to be sent with the request.private string verifyParameterKey(string parameter, any requestObj)
302 |
303 | 307 |
parameter - The parameter to check.requestObj - An instance of the RESTRequest object which will be used to get the valid parameters.
331 |
332 |
|
347 | 348 | CFML Twilio Library 1.0 349 | 350 | | 351 |||||
| 356 | 357 | FRAMES 358 | 359 | | 360 | 361 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |twilio.classes.RESTResponse 87 |
public class RESTResponse 98 |
107 | 108 | 109 | 110 | 111 | 112 |
| 115 | Constructor Summary | 116 ||
|---|---|
120 | init([any RequestObj], [struct Response])
121 | 122 | 123 | |
124 | |
| 134 | Method Summary | 135 ||
|---|---|
140 | string |
141 | asString()
142 | 143 | 144 | 145 | Return the response as a string 146 | |
147 |
151 | struct |
152 | dump()
153 | 154 | 155 | |
156 |
160 | string |
161 | getContentLength()
162 | 163 | 164 | |
165 |
169 | string |
170 | getContentType()
171 | 172 | 173 | |
174 |
178 | string |
179 | getETag()
180 | 181 | 182 | |
183 |
187 | string |
188 | getLastModified()
189 | 190 | 191 | |
192 |
196 | string |
197 | getStatusCode()
198 | 199 | 200 | |
201 |
205 | string |
206 | getStatusText()
207 | 208 | 209 | |
210 |
214 | any |
215 | output()
216 | 217 | 218 | 219 | Return the response as represented by the CFML engine 220 | |
221 |
225 | struct |
226 | raw()
227 | 228 | 229 | 230 | Returns the complete raw HTTP response 231 | |
232 |
236 | boolean |
237 | wasSuccessful()
238 | 239 | 240 | 241 | Indicate whether the request was successful or not 242 | |
243 |
| Methods inherited from class WEB-INF.cftags.component | 255 |
|---|
258 |
259 |
260 |
261 | |
262 |
268 | 269 | 270 | 271 | 272 | 273 | 274 |
| 277 | Constructor Detail | 278 |
|---|
public init([any RequestObj], [struct Response])
285 | 289 |
290 | 291 |RequestObjResponse| 311 | Method Detail | 312 |
|---|
public string asString()
318 |
319 | 323 |
public struct dump()
334 |
335 | 339 |
public string getContentLength()
350 |
351 | 355 |
public string getContentType()
366 |
367 | 371 |
public string getETag()
382 |
383 | 387 |
public string getLastModified()
398 |
399 | 403 |
public string getStatusCode()
414 |
415 | 419 |
public string getStatusText()
430 |
431 | 435 |
public any output()
446 |
447 | 451 |
public struct raw()
462 |
463 | 467 |
public boolean wasSuccessful()
478 |
479 | 483 |
498 |
499 |
|
514 | 515 | CFML Twilio Library 1.0 516 | 517 | | 518 |||||
| 523 | 524 | FRAMES 525 | 526 | | 527 | 528 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |TwilioLib.classes.RESTRequest 87 |
public class RESTRequest 98 |
107 | 108 | 109 | 110 | 111 | 112 |
| 115 | Constructor Summary | 116 ||
|---|---|
120 | init()
121 | 122 | 123 | |
124 | |
| 134 | Method Summary | 135 ||
|---|---|
140 | struct |
141 | dump()
142 | 143 | 144 | |
145 |
149 | string |
150 | getApiVersion()
151 | 152 | 153 | |
154 |
158 | struct |
159 | getParameters()
160 | 161 | 162 | |
163 |
167 | any |
168 | getResponse()
169 | 170 | 171 | 172 | Returns the response object 173 | |
174 |
178 | string |
179 | getResponseFormat()
180 | 181 | 182 | |
183 |
187 | string |
188 | getUrl()
189 | 190 | 191 | |
192 |
196 | string |
197 | getValidParameterList()
198 | 199 | 200 | 201 | Returns a list of all the valid parameters for all the REST resources 202 | |
203 |
207 | package void |
208 | handleResponse([struct response])
209 | 210 | 211 | 212 | Handles the response that is returned from Twilio 213 | |
214 |
218 | void |
219 | setApiVersion([string ApiVersion])
220 | 221 | 222 | |
223 |
227 | void |
228 | setParameters([string Type], [struct Values])
229 | 230 | 231 | |
232 |
236 | void |
237 | setResponseFormat([string ResponseFormat])
238 | 239 | 240 | |
241 |
245 | void |
246 | setUrl([string Url])
247 | 248 | 249 | |
250 |
| Methods inherited from class WEB-INF.cftags.component | 262 |
|---|
265 |
266 |
267 |
268 | |
269 |
275 | 276 | 277 | 278 | 279 | 280 | 281 |
| 284 | Constructor Detail | 285 |
|---|
public init()
292 | 296 |
297 | 298 | 299 || 309 | Method Detail | 310 |
|---|
public struct dump()
316 |
317 | 321 |
public string getApiVersion()
332 |
333 | 337 |
public struct getParameters()
348 |
349 | 353 |
public any getResponse()
364 |
365 | 369 |
public string getResponseFormat()
380 |
381 | 385 |
public string getUrl()
396 |
397 | 401 |
public string getValidParameterList()
412 |
413 | 417 |
package void handleResponse([struct response])
428 |
429 | 433 |
responsepublic void setApiVersion([string ApiVersion])
451 |
452 | 456 |
ApiVersionpublic void setParameters([string Type], [struct Values])
474 |
475 | 479 |
TypeValuespublic void setResponseFormat([string ResponseFormat])
499 |
500 | 504 |
ResponseFormatpublic void setUrl([string Url])
522 |
523 | 527 |
Url
549 |
550 |
|
565 | 566 | CFML Twilio Library 1.0 567 | 568 | | 569 |||||
| 574 | 575 | FRAMES 576 | 577 | | 578 | 579 ||||||
40 |
41 |
|
56 | 57 | CFML Twilio Library 1.0 58 | 59 | | 60 |||||
| 65 | 66 | FRAMES 67 | 68 | | 69 | 70 ||||||
WEB-INF.cftags.component 86 |88 | 89 | 90 | 91 |TwilioLib.classes.TwiML 87 |
public class TwiML 98 |
104 | Twilio handles instructions for calls and SMS messages in real time from web applications. 105 |
106 | 107 | 108 |
111 | 112 | 113 | 114 | 115 | 116 |
| 119 | Constructor Summary | 120 ||
|---|---|
124 | init(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'])
125 | 126 | 127 | |
128 | |
| 138 | Method Summary | 139 ||
|---|---|
144 | private any |
145 | append(string verb='', [string body=''], struct properties='[runtime expression]', [string childOf=''])
146 | 147 | 148 | |
149 |
153 | private any |
154 | buildResponse([any responseDoc], [any appendTo], [any Item])
155 | 156 | 157 | |
158 |
162 | any |
163 | conference(string roomName='', [string muted=''], [string beep=''], [string startConferenceOnEnter=''], [string endConferenceOnExit=''], [string waitUrl=''], [string waitMethod=''], [numeric maxParticipants=''], [string childOf=''])
164 | 165 | 166 | 167 | The |
169 |
173 | any |
174 | dial([string number=''], string action='', [string method=''], [string timeout=''], [string hangupOnStar='false'], [string timeLimit=''], [string callerId=''])
175 | 176 | 177 | 178 | Connects the current caller to an another phone 179 | |
180 |
184 | any |
185 | gather(string action, [string method=''], [string timeout=''], [string finishOnKey=''], [string numDigits=''])
186 | 187 | 188 | 189 | Collects digits that a caller enters into his or her telephone keypad 190 | |
191 |
195 | any |
196 | getResponse()
197 | 198 | 199 | |
200 |
204 | array |
205 | getResponseData()
206 | 207 | 208 | |
209 |
213 | string |
214 | getResponseXml()
215 | 216 | 217 | |
218 |
222 | any |
223 | hangup()
224 | 225 | 226 | 227 | Ends a call 228 | |
229 |
233 | any |
234 | number(string number='', [string sendDigits=''], [string url=''], [string childOf=''])
235 | 236 | 237 | 238 | The |
240 |
244 | any |
245 | pause([numeric length='1'], [string childOf=''])
246 | 247 | 248 | 249 | Waits silently for a specific number of seconds 250 | |
251 |
255 | any |
256 | play(string url, [numeric loop='1'])
257 | 258 | 259 | 260 | Plays an audio file back to the caller 261 | |
262 |
266 | any |
267 | record(string action='', [string method=''], [string timeout=''], [string finishOnKey=''], [string maxLength=''], [string transcribe=''], [string transcribeCallback=''], [string playBeep=''])
268 | 269 | 270 | 271 | Records the caller's voice and returns to you the URL of a file containing the audio recording 272 | |
273 |
277 | any |
278 | redirect(string url, [string method=''])
279 | 280 | 281 | 282 | Transfers control of a call to the TwiML at a different URL 283 | |
284 |
288 | any |
289 | reject([string reason=''])
290 | 291 | 292 | 293 | Rejects an incoming call to your Twilio number without billing you 294 | |
295 |
299 | any |
300 | say(string body, [string voice=''], [string language=''], [numeric loop='1'], [string childOf=''])
301 | 302 | 303 | 304 | Say converts text to speech that is read back to the caller 305 | |
306 |
310 | any |
311 | sms([string to=''], [string from=''], [string action=''], [string method=''], [string statusCallback=''])
312 | 313 | 314 | 315 | Sends an SMS message to a phone number during a phone call 316 | |
317 |
| Methods inherited from class WEB-INF.cftags.component | 329 |
|---|
332 |
333 |
334 |
335 | |
336 |
342 | 343 | 344 | 345 | 346 | 347 | 348 |
| 351 | Constructor Detail | 352 |
|---|
public init(any accountSid, any authToken, [any ApiVersion='[runtime expression]'], [any EndPoint='[runtime expression]'])
359 | 363 |
364 | 365 |accountSidauthTokenApiVersionEndPoint| 389 | Method Detail | 390 |
|---|
private any append(string verb='', [string body=''], struct properties='[runtime expression]', [string childOf=''])
396 |
397 | 401 |
verbbodypropertieschildOf - private any buildResponse([any responseDoc], [any appendTo], [any Item])
425 |
426 | 430 |
responseDocappendToItempublic any conference(string roomName='', [string muted=''], [string beep=''], [string startConferenceOnEnter=''], [string endConferenceOnExit=''], [string waitUrl=''], [string waitMethod=''], [numeric maxParticipants=''], [string childOf=''])
452 |
453 | 457 |
roomName - Name of the conference room to connect to.muted - 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'.beep - 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'.startConferenceOnEnter - 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.endConferenceOnExit - 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.waitUrl - The 'waitUrl' attribute lets you specify a URL for music that plays before the conference has started.waitMethod - 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.maxParticipants - 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.childOf - The verb that this verb should be nested within.public any dial([string number=''], string action='', [string method=''], [string timeout=''], [string hangupOnStar='false'], [string timeLimit=''], [string callerId=''])
491 |
492 | 496 |
number - The phone number to dial.action - 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.method - 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.timeout - 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'.hangupOnStar - 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 timeLimit - The 'timeLimit' attribute sets the maximum duration of the callerId - 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 public any gather(string action, [string method=''], [string timeout=''], [string finishOnKey=''], [string numDigits=''])
526 |
527 | 531 |
action - 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.method - 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.timeout - 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.finishOnKey - The 'finishOnKey' attribute lets you choose one value that submits the received data when entered.numDigits - 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.public any getResponse()
557 |
558 | 562 |
public array getResponseData()
573 |
574 | 578 |
public string getResponseXml()
589 |
590 | 594 |
public any hangup()
605 |
606 | 610 |
public any number(string number='', [string sendDigits=''], [string url=''], [string childOf=''])
621 |
622 | 626 |
number - The phone number to dial.sendDigits - 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.url - 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 childOf - The verb that this verb should be nested within.public any pause([numeric length='1'], [string childOf=''])
650 |
651 | 655 |
length - The 'length' attribute specifies how many seconds Twilio will wait silently before continuing on.childOf - The verb that this verb should be nested within.public any play(string url, [numeric loop='1'])
675 |
676 | 680 |
url - The URL of an audio file that Twilio will retrieve and play to the caller.loop - 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.public any record(string action='', [string method=''], [string timeout=''], [string finishOnKey=''], [string maxLength=''], [string transcribe=''], [string transcribeCallback=''], [string playBeep=''])
700 |
701 | 705 |
action - 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, method - 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.timeout - The 'timeout' attribute tells Twilio to end the recording after a number of seconds of silence has passed. The default is 5 seconds.finishOnKey - The 'finishOnKey' attribute lets you choose a set of digits that end the recording when entered.maxLength - 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.transcribe - 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. transcribeCallback - 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.playBeep - 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.public any redirect(string url, [string method=''])
737 |
738 | 742 |
url - An absolute or relative URL for a different TwiML document.method - The 'method' attribute takes the value 'GET' or 'POST'. This tells Twilio whether to request the public any reject([string reason=''])
762 |
763 | 767 |
reason - 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.'public any say(string body, [string voice=''], [string language=''], [numeric loop='1'], [string childOf=''])
785 |
786 | 790 |
body - The text to be converted to speech.voice - The 'voice' attribute allows you to choose a male or female voice to read text back. The default value is 'man'. Allowed Values: man, womanlanguage - 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'.loop - 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.childOf - The verb that this verb should be nested within.public any sms([string to=''], [string from=''], [string action=''], [string method=''], [string statusCallback=''])
816 |
817 | 821 |
to - 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. from - 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.action - The 'action' attribute takes a URL as an argument. After processing the method - 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.statusCallback - 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.
851 |
852 |
|
867 | 868 | CFML Twilio Library 1.0 869 | 870 | | 871 |||||
| 876 | 877 | FRAMES 878 | 879 | | 880 | 881 ||||||