<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
asterisk-users-bounces@lists.digium.com
[mailto:asterisk-users-bounces@lists.digium.com] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Tino<br>
<b><span style='font-weight:bold'>Subject:</span></b> [asterisk-users] 'System'
application in asterisk</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color=navy
face="Times New Roman"><span style='font-size:12.0pt;color:navy'>&gt;</span></font>Hello,<br>
<font color=navy><span style='color:navy'>&gt;</span></font>Is there any&nbsp;
way to capture the output of the 'System' application in asterisk dialplan and
evaluate it. <br>
<br>
<font color=navy><span style='color:navy'>&gt;</span></font>For example, i
would like to get the output of following System application and use its value
in next line<br>
<font color=navy><span style='color:navy'>&gt;</span></font>for decision making<br>
<br>
<font color=navy><span style='color:navy'>&gt;</span></font>exten =&gt; 5000,n,System(command)<br>
<br>
<font color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I think
this answer is no.&nbsp; system only returns ${SYSTEMSTATUS} as SUCCESS or
FAILURE to tell you that the command finished or died.&nbsp; You could however
do a bash AGI that would set a variable with the result of what you would have
sent to system<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Replace <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Exten =&gt;
5000,n,System(&#8216;/bin/ls&#8217;)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>With <o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Exten =&gt;
5000,n,AGI(bashsys.sh,&#8221;/bin/ls&#8217;)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Exten =&gt;
5000,n.Gotoif(${RESULT}&#8230;<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
<o:p></o:p></span></font></p>

</div>

</body>

</html>