Asterisk - All things "phone" for the Linux geek!

Izeni Hosted Communications Platform (IHCP)

Before we get into Asterisk... If you're interested in VoIP, you may want to check out a new company that I've started, Izeni.

Asterisk has been called the Swiss Army Knife of Telephony. Here, I seek to sharpen a few of those blades and add one of my own.

Asterisk and AGI make it happen

One of the things that makes Asterisk so flexible is AGI. AGI stands for the Asterisk Gateway Interface. Basically, it allows you to interface the phone server with any program or programming language that will read STDIN (standard input) and write to STDOUT (standard out). This opens the phone system to virtually unlimited hack-ability.

While almost any language can be used with Asterisk and AGI, all can be tedious without some code to do the basics for you. Code has been available to work with Java, Perl, Python, PHP, and C but not for my favorite language and environment, C# and Mono. Well, one weekend of coding, and I think I have a pretty good start at a library that will ease the use of C# and Asterisk.

Asterisk + Mono = MONO-TONE

Oct 15 2005 -- MONO-TONE 0.02 - FastAGI support added.

June 06 2005 -- MONO-TONE 0.01 - Inital release.

Find the current code (MONO-TONE 0.02) here...
MONO-TONE 0.02 source code
MONO-TONE 0.02 HTML preview

Find the old code (MONO-TONE 0.01) here...
MONO-TONE 0.01 source code
MONO-TONE 0.01 HTML preview

There is also a little class available that shows you how to use it...
Sample Driver source code
Sample Driver HTML preview

The example class provided will not work on your system. It is provided as an example to show you how you would use MONO-TONE to integrate Asterisk with existing code. In this case, we have a time clock object that we use to check if someone is "punched in" or not.
In the future, I will provide a more generic example that you will be able to run upon downloading. I will also add an example of how to use FastAGI.

Yet another AGI reference page

I have also created a list of the commands that Asterisk will take using AGI. I did this because I wanted to have a place where I could reference the commands in alphabetical order. I may *not* have ever compiled this reference if I had known about running "dump agihtml" :)

Q & A

I though C# was for Microsoft OSes only. Is this true?
No. The Mono Project makes it so you can run your C# code on MANY platforms. I don't use Windows at all. This code was written and tested on Linux.
Is MONO-TONE stable? Can I use it now?
Most of it is pretty stable. It is a very simple design. What works is likely to work 100% of the time and what is broken will be blazingly obvious. The truth is, that this point, it has not been tested very well; I wrote it by the docs. I have found that the docs for Asterisk's AGI vary from source to source. Also, see the TODOs!
What more are you going to do with it?
Lots. I'm going to fix this first chunk of code up and then add additional methods that will make using it easier. Right now most methods are mostly "1 to 1" with the underlying server and don't offer much more then a convenient way to call them. Support for FastAGI (running code on a remote box) has been contributed and the ManagerAPI work is underway.
Yeah, but isn't Mono slow?
No. Not at all. It compiles to native code specific to the platform it is running on. There are no VMs running underneath. You will notice a slight delay the very first time you run code from Asterisk but after that it should be instantaneous.
O.K. Why C# and Mono when we have all of these other choices?
Those other choices are good and you should use them when they make sense. In my case we have a whole business layer written in C# that we can easily use from our phone system using MONO-TONE.
Why do you keep calling it MONO-TONE. How about we layoff the CAPS?
Well, I'd like to. The name, of course, comes from combining the Mono Project and a touch-tone phone. I later found out that there is an Open Source project called "monotone" and made the change to distinguish between the two. Plus, the all CAPS are kinda like the commands that you send Asterisk while using AGI. Lame, I know.
Can I help?
You sure can! Email me if you would like to help make this better or have a patch to offer. gabe(a)gundy.org
Why does this web page render poorly on my browser?
I really don't know. I only have Firefox to test on. I did my best to make sure it was standards compliant.

Book Review - Asterisk: The Future of Telephony

And lastly, if I can get this review done, I'll submit it to slashdot. It's a good book and you all should pick up a copy!

Also, visit my blog.

Valid CSS! Valid XHTML 1.0!