Post on 14-Jan-2015
description
Building & DebuggingTools that Communicate
Tim MillironDirector of Engineering twilio @timmilliron
twilio: an API for Phones
Outgoing
using Twilio;var twilio = new TwilioRestClient("accountSid", "authToken");
var call = twilio.InitiateOutboundCall("+1555456790", "+15551112222", "http://example.com/handleCall");var msg = twilio.SendSmsMessage("+15551112222", "+15553334444", "Hi BizSpark!");
Incoming
<Response> <Say>Welcome to the biz-spark meetup. Huzzah!</Say> <Sms>Thanks for calling the biz-spark meetup line.</Sms></Response>
Call: (415) 723-4BIZ
Incoming
<Response> <Say>Welcome to the biz-spark meetup. Huzzah!</Say> <Sms>Thanks for calling the biz-spark meetup line.</Sms></Response>
Call: (415) 723-4BIZ
twiml
How it works
How it works
<Response> ... </Response>
Debugging the Phone Grid
“We’re sorry, an application error
occurred.”
It’s just the internet
When in doubt, curl
curl http://demo.twilio.com/tim/bizsparkVoice.xml
When in doubt, curl
curl http://demo.twilio.com/tim/bizsparkVoice.xml
curl –u AC123:abcd -d “From:+14155551111” -d “To:+14158675309” -d “Body:Hi, Jenny” https://api.twilio.com/2010-04-01/Accounts/AC123/Calls
Debugging Tools
Debugging Tools
Debugging Tools
Debugging Tools
Eavesdropping on Yourself
var call = twilio.InitiateOutboundCall(”+14157234249”,”+14158675309”,"http://
example.com/eavesdrop.xml");
Calling our twilio number
(415) 723-4BIZ<Response>
<Say>…</Say></Response>
Eavesdropping on Yourself
var call = twilio.InitiateOutboundCall(”+14157234249”,”+14158675309”,"http://
example.com/eavesdrop.xml");
Calling our twilio number
eavesdrop.xml
(415) 723-4BIZ<Response>
<Say>…</Say></Response>
<Response> <Dial record=“true”>+14157234249</Dial></Response>
Entering Data at Yourself
(415) 723-4BIZ
var call = twilio.InitiateOutboundCall(”+14157234249”,”+14158675309”,"http://
example.com/senddata.xml");
Calling our twilio number
<Response><Gather
numDigits=4>…</Gather></Response>
Entering Data at Yourself
(415) 723-4BIZ
<Response> <Dial sendDigits=“1234”>+14157234249</Dial></Response>
var call = twilio.InitiateOutboundCall(”+14157234249”,”+14158675309”,"http://
example.com/senddata.xml");
Calling our twilio number
senddata.xml
<Response><Gather
numDigits=4>…</Gather></Response>
twilio: an API for Phones
Questions?