Hello, How to take the values of channel variables like 'agi_uniqueid' and 'agi_callerid' in agi script. For example #!/bin/bash -x T="$agi_uniqueid" I want to save value of 'agi_uniqueid' channel variable into a variable called 'T' in my script -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100811/89c7eded/attachment.htm
On Wed, 11 Aug 2010, Tino wrote:> How to take the values of channel variables like 'agi_uniqueid' and > ?'agi_callerid' in agi script. For example > > #!/bin/bash -x > T="$agi_uniqueid"AGI is a protocol. Basically, Asterisk creates a process to run your AGI compliant program (the above is not). Asterisk feeds the "AGI environment" to your program via STDIN. Your program then issues requests to Asterisk by writing to STDOUT and reads responses from STDIN. While you can write your own "AGI library," you should use an existing library for your source language (I prefer c for a lot of reasons) -- nobody gets it right the first time. Search on voip-info.org for more specifics. -- Thanks in advance, ------------------------------------------------------------------------- Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000
On Wednesday, August 11, 2010 11:08:37 am Tino wrote:> #!/bin/bash -x > T="$agi_uniqueid" > > I want to save value of 'agi_uniqueid' channel variable into a variable > called 'T' in my scriptWhen executing and AGI from the dialplan, it will dump out it's variables immediately, so you need to tell Bash to read them in and write them to whatever variables you want. For example, see: http://messinet.com/trac/asterisk-fax-gw/browser/fax-gw.agi#L622 Here, I set the variable name from Asterisk to the variable value from Asterisk. So I end up with: agi_uniqueid=123456... (or whatever the uniqueid was) Then I could go on to say T="$agi_uniqueid" -- Anthony - http://messinet.com - http://messinet.com/~amessina/gallery 8F89 5E72 8DF0 BCF0 10BE 9967 92DC 35DC B001 4A4E -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part. Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20100818/ab0b14b4/attachment.pgp