I would have thought that System() just passed whatever it got to the shell,
so I would have figured that as long as the shell can handle it, no problem.

The big limitation with System() is that it does not feed stdout and stderr
back to asterisk.

Hmm . . . that gives me an idea . . .



> -----Original Message-----
> From: Terry D. Cudney [mailto:[EMAIL PROTECTED] 
> Sent: December 14, 2007 10:06 AM
> To: Jim Van Meggelen
> Cc: [email protected]
> Subject: Re: [on-asterisk] Playing back files from a folder 
> based on a filespec
> 
> Hi Jim,
> 
>       I haven't looked at the source code for the asterisk 
> "System" application, so may be way off base here, but...
> 
>       In the asterisk "System" appication, you are actually 
> running threee executables: export, ls and wc. 
> 
>       Is the asterisk "System" application able to run 
> multiple executables?
> 
>       Just a thought, since it works in the shell, but not 
> from asterisk's "System" application.
> 
>       --terry
> 
> On Fri, Dec 14, 2007 at 01:49:21AM -0500, Jim Van Meggelen wrote:
> > 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]
> > 
> 
> -- 
> 
> Name: Terry D. Cudney
> Phone:        (705) 812-3744
> E-mail:       [EMAIL PROTECTED]
> www: http://wasaga.homeip.net
> 
> Having a smoking section in a restaurant is like...
> having a peeing sectionin a swimming pool.
> 
> Tired of technology? Check this out: http://www.shibumi.org/eoti.htm
> 
> 

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

Reply via email to