TITLE OF PAPER: "Scripting Language My Arse": Using Python for Voice over IP URL OF PRESENTATION: _URL_of_powerpoint_presentation_ PRESENTED BY: Anthony Baxter REPRESENTING: _name_of_the_company_they_represent_ CONFERENCE: PyCON 2004 DATE: 20040324 LOCATION: _venue_and_room_in_venue_ -------------------------------------------------------------------------- REAL-TIME NOTES / ANNOTATIONS OF THE PAPER: {If you've contributed, add your name, e-mail & URL at the bottom} Speaker is the release manager for Python 2.3 and 2.4 Shtoom(?) implementation of VOIP in Python. talk may contain a rant and/or a few cheap shots Companies doing VOIP = Vonage VOIP = internet telephony. End users are interested because it's cheap. Anthony wants to take the telephone network away from telcos. Also an enabler for the next generation of telephony applications. Essentially no innovation in telephony applications. VOIP needs a gateway to get to the PSTN (Publicly Switched Telephone Network) VOIP Needs Minimal Infrastructure. You literally just need a network connection and a Microphone. Initial VOIP protocol was H.323. Binary wire protocol and hard to implement. (Badly) Designed by telcos and the ITU. IETF came up with SIP, which is less bad than H.323. UDP based client-server kinda protocol. SIP is just for the control of calls (setup, negotiation, control). Must us RTP protocol for the data. RTP also used by H.323, and can support multiple media formats. SIP does data format negotiation. This is all time sensitive, UDP packets for RTP need to be sent, on average, every 20ms. Other protocols exist They are either closed source or suck. E.g. Skype http://www.skype.com/ Why develop Shtoom: Wanted to have a phone that could be scripted. Existing software phones were not very good. Why choose Python for this: Twisted Framework (High Performance Network Platform) Nice UI Toolkit(s) for Python Some initial doubts about Python: Timing - Can you do things when I need them to be done. Performance - How long it takes to do them. Dealing with timing approach 1: use setitimer approach 2: reset the timer in Python (call myself in 20ms) approach 3: LoopingCall (JP Calderone) - works really well on all platforms Performance: Is it fast enough to process audio packets and do audio mixing. Raw python: mostly worked psyco: some code went faster, some went slower numeric: sped up code a lot (18 channels of audio was the test case), but numeric wins were swamped by cost of creating arrays pyrex: dialect of python that can be translated in to C. audioop: was already done in the python std library. doh. audioop solution was the best. Mix 18 signals in 0.18ms on notebook. Audio encoding: ULAW, GSM 06.10, G.72x, speex wrapping C libraries is easy: Pyrex. Second major release of shtoom (45 minutes ago) lacking on Mac (hisssss) hoping to finish this week UI's include kde/qt, gnome/gtk, cocoa (soon), wx (soon), command-line(!) firewall discovery and traversal STUN protocol for finding out how badly the firewall has hosed you. UPnP Microsoft doesn't release their protocols from shame other apps. echotest.divmod.com doug, the VOIP application server Conclusions: It's not just a scripting language perf okay can do UI python is fun, twisted helps VOIP is cool right now. VOIP in Python is really cool Therefore Python is cool. Paper on the python website. Use the phone and send bugs and patches. Q&A: Q:Can shtoom be a Vonage client? A:probably Q: What are you planning to do with Doug? A: Something something Cisco hardware something TCL code... (help?!) Q: why didn't you ask the Python release manager about audioop. Q: doesn't it get tiresome to have so much attitude all of the time Q: Are you working on this by yourself? A: I'm the primary dev, but others are starting to contribute. Q: if twisted isn't security audited then you can't use shtoom can you? A: if you company has those sorts of rules, maybe not. Q: thoughts on Cisco Skinny support A: probably not. Q: encrypting the calls A: SIP and RTP support this, but some can help do this. -------------------------------------------------------------------------- Quotes: "Dont let the telcos develop for the Internet" "How hard can this be?" about VOIP "The best optimization is the one that someone already wrote" "The reason Microsoft doesn't release their protocols is shame." -------------------------------------------------------------------------- REFERENCES: {as documents / sites are referenced add them below} paper: http://www.python.org/pycon/dc2004/papers/6/paper.txt shtoom: http://www.divmod.org/Home/Projects/Shtoom/ proprietary voip: http://www.skype.com/ pyrex: http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/ STUN: http://www.faqs.org/rfcs/rfc3489.html twisted: http://www.twistedmatrix.com/ Cisco Skinny: http://tinyurl.com/36g32 -------------------------------------------------------------------------- CONTRIBUTORS: {add your name, e-mail address and URL below} Ted Leung, twl@osafoundation.org, http://www.sauria.com/blog John Carnell, john.carnell@netchange.us, http://netchange.us Bob Kuehne, rpk@blue-newt.com, http://www.blue-newt.com Abhay Saxena, ark3@email.com -------------------------------------------------------------------------- E-MAIL BOUNCEBACK: {add your e-mail address separated by commas } rpk@blue-newt.com -------------------------------------------------------------------------- NOTES ON / KEY TO THIS TEMPLATE: A headline (like a field in a database) will be CAPITALISED This differentiates from the text that follows A variable that you can change will be surrounded by _underscores_ Spaces in variables are also replaced with under_scores This allows people to select the whole variable with a simple double-click A tool-tip is lower case and surrounded by {curly brackets / parentheses} These supply helpful contextual information. -------------------------------------------------------------------------- Copyright shared between all the participants unless otherwise stated...