Upload
john-hobbs
View
568
Download
0
Embed Size (px)
Citation preview
A Really Quick Twilio Outline
www.twilio.com
Fast, web based Voice & SMS Applications
Twilio API
Two Parts
Call Flow - TwiML− http://www.twilio.com/docs/api/2010-04-01/twiml/
− Defines what happens during a call
Active Changes / Reporting – REST− http://www.twilio.com/docs/api/2010-04-01/rest/
− Modifies calls, makes calls, etc.
TwiML
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Say>Hello World</Say>
<Play>hello-world.mp3</Play>
<Redirect>/next.xml</Redirect>
</Response>
TwiML
Say any text with TTS system Play audio files, MP3, WAV, OGG, etc. Gather key presses from users Redirect to other TwiML documents Dial other numbers Conference rooms Send SMS to caller Record the user
REST
Many resources, different actions for HTTP verbs Get account info Make phone calls Terminate phone calls Modify conference rooms Access the last X phone numbers to call in
Java Twilio Helper Library
− http://github.com/twilio/twilio-java
− Not well documented yet
− Nothing fancy
TwilioRestClient client = new TwilioRestClient( AccountSid, AuthToken, null );TwilioRestResponse response;Map<String,String> params = new HashMap<String,String>();params.put("From", "402-555-1234");params.put("To", "402-555-4321");params.put("Url", "http://example.com/twiml.xml");response = client.request( "/" + APIVERSION + "/Accounts/" + client.getAccountSid() + "/Calls", "POST", params );
Questions?