I am trying to figure out a way to iterate through a folder and play back
any files found there. I'm trying to avoid going outside the dialplan, but I
am OK with running a few System() calls if I must.

Here's some code I wrote to try and load results into an environment
variable, and then read that variable. It's driving me nuts because it
doesn't work from asterisk, and the really crazy part is that it seems to
work only part of the time if I do it directly from the shell.

exten => s,n,System(export FILECOUNT=`ls -1
/home/asterisk/ira/incidents/*.wav | wc -l`)
exten => s,n,System('asterisk -rx "database put JIMS TEST $FILECOUNT"')
exten => s,n,SayDigits(${DB(JIMS/TEST)})

I'm probably doing something really stupid, but I have been banging my head
against the wall here, so I figured I'd throw it out there and see if anyone
can give me a clue or two.

TIA and Regards,

Jim


--
Jim Van Meggelen
Core Telecom Innovations
[EMAIL PROTECTED]
www.coretel.ca
416-425-6111 x6001
877-CORETEL x6001 (Canada)
www.oreillynet.com/pub/au/2177
http://downloads.oreilly.com/books/9780596510480.pdf

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to