I am a beginner to asterisk. I am trying to develop sample IVR application for practice purpose. I found that there are three ways that we can write dial plan for IVR. first one is completely writing dial plan with asterisk scripting in extension.conf file. second one is Asterisk Gateway Interface and third one is via Asterisk Manager Interface. I want to know which one of these is a best way to write a dial plan. I found my self writing dial plan in asterisk-java via Fast-AGI is less pain than completely writing script in extensions.conf. also i want to know performance, maintenance and real world scenarios of these there. I am asking this question because i can start learning deeper the one every one is preferred. Please share your thoughts and experience.
It depends on the detailed requirements and your skills. Performance will be sightly worse with AGI, because of the need to launch the program every time. AMI is for third party control, and would not, normally be used. Simple IVRs are trivial when done directly in extensions.conf. and are probably easier to support by people on the Asterisk Support forum.
if AGI is very slow what about the Fast-AGI…?
It’s faster that AGI (as it may reside in memory due to being a “server component”), but: Every usage of AGI is a break-out of Asterisk core logic.
And: Everything Asterisk is offering within it’s core logic will be potentially more efficient than any other external component/thread.
As extensions.conf is really a bit “old fashioned” and sometimes hard to read You may have a look at extensions.ael (AEL2) or extensions.lua (LUA). Actually You’ll find a lot of support around there for .conf as well as for .ael.
Another remark: When trying to debug a dial logic in case of errors or probably incorrect behavior it’s much more easier to do this within Asterisk than doing this in a mix between .conf/.ael and AGI, as AGI doesn’t provide any deep-drive Debug-interface. This means: Every time You need debugging You’ll need to implement it by Yourself in Your AGI scripting and need to merge it than with debug output from Asterisk core. This is - in my opinion - a not necessary growth of complexity.