Interface Mirror

Proper Solutions to Software Development Problems

  Home  |   Contact  |   Syndication    |   Login
  18 Posts | 8 Stories | 16 Comments | 1 Trackbacks

News



Article Categories

Archives

Post Categories

Link

AGI

 

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.

 

According to VoIp-info.org

 

  • AGI may control the dialplan, called in extensions.conf
  • EAGI gives the application the possibility to access and control the sound channel in addition to interaction with the dial plan
  • FastAGI can be used to do the processing on a remote machine
  • DeadAGI gives access to a dead channel, after hang-up.

 

Basically there are few commands exposed by AGI and give programmers the power to enjoy Asterisk facilities with language of their own choice.

You can take complete list of AGI commands from HERE.

If you are a C# programmer then the source code of C# dll can be found at Gundy’s blog. His blog is a really good help to start. I should thank Gabriel from here because with his help and excellent startup material in his site I could develop a couple of cool applications using AGI.

 

Startup

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.

 

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Monday, March 05, 2007 7:11 PM

Feedback

# re: Asterisk Programming in C# - Agi 4/23/2009 2:20 PM Tolga
Hi
I am a newbie for asterisk and work on a project currently.

By using C# I have to configure voicemail in asterisk.
I saw some examples which is changing the values voicemail.conf file with SSH Object. so that you can add / remove voicemails.

is it possible to confugre voicemail in asterisk by using AGI or Asterisk Management Interface (AMI)?

I have also read smth about using an external db instead of using voicemail.conf file. is there any example for that. I couldnt find the correct way.?

Thanks alot in advance.


# re: Asterisk Programming in C# - Agi 4/23/2009 9:38 PM Interface Mirror
Hi,

Well, I don't think that using AGI you can configure VoiceMail But if you want to edit voicemail.conf then you can simply use Mono. There is no need to use AGI to access it. using Mono you can access/write and do anything with linux files just like windows. the only difference is File Path format (In windows we have c:\file.ext but in linux \var\lib\...\file.ext).

Read the file with StreamReader object and Write to it using StreamWriter object and do whatever you want.

Please let me know if you need any clarification.

# re: Asterisk Programming in C# - Agi 10/8/2009 5:28 AM Rikki
hi

I am trying to create something like this http://wakerupper.com

is it possible using asterik

# re: Asterisk Programming in C# - Agi 7/17/2010 5:32 AM fara
I am also trying to develop a software slimier to elastix using C# but still I have no idea on where to start !

I have a pc with cent os and asterisk setuped and I am planning to develop a application in windows !

smiler to a client program ?

can u pls advice me ?

# re: Asterisk Programming 10/3/2010 9:38 PM jay
hi. i am researching about asterisk programming and i am very new to this.
any advise how can i start and where can i find resources for this type of programming?
thank you...

# Asterisk Programming in C# - Agi 1/11/2011 12:33 AM Hardik Darji
Hi,
I am trying to create Conference call with Asterisk Programming in C#.Net

Please, any help?

# re: Asterisk Programming in C# - Agi 9/1/2011 1:02 PM nourdine
i want try it

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: