How to take output of System command in Dialplan


I need to take output of the system command. because on the basis of it i need to go for further process.

here is my system command line

exten => s,n,system("/usr/local/bin/faxstat -s|grep ${ARG2}")

I need the output of this line.

Please please help me…

Thanks in Advance

Have you tried using a Perl AGI script?

Execute the command via AGI using either the Perl system command or by using backticks. Process the result of the command and execute dialplan commands from with Perl. In fact I think you can set a dialplan variable from withn your Perl AGI script and then drop back into the dialplan and branch based on the value of the variable you set.