[asterisk-users] Get dialed numbers in AGI
Steve Edwards
asterisk.org at sedwards.com
Thu Jan 11 11:54:09 MST 2007
On Thu, 11 Jan 2007, Yuan LIU wrote:
> AGI doesn't see the name "var"; all it sees is an array @ARGV (or whatever in
> the respective language). As the documentation says, values are passed like
> command line arguments.
But, in the interest of "more maintainable code," you can pass the option
name and use "getopt_long()" in "C" or whatever language you use. For
example,
agi(block-ani,--ani=555555555,--dnis=8005551212,--debug,--verbose)
vs
agi(block-ani|555555555|8005551212|y|y)
getopt_long() will do all the "heavy lifting" to parse the "command line"
options for you.
Which one would you rather see in a dialplan you're trying to enhance or
maintain?
Thanks in advance,
------------------------------------------------------------------------
Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000
More information about the asterisk-users
mailing list