<div dir="ltr">Maybe try: <a href="http://wiki.freeswitch.org/wiki/Mod_lua#session:setInputCallback">http://wiki.freeswitch.org/wiki/Mod_lua#session:setInputCallback</a><br clear="all"><div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small">-Avi</span></span></div>


<br><br><div class="gmail_quote">On Tue, Jun 19, 2012 at 11:14 AM, Alex <span dir="ltr">&lt;<a href="mailto:alex@thewinelake.com" target="_blank">alex@thewinelake.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 bgcolor="#FFFFFF" text="#000000">
    <div>Yes, but this works:<br>
      <br>
      function getDestNumber()<br>
              session:execute(&quot;log&quot;, &quot;INFO mcm2.lua getDestNumber&quot;)<br>
              destnum = session:playAndGetDigits(3, 20, 3, 5000, &quot;#&quot;,
      &quot;/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav&quot;, &quot;&quot;, &quot;\\d+\\*?&quot;)<br>
              l = string.len(destnum)<br>
              if string.sub(destnum,l)==&quot;*&quot; then<br>
                      destnum = &quot;&quot;<br>
              end<br>
              return destnum<br>
      end<br>
      <br>
      Unfortunately, it still doesn&#39;t quite work as I&#39;d like. The *
      doesn&#39;t act as a &quot;remembered but terminating&quot; key, so the customer
      still has to press # (or, presumably, wait 5s) after pressing *
      for the message to get through!<br>
      <br>
      Is there a DTMF history buffer one can inspect? Then I could make
      * a terminating key and then just see if that was the last DTMF.<br>
      <br>
      Alex<br>
      <br>
      <br>
      <br>
    </div>
    <blockquote type="cite"><div><div class="h5">
      <div dir="ltr">I didn&#39;t need to do any such thing... Did you get
        an error using myString:len()?<br clear="all">
        <div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small">-Avi</span></span></div>
        <div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small"><br>
            </span></span></div>
        <div dir="ltr"><span style="font-family:Verdana,Arial,Helvetica,sans-serif"><span style="font-size:small"><br>
            </span></span></div>
        <div class="gmail_quote">On Mon, Jun 18, 2012 at 8:07 PM, Alex <span dir="ltr">&lt;<a href="mailto:alex@thewinelake.com" target="_blank">alex@thewinelake.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 bgcolor="#FFFFFF" text="#000000">
              <div>OK, so replying to myself, I think I need to include
                the string library... I can see in lua.conf.xml that one
                can have a &quot;module-directory&quot; but I&#39;m not sure where I
                should get these modules from. Any recommended quick
                reading on this?<br>
              </div>
              <blockquote type="cite">
                <div>
                  <div>
                    <div>More lua trouble - real beginner stuff, I&#39;m
                      afraid.<br>
                      <br>
                      Why does this not work:<br>
                      <br>
                              destnum = session:playAndGetDigits(3, 20,
                      3, 5000, &quot;#&quot;,
                      &quot;/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav&quot;, &quot;&quot;,
                      &quot;\\d+\\*&quot;)<br>
                              l = strlen(destnum)<br>
                      <br>
                      The objection is<br>
                      <br>
                      <br>
                      2012-06-18 16:52:30.415261 [ERR] mod_lua.cpp:198
                      /usr/local/freeswitch/scripts/mcm2.lua:13: attempt
                      to call global &#39;strlen&#39; (a nil value)<br>
                      stack traceback:<br>
                              /usr/local/freeswitch/scripts/mcm2.lua:13:
                      in function &#39;getDestNumber&#39;<br>
                              /usr/local/freeswitch/scripts/mcm2.lua:49:
                      in function &#39;unattendedTransfer&#39;<br>
                              /usr/local/freeswitch/scripts/mcm2.lua:24:
                      in function &#39;processMcmOption&#39;<br>
                             
                      /usr/local/freeswitch/scripts/mcm2.lua:153: in
                      main chunk<br>
                      <br>
                      I was just assuming that lua is lua and that
                      anything in the lua wiki (eg. <a href="http://www.lua.org/manual/2.4/node32.html#exstring" target="_blank">http://www.lua.org/manual/2.4/node32.html#exstring</a>)
                      would work. <br>
                      <br>
                    </div>
                    <blockquote type="cite">
                      <div dir="ltr">Phrases let you mix and match
                        speak, say, play-file, silence, other macros,
                        and even passing in options.<br>
                        <br>
                        <div><a href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase" target="_blank">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase</a><br>
                          <a href="http://wiki.freeswitch.org/wiki/Speech_Phrase_Management" target="_blank">http://wiki.freeswitch.org/wiki/Speech_Phrase_Management</a><br>
                          <br>
                          <div>-Avi<br>
                          </div>
                        </div>
                      </div>
                      <br>
                      <fieldset></fieldset>
                      <br>
                      <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                      <br>
                      <fieldset></fieldset>
                      <br>
                      <p color="#000000" align="left">No virus found in
                        this message.<br>
                        Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
                        Version: 2012.0.2177 / Virus Database: 2433/5076
                        - Release Date: 06/17/12</p>
                    </blockquote>
                    <br>
                    <br>
                    <br>
                    <fieldset></fieldset>
                    <br>
                    <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <div>
                  <div>No virus found in this message.<br>
                    Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
                  </div>
                </div>
                Version: 2012.0.2177 / Virus Database: 2437/5077 -
                Release Date: 06/18/12 </blockquote>
              <br>
              <br>
            </div>
            <br>
_________________________________________________________________________<br>
            Professional FreeSWITCH Consulting Services:<br>
            <a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a><br>
            <a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
            <a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
            <a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
            <a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
            <br>
            Join Us At ClueCon - Aug 7-9, 2012<br>
            <br>
            FreeSWITCH-users mailing list<br>
            <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
            <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
            UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
      <br>
      <fieldset></fieldset>
      <br>
      </div></div><p color="#000000" align="left"></p><div><div class="h5">No virus
        found in this message.<br>
        Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br></div></div>
        Version: 2012.0.2177 / Virus Database: 2437/5078 - Release Date:
        06/18/12<p></p>
    </blockquote>
    <br>
    <br>
  </div>

<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
Join Us At ClueCon - Aug 7-9, 2012<br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>