Asterisk – free PBX application for creating cool IVR service.
I’m was wonderin’ when see that Asterisk (*) can execute compiled .NET files as extension and dialplan schema.
AGI is Asterisk Gateway interface. It can be used to extend asterisk functionalities with help of different programming/scripting languages like C#, Perl, PHP etc.
For start the first thing you need to have installed in your box is Mono Tone. That is an open source project to use .NET Framework in Linux.
You can download Mono-Tone from http://www.mono-project.com/Downloads.
After installing you can use .NET assemblies and execute .exe files. You can compile any C# files with – mcs command line which is equivalent to csc in Windows. And you can run .exe file with mono command. But wait! Don’t go too fast because although you can run .exe file using mono command in Mono Project but AGI won’t execute your executables using mono. Asterisk and your .NET assembly share same console so you need to pass data from your program directly to Asterisk. You need to do some configurations to be able to run .NET assemblies directly and without mono command. For that you need to configure your binfmt. You can find the configuration HERE. (Find solution under Can I run Mono applications without using ‘mono program.exe’?
After that if you plan to restart your box in order to have same configuration after entry you need to add same configuration to /etc/rc.local
You need to place monotone.dll and your .net assemblies in /var/lib/asterisk/agi-bin/ and your sound files (in .gsm format) in /var/lib/asterisk/sounds/.
Now you are ready to start with your first program.Tweet