[Asterisk-Users] Re: echo system command and set the results to a new variable

Michel Koenen michel.koenen at gmail.com
Tue Aug 30 03:15:00 MST 2005


> 
> From: Henry Junior <henryjunior at gmail.com>
> 
> I want to issue a System cmd in my dialpan that is similar to the
> unix echo command stated above. *EXCEPT* that I want to pipe the
> results into a *new* variable (vs a text file.)
> 
> Ideally, what would happen is in my diaplan I would issue the 'echo |
> date' command and pipe the output to a newly created variable with
> the appropriate output.
> 
> example:
> NewVariable=Mon Aug 29 18:32:45 EDT 2005
> 
> Do you know how I can do this?

  Assuming that you want to execute some Unix commands and feedback the 
output as variables to the dialplan in Asterisk this is possible with an AGI 
bash script. Use the 'set variable' command 
http://www.voip-info.org/tiki-index.php?page=set+variable
 You can use the example at 
http://yakko.cs.wmich.edu/~drclaw/asterisk/cidname/ , reuse the framework to 
read the standard AGI variables and rewrite it to your own code.
 Regards,
Michel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20050830/8e450162/attachment.htm


More information about the asterisk-users mailing list