[asterisk-users] Get dialed numbers in AGI

Lee Jenkins lee at datatrakpos.com
Thu Jan 11 13:45:31 MST 2007


Eric "ManxPower" Wieling wrote:
> Steve Edwards wrote:
>> 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)
> 
> AGI() does not support more than 1 parameter to AGIs.
> 
> _______________________________________________

This works:

AGI(dtfb,GET|LeeVar|MySavedSQL|"${CALLERID(num)}|14")

GET, LeeVar, MySavedSQL come through as command line parameters supplied 
to the AGI.  "${CALLERID(num)}|14" also comes through as a command line 
parameter with the ${CALLERID(num)} replaced with the appropriate value.

Note that this is a freepascal AGI.


-- 

Warm Regards,

Lee



More information about the asterisk-users mailing list