Phil Hassey - game dev blog
Phil Hassey as Snidely Whiplash
"You can't buy awesomeness.
You're born that way."

Dear lazyweb: tell me about python telephony ..

I’m looking at doing some telephony work in the next half year.  I’ve read a bit about asterisk and it looks like it has come a long way in the past few years.  I notice that there are quite a few ways to integrate it with python AGI, etc.

Anyone care to spout some opinions?  How good is python support?  Is one of these packages way better?  Got any tips on how to get started playing with this stuff as quickly as possible?  Any dire warnings you care to pass on?  Are there any alternatives to asterisk I should also be considering?  Are there any reasons why I would want to use a language other than python for my telephony work?  Tell me everything!

Thanks lazyweb!

10 Responses to “Dear lazyweb: tell me about python telephony ..”

  1. philhassey Says:

    Maybe some tips on good search terms would be helpful as well. I’m fairly new to this field. python telephony has yielded some interesting results though:

    “Snake Found Nailed To Telephone Pole”

  2. Anonymous Says:

    starpy is one sollution. uses twisted, very little documentation

  3. Alex Says:

    What kind of telephony – going to work for a telco, or setting up your own pbx somewhere?

    I haven’t played with asterix myself. ISTR that there are at least two other FOSS projects – a gnu one and some other one (have a look on, that’s where I probably saw it)

    As for search terms, the ones that spring to mind are voip, SIP, H323, MGCP, pbx, DUNDI. YMMV.

  4. philhassey Says:

    I’m setting up a system to do automated event reminder calls. Minimally interactive, the user may press a number to reschedule or something like that, so nothing super complex.

  5. mayowa Says:

    I would suggest you use AGi ( although the the project seems dead i can attest that the code is stable having used it in 2 E1 type projects. For your needs its should be a walk in the park.

  6. Dethe Elza Says:

    There was Shtoom, but I guess that was VOIP, not telephony in the Asterix sense. I’m not sure what its status is:

    There was a good writeup for it (circa PyCon 2004): “Scripting Language” My Arse: Using Python for Voice over IP:

  7. Mike Fletcher Says:

    StarPy is one of my projects, it’s a combination FastAGI/AMI protocol client for Asterisk. It runs as a separate service which allows it to handle initiating and handling multiple calls in the same logic flow. It’s a regular set of Twisted Protocol objects.

    As noted above, it has ridiculously little documentation (and with my blog offline, far less than previously), but it does tend to work reasonably well and is a lot less frustrating to work with than the raw AGI APIs I tried.

    Shtoom was interesting, but it never seemed to gain any traction. Seemed largely to be due to need all sorts of gnarly custom application-level stuff to do anything, meant in practice you had to use lots of custom fixtures from Shtoom to run anything.

    Freeswitch is an interesting Asterisk alternative. I’ve had people ask if I’d port StarPy to it, but I haven’t had the need (no VoIP clients lately).

  8. Jean-Paul Says:

    Hi Phil,

    Sine is another thing to check out. . Light on docs and examples, but very capable, and not dependent on asterisk.

    Feel free to come harass us on #divmod on freenode if you have any questions.

  9. JDFiles Says:

    Freeswitch! 1.0 fresh outta the oven, check out mod_python.

  10. Bart Lebbink Says:

    I had some very pleasant experiences with using python scripting with agi in asterisk. Once I left the horrible asterisk way of jumping around and entered the structured python way of handling program flow, asterisk became attractive for actual development. Via agi we entered python which communicated with a twisted server that was logged on as an msn bot. This way we could do text2speech (msn -> telephone) and speech2wav (telephone -> wav file transfer in msn). This was a few years back, so I can only imagine it has become better and friendlier.

    We also used it program our automatic response mazes to program telephone games. Loads of fun.

    Doing it all directly in sine sounds even more pleasant, but I have no experience in that field.