Recently I published on codeplex (now using GIT) a new project I’ve been working on. A set of helpers and extension methods for Asterisk’s AsterNET framework.
The idea came simply from how often I had to write Exec(“…”, “…”) and go look up all the options from voip-info.org! A common problem for me, and I assume for other using the FastAGI framework.
Currently, if I want to call ‘Dial’ I need to do something like this.
Now, that looks pretty simple I hear you say! But what about all the options that can be added into the Dial options string. Timeouts, ringing, transfer ability etc, etc, etc…
You end up writing something like this:
God forbid, you want to do something like Transfer on Caller Hangup (not pretty)! And then there’s the result codes, and the fact if you want to know the status of your Dial, you need to get the ‘DIALSTATUS’ variable in a separate command.
Now there’s a better way however, using the AsterNET.Extensions helpers.
Say we want to dial an extension, pass in some options and get back the status of the dial. Now we can simply do:
var dialResult = this.Dial("SIP/10002_1", 10000, null, DialOptions.AnnounceToCallee("demo-congrats"));
The return result (dialResult) contains the value from the variable ‘DIALSTATUS’. This makes dealing with Dial a lot easier and now we have intellisense for each of the different options.
I’ve created helpers for some of the more common Exec’s I use day to day, although not all complete yet. I’ve also created some extension methods (like the Dial one above) that use the Helper and extend the helper to include return codes etc.
I am really looking for some feedback from the community on this, on direction, features and general usability. Let me know your thoughts and help make this a really great extension to an already great framework.
Download the code here
Report issues here
And remember, it’s a GIT repo, so fork it and help make it better!