On Mon, 23 Feb 2009, Yawar Hadi wrote:
> so if u want to read extension then supplu variable name like
> $myno=$AGI->get_variable('EXTEN');
> hope u get it
I think passing the variable "on the command line" is more flexible than a
fixed variable, particularly the much more limiting ${EXTEN}.
My preference is to use the "getopt_long" function to parse the command
line passed to the AGI. I find
exten = _x.,n,agi(dial,--customer-id=112)
to be more "obvious" than
exten = _x.,n,agi(dial,${EXTEN})
or
exten = 112,n,agi(dial)
This becomes even more obvious when you pass multiple variables:
exten = _x.,n,agi(dial\
,--announce=winter-specials\
,--customer-id=112\
,--caller-id=ACME Widgets Inc\
,--verbose\
,--record\
)
(line split for readability)
rather than
exten = _x.,n,agi(dial,112,,,winter-specials,ACME Widgets,v,,r)
or
exten = 112,n,agi(dial)
Particularly since getopt_long does not care about the order of the
options.
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