<div dir="ltr"><br><br><div class="gmail_quote">On Wed, Sep 14, 2011 at 4:08 AM, Steve Edwards <span dir="ltr">&lt;<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">On Wed, 14 Sep 2011, Israel Gottlieb wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
is it possible to pas variables to the shell function<br>
<br>
Set(recordingavail=${SHELL(&quot;ls /var/lib/asterisk/sounds/<u></u>custom/${TOPMENU}&quot;)})<br>
<br>
im trying to see if a file is available before playing the file<br>
<br>
or does anybody have a different idea but not using agi<br>
</blockquote>
<br></div></div>
Why not AGI?<br>
<br>
They both (&#39;shelling out&#39; or calling an AGI) have the same &#39;impact&#39; on system resources.<br>
<br>
You can even write an AGI in shell if you lack the skills for other languages like C, PHP, or Perl.<br>
<br>
You should be able to cobble up an AGI in PHP (or Perl, but I&#39;m not much of a Perl coder myself) just by cutting and pasting from some of the examples on <a href="http://voip-info.org" target="_blank">voip-info.org</a>.<br>

<br>
This simple task would be a great way for you to &#39;get your feet wet.&#39;<br>
<br>
What will you do if the file is not available?<br></blockquote><div><br>i know it has the same impact <br>im using asterisk since 0.4 yup lots of years mostly for the hobby and i have written some stuff in bash and php  but never really got connected to real programming. i read code no problem and understand exacttly what its doing and do fix up what i need but most of the time just dont have the patience to do it myself  (i have full time work in IT)<br>
<br>in this instance i was just writing a simple ivr maybe 10 lines were you could descend down the ivr as long as there is a recording and if it could be done simple within the dialplan i prefer that<br><br>i have made sophisticated ivr with lots up webservices and databases but then i of course use a external language  (a function to speak to webservices with xml parsing  i think would be a great addition to the dialplan )<br>
<br>thanks<br><br><br></div></div></div>