On Wed, 23 Apr 2008, Al Baker wrote:

> The BASIC QUESTION I was trying to ask is this...
>   "Since the MYSQL add-on provides a way to interface with MySQL
>     what is it that one gains or is trying to gain by writing their OWN
>     AGI script to do the interface ?"

I like doing "serious work" in an AGI instead of the dialplan because:

1) It allows me to use a compiled language. Not just for performance 
reasons, but because a compiler (or a strict interpreter) helps me protect 
me from me. My production dialplan is just over 600 lines. The sources to 
my AGIs are a bit more than 15,000 lines. I like that if I "fat-finger" a 
variable, the compiler will help me. If I "fat-finger" something in 16,000 
lines of dialplan will I ever find it?

2) It allows me to hide complexity. I like having a single statement in my 
dialplan that says "agi(block-ani)." I know that in this single statement 
I am invoking code that acts as the gatekeeper to my system, allowing me 
to block callers by area code, area code and prefix, and the complete 
subscriber number. I know it works well and I don't have to look at it any 
more.

3) I can "share" better. It is easier to integrate a single statement into 
an existing dialplan than 2,000 statements with potential conflicts in 
context, template, and variable names.

4) I don't have to learn (what appears to me to be) a really obtuse 
syntax. Funky quoting and whitespace rules lead to accelerated hair loss.

5) I have a "full" toolbox. For instance, one of my AGIs (play-path) lets 
me pass a path and it returns the name of a WAV file in that path at 
random. Calling ftw() was a simple solution. Another AGI (auth-card) lets 
me submit an authorization request to my credit card processor. While 
waiting for the card response, I play "Please wait while we validate your 
card" in another thread in the same AGI. By the time the "STREAM FILE" is 
finished, I have the response so to the customer it appears 
"instantaneous."  How would I do either of these in "dialplan?"

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      [EMAIL PROTECTED]      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to