Category archives: Snaking

Discussions of programming, particularly of programming Python

RSS feed of Snaking

Funky GSM playback with Asterisk 1.2.1 (Load issues, maybe...)


I upgraded my Asterisk development machine to 1.2.1 a few days ago (from 1.0.something). Since then I've had really poor playback of the GSM sound files (slowed down dramatically, often dropping out) even to SIP phones connected across a local LAN. Connection and link to remote machines produces fine quality, so I'm assuming it's a ...

Continue reading

StarPy Twisted Protocols for Asterisk AMI and Asterisk FastAGI (Release so early it's not even finished yet)


Rather than wait until it's all finished, why not dump the code on the unsuspecting world and let all two or three people who want to use Python with Asterisk play with it. This is still a very early engineering prototype (many of the functions have never been run, let along properly tested), so don't ...

Continue reading

Almost done the FastAGI protocol for Python (Almost as messy as the manager protocol)


I've built a FastAGI protocol for Twisted, just writing code now to test the various methods. Have already discovered that "HANGUP" doesn't seem to work from a FastAGI application (the MTA just stays on the line even after a hangup).

I've got the whole FastAGI API wrapped as a first-crack hack (at least, as much ...

Continue reading

Cleaning up the Asterisk Manager Interface module (And beginning documentation...)


Went over the AMI interface I wrote on Wednesday night. It's not as bad as I'd feared, basically seems functional. Probably want to produce a decent interface for waiting/watching events, but for now I've just added a basic "watch for events of this type" hook. I'm tempted to use pydispatcher for it, but for now ...

Continue reading

AMI protocol for Twisted (Another one...)


Got home rather late from the Toronto Asterisk User's Group meeting, hanging out with Leigh, Simon and Shidan afterward at the restaurant and then the bubble tea place. Unfortunately, got home wired for sound because of all the sugar in the bubble tea (rather too much IMO), so I decided to take a crack at ...

Continue reading

Curiouser and curiouser with Asterisk manager interface (pyst doesn't seem to realise that there are event-generating queries)


Can't sleep, so spending more time with the manager interface. Interestingly, it seems that pyst has a fairly low-level assumption that just doesn't match the manager interface: namely that all events should be dispatched asynchronously to registered handlers. The problem is that certain actions produce a response, then a sequence of events in order that ...

Continue reading

Retrieving information from the Asterisk manager interface (Again, using pyst)


A somewhat shorter task here. Imagine for a moment that you want to be able to list the currently available SIP peers (in a web-site front-end, for instance). The manager interface can run any Asterisk command-line-interface command, but how do you get the results of that command? It's not exactly obvious, but this little recipe ...

Continue reading

Using Asterisk's manager interface to generate calls (From Python using pyst)


This is not a deep and profound project, it's a quick "hello world" example script that allows you to generate a call via Asterisk that connects a SIP URI to a particular extension in your call plan. You could use this as-is to create a phone survey or similar system that connects a user to ...

Continue reading