<div dir="ltr"><div>Hi Steve,</div><div><br></div><div>What language is that please? We're using Perl and so far I haven't found an equivalent there.</div><div><br></div><div>Thanks for your help.</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 7 Jun 2019 at 12:10, Steve Edwards <<a href="mailto:asterisk.org@sedwards.com">asterisk.org@sedwards.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, 7 Jun 2019, David Cunningham wrote:<br>
<br>
> We have a need to record audio and allow the user to press any DTMF key <br>
> to end the recording. Currently we're using the AGI command "record <br>
> file" which does allow us to specify which DTMF keys can end the <br>
> recording.<br>
> <br>
> However we also need to know which key actually ended the recording. <br>
> Note that only allowing # or * to end the recording won't work for us.<br>
> <br>
> Does anyone know how we can tell which key ended the recording? Thanks <br>
> in advance for any help.<br>
<br>
Here's a snippet from one of my AGIs:<br>
<br>
// record the voice<br>
                 exec_agi("RECORD FILE"<br>
                           " %s"         // filename<br>
                           " wav"        // format<br>
                           " #*1234567890"<br>
                                         // escape digits<br>
                           " %d000"      // timeout in ms<br>
                           " BEEP"       // BEEP<br>
                         , recorded_path<br>
                         , recording_limit<br>
                         );<br>
<br>
// should we abort?<br>
                 if      ('*' == agi_environment.result)<br>
                         {<br>
                         agi_set_variable("STATUS", "*");<br>
                         exit(EXIT_SUCCESS);<br>
                         }<br>
<br>
// are we finished?<br>
                 if      ('#' == agi_environment.result)<br>
                         {<br>
                         break;<br>
                         }<br>
<br>
Looks like agi_environment.result is your Huckleberry.<br>
<br>
-- <br>
Thanks in advance,<br>
-------------------------------------------------------------------------<br>
Steve Edwards       <a href="mailto:sedwards@sedwards.com" target="_blank">sedwards@sedwards.com</a>      Voice: +1-760-468-3867 PST<br>
             <a href="https://www.linkedin.com/in/steve-edwards-4244281" rel="noreferrer" target="_blank">https://www.linkedin.com/in/steve-edwards-4244281</a><br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Check out the new Asterisk community forum at: <a href="https://community.asterisk.org/" rel="noreferrer" target="_blank">https://community.asterisk.org/</a><br>
<br>
New to Asterisk? Start here:<br>
      <a href="https://wiki.asterisk.org/wiki/display/AST/Getting+Started" rel="noreferrer" target="_blank">https://wiki.asterisk.org/wiki/display/AST/Getting+Started</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a></blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>David Cunningham, Voisonics Limited<br><a href="http://voisonics.com/" target="_blank">http://voisonics.com/</a><br>USA: +1 213 221 1092<br>New Zealand: +64 (0)28 2558 3782</div></div></div></div></div></div></div></div></div></div></div>