AGI Scripting tutorials/examples?

PalletBoy
Posts: 39
Member Since:
2006-12-19

Trying to break into AGI scripting can be a real pain in the bum, I'm finding.
I've Googled like crazy but can't find a site or place that has good "beginner" (and beyond) AGI scripting examples. There's plenty of info on the available functions and methods, but nothing helpful I can find on how to get started, etc. After a ton of work (trial and error, rinse and repeat) I got a very short AGI script working but trying to extend it (Transfer the call based on agi_dnid for example) is proving to be, yet again, extremely frustrating.

Thanks for any direction!
- PB



jfinstrom
Posts: 1879
Member Since:
2007-03-07
a few

ethans
Posts: 517
Member Since:
2007-01-16
You can also download some

You can also download some of Ward's scripts at nerdvittles.com. If you are a programmer, you should learn a lot by example.

When dealing with manipulating channels and doing things like transferring calls, you should be familiar with AMI (Asterisk Manager Interface). The reference will help a lot: http://www.voip-info.org/wiki-Asterisk+manager+API

Specifically talking about transferring, if you are using PHP, investigate the phpagi-asmanager application which will give you an API into the AMI. For instance, to transfer using this library, I would do something like $asm->Redirect($peer, null, $extension, "ext-local", 1); which redirects one channel to another, effectively transferring the call.



PalletBoy
Posts: 39
Member Since:
2006-12-19
Brilliant!

James,
The second link is exactly what I was looking for!
Thanks!



mephi
Posts: 17
Member Since:
2009-02-12
link not working

jfinstrom, second link from your post isn't working :( do u have any other link to it?



a_lemin
Posts: 227
Member Since:
2007-01-21
Here is an old WIKI I wrote

Here is an old WIKI I wrote which gives an example of how to use an AGI from the dial plan right through to a database and back again with all steps detailed.
Might be helpful for you.



a_lemin
Posts: 227
Member Since:
2007-01-21
http://trixbox.org/wiki/datab

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.