[asterisk-users] using variables in the shell function

Dale Noll dnoll at wi.rr.com
Tue Sep 13 21:27:03 CDT 2011


On 09/13/2011 07:49 PM, Israel Gottlieb wrote:
> is it possible to pas variables to the shell function
>
> Set(recordingavail=${SHELL("ls
> /var/lib/asterisk/sounds/custom/${TOPMENU}")})
>
> im trying to see if a file is available before playing the file
>
> or does anybody have a different idea but not using agi
>
> asterisk 1.6.2.20
> thanks
>

You should check out the STAT function.

core show function STAT



This should evaluate to 1
  ${STAT(e,/var/lib/asterisk/sounds/en/vm-goodbye.gsm)})

This should evaluate to 0
  ${STAT(e,/var/lib/asterisk/sounds/en/xyzzy.gsm)}


Dale




More information about the asterisk-users mailing list