telephony and django

19
Hello world? Hello? Hello? Building epic telephony apps with django-twilio.

Upload: randall-degges

Post on 08-May-2015

8.331 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Telephony and django

Hello world? Hello? Hello?

Building epic telephony apps with django-twilio.

Page 2: Telephony and django

Who am I?

• Randall Degges• Lead developer @ BTS communications (we build

cool telephony stuff).• Full stack developer.• Been doing this for 3 years.• Python / Django / Asterisk / VoIP.• [email protected]• http://rdegges.com/• IRC: rdegges @ freenode

Page 3: Telephony and django

So... what the heck is telephony?

Page 4: Telephony and django

Telephony

• Apps that work via voice (IVRs).• Apps that work via SMS (text message).• Apps that help people communicate using their

phones.

• Some examples:o  PagerDuty (http://www.pagerduty.com/)o  Conference Calls (http://bridg.me/)o  Knock Knock (http://knockknock.in/)o  ...

Page 5: Telephony and django

A brief history of telephony.

Page 6: Telephony and django

Telephony--finally usable!

• Until recently, telephony was HARD.o Expensive and Proprietary.o Required hookups (telcos, carriers, special hardware).o Lots of domain knowledge.o Big learning curve.

• twilio is a game changer.o Cheap and Accessible.o Less of a learning curve.o Scalable.o Works over HTTP.

Page 7: Telephony and django

Why twilio?

• Cheap.• Scalable.• Well documented & supported.• I said so!• http://twilio.com/

Page 8: Telephony and django

Let's learn about telephony!

Page 9: Telephony and django

How twilio works (incoming).

• You buy a phone number from twilio.• You give twilio a URL where your application lives

(eg: http://coolguy.com/sup/bro/).• Someone calls or SMS messages your phone

number.• twilio receives your call / SMS, and POSTs to your

URL with lots of data.• Your web application tells twilio what to do next.• Repeat.

Page 10: Telephony and django

How twilio works (outgoing).

• You POST to twilio with some instructions.• twilio does what you want.

Page 11: Telephony and django

django-twilioooooyeeaaaa

Page 12: Telephony and django

django-twilio makes twilio easy.

• It provides lots of utilities for building twilio apps.• Don't write boilerplate code.• Lock down your telephony web applications.• It's actively developed. (github.com/rdegges/django-

twilio)• It's got great support.• It's got great docs. (django-twilio.readthedocs.org)• It's unit tested.• It got sample apps

      (github.com/rdegges/django-twilio-example-apps)• And oh yea, it's easy!

Page 13: Telephony and django

Hello, LA Django!

# urls.pyurlpatterns = patterns('',    # ...    url(r'^$', 'django_twilio.views.say', {'text': 'hi!'}),    # ...)

Try it live: (818) 924-2943! See:

http://django-twilio.readthedocs.org/en/latest/views.html#saying-stuff

Page 14: Telephony and django

Easy, right?

Page 15: Telephony and django

Make a Conference Room# urls.py urlpatterns = patterns('',    # ...    url(r'^$', 'django_twilio.views.conference', {        'name': 'conf1',        'wait_url': 'http://twimlets.com/holdmusic?Bucket=com.twilio.music.rock',        'wait_method': 'GET',    }),    # ...)

Try it live: (818) 924-2942! django-twilio.readthedocs.org/en/latest/views.html#teleconferencing

Page 16: Telephony and django

Custom Stuff# views.pyfrom twilio.twiml import Responsefrom django_twilio.decorators import twilio_view

@twilio_viewdef my_view(request):    r = Response()    r.sms('Party at my place?')    return r

django-twilio.readthedocs.org/en/latest/decorators.html#all-in-one-decorator

Page 17: Telephony and django

State of Development

• Actively developed.• New stuff every day.• Great docs (http://django-twilio.rtfd.org).• Lots of unit tests.• Working on new features and stable release.• Working towards being a full twilio solution.• Project supported by twilio! 

http://www.twilio.com/docs/libraries/

Page 18: Telephony and django

Resources

• My website: http://rdegges.com/• twilio: http://www.twilio.com/• twilio-python: https://github.com/twilio/twilio-python• django-twilio: 

https://github.com/rdegges/django-twilio• example apps from this presentation: 

https://github.com/rdegges/django-twilio-example-apps

Page 19: Telephony and django

Questions?