I sort-of forgot that Asterisk programming could be fun (StarPy reminders...)

Have a (short) contract starting tomorrow to do some StarPy programming. Figured I'd get back in the swing of things by implementing a quick-and-dirty Call-to-Call application.

Basically this is a little AGI + AMI application that you have running on an Asterisk box that registers for a phone number. When a call comes in, the AGI checks the caller ID before picking up. If the caller ID is a registered one, the AGI hangs up the call (refuses to answer) and calls the user back 5 seconds later delivering them to a dial-out context.

What this lets you do is to use your cell phone to access your (cheap) VoIP long distance (or unlimited minutes) with nothing more than a quick call to a phone number (no PIN required). The 5 second delay is somewhat annoying, but without it you too often wind up calling back while the user is still listening to the ringing (or the voicemail recording), having forgotten they were supposed to hang up. (In real life you would not have that voicemail service there, the line would just go dead with a could-not-complete).

The neat thing is that everything "just worked", sat down, coded it in one bash and modulo a NameError or two it worked the first time. Of course, system annoyances made it take a few hours, but the code worked fine. I'm still trying to get the server to accept incoming calls from the media gateways (firewall seems a little too zealous) so that I don't have to restart asterisk every time I want to make a call (to get the UDP port to be opened by the firewall), but otherwise it's working reasonably well for a few dozen lines of code :) .


  1. pyfoo

    pyfoo on 01/10/2007 12:40 p.m. #

    Could we see that script please sir?

Comments are closed.


Pingbacks are closed.