Astricon Oct 14, 2009
Reinventing theDialplan
Copyright 2009 Twilio
Asterisk
Voice Applications
IVR
Company P
BX
Cli
ck-t
o-C
all
Con
fere
ncin
g
The Cloud
Voice Applications
IVR
Company P
BX
Cli
ck-t
o-C
all
Con
fere
ncin
g
Asterisk
Voice Applications
Voice Guru
Asterisk
DialplanApplication
Native scripting languagewritten by your Voice Guru
Maintained by your Voice Guru
Asterisk DialplanLanguage: Native Scripting Where: Local on call router
Asterisk AGI/AMI
Java/C/Ruby...Application
IP
Asterisk AGI/AMILanguage: AGI/AMI API +
Java/C/Ruby/Python/EtcWhere: Remote via IP
Asterisk AGI/AMI
Java/C/Ruby...Application
IPMaintained by your Voice Guru
Asterisk AGI/AMILanguage: AGI/AMI API +
Java/C/Ruby/Python/EtcWhere: Remote via IP
Asterisk AGI/AMI
Java/C/Ruby...Application
IPMaintained by your Programmer
Asterisk AGI/AMILanguage: AGI/AMI API +
Java/C/Ruby/Python/EtcWhere: Remote via IP
Enter the Programmer
Programmer
•Commodity skillset
•Easy to hire
•Cheap
Asterisk AGI/AMI
Java/C/Ruby...Application
IPBetter but...
Large API with "lite" documentation. The distinction between AGI/AMI can
be confusing.
Tight integration between call router and voice app: direct socket
connections
SCALING=HARD
Asterisk AGI/AMILanguage: AGI/AMI API +
Java/C/Ruby/Python/EtcWhere: Remote via IP
Asterisk AGI/AMIIP
Lets mull this over...
Asterisk AGI/AMIIP
Why do I need aVoice Guru?
AGI/AMIIP
What if I outsourcedmy voice guru?
Asterisk
Expert
Asterisk in the Cloud
AGI/AMIIP
Asterisk in the Cloud
?????IP
What is the ideal voice app API?
Web developers are (one of) the largest engineering workforces
on the planet
•HTTP
•Request/Response
•XML/JSON
•WAV/MP3
Asterisk in the Cloud
RubyMagic
Java
PHP
Python
Create new messaging protocoland new API for each language?
...
Asterisk in the Cloud
HTTP/XMLREST
Normal Web ServerHTTP/XML/REST
Ruby
Java
PHP
Python...
HTTP/XMLREST
Normal Web ServerHTTP/XML/REST
Ruby
Java
PHP
Python...Twilio
HTTP/XMLREST
Twilio
Leverage existing cloud hostingScale: 1-10,000’s of simultaneous calls
Google App Engine
Microsoft Azure
Heroku
Request/Response
digits = GetKeypadPresses();switch(digits) { case 1: blah(); break;}
1 Procedural programming
1 Procedural programming
Not how HTML works!
digits = GetKeypadPresses();switch(digits) { case 1: blah(); break;}
Request/Response
<form action=”digits.php”> <input type=”text” name=”digits” /> <input type="submit" value="Go"/></form>
2 Web programming
Request/Response
<form action=”digits.php”> <input type=”text” name=”digits” /> <input type="submit" value="Go"/></form>
2 Web programming
Request/Response
Submit back to digits.phpon input
<Gather numDigits=”5” action=”digits.php”/>
3 Web-like voice programming
Apply the same model forvoice applications
Request/Response
<Gather numDigits=”5” action=”digits.php”/>
3 Web-like voice programming
Request/Response
Submit back to digits.phpon input
$r = new Response();$r->append(new Say("Hello World");$r->Respond();
4 Language-specific libraries
PHP
r = twilio.Response()r.append(twilio.Say("Hello World"))print r
Python
@r = Twilio::[email protected](Twilio::Say.new "Hello World")puts @r.respond
Ruby
TwiMLResponse response = new TwiMLResponse();Say say = new Say("Hello World");System.out.println(response.toXML());
Java
Request/Response
u.com b.com c.com
⤸HTTP 307 ⤸HTTP 307
Response Chaining
⤸
PBX Application Authorization Service
CRM Integration
⤸
Stateless ‘Twimlet’ URLs + REST
Stateless ‘Twimlet’ URLs + REST
curl -fSs -u "$ACCOUNTSID:$AUTHTOKEN" -d "Caller=$CALLERID" -d "Called=$PHONE" -d "Url=http://twimlets.com/message?Message=$MSG" "https://api.twilio.com/2008-08-01/Accounts/$ACCOUNTSID/Calls
1 Put the Voice Guru in the CloudAsterisk in the cloud
2 Adopt a standards-based web APIHTTP/XML/REST
3 Leverage existing web infrastructureApache/Tomcat/AWS/AppEngine/Azure/Heroku
4 Let the cloud handling scaling1-10,000’s simultaneous calls
5 Don’t break request/response modelBuild libraries for PHP/Python/Java/C#/Ruby etc.
The Cloud
Voice Applications
IVR
Company P
BX
Cli
ck-t
o-C
all
Con
fere
ncin
g
Asterisk
Simplifying TelecomSimple • Powerful • Pay-As-You-Go
Evan CookeCo-Founder & CTO
twitter: @[email protected]
http://www.twilio.com