Hello, Is there any way to capture the output of the 'System' application in asterisk dialplan and evaluate it. For example, i would like to get the output of following System application and use its value in next line for decision making exten => 5000,n,System(command) -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100809/cbd5d973/attachment.htm
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Tino Subject: [asterisk-users] 'System' application in asterisk>Hello, >Is there any way to capture the output of the 'System' application inasterisk dialplan and evaluate it.>For example, i would like to get the output of following System applicationand use its value in next line>for decision making>exten => 5000,n,System(command)I think this answer is no. system only returns ${SYSTEMSTATUS} as SUCCESS or FAILURE to tell you that the command finished or died. You could however do a bash AGI that would set a variable with the result of what you would have sent to system Replace Exten => 5000,n,System('/bin/ls') With Exten => 5000,n,AGI(bashsys.sh,"/bin/ls') Exten => 5000,n.Gotoif(${RESULT}. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20100809/2cd46a20/attachment.htm
On Monday 09 August 2010 13:08:19 Tino wrote:> Is there any way to capture the output of the 'System' application in > asterisk dialplan and evaluate it. > > For example, i would like to get the output of following System application > and use its value in next line > for decision making > > exten => 5000,n,System(command)No, but you may use the SHELL dialplan function in versions which support it: Set(output=${SHELL(command)}) -- Tilghman Lesher Digium, Inc. | Senior Software Developer twitter: Corydon76 | IRC: Corydon76-dig (Freenode) Check us out at: www.digium.com & www.asterisk.org