<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Yes, but this works:<br>
      <br>
      function getDestNumber()<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; session:execute("log", "INFO mcm2.lua getDestNumber")<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destnum = session:playAndGetDigits(3, 20, 3, 5000, "#",
      "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "", "\\d+\\*?")<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; l = string.len(destnum)<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if string.sub(destnum,l)=="*" then<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destnum = ""<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return destnum<br>
      end<br>
      <br>
      Unfortunately, it still doesn't quite work as I'd like. The *
      doesn't act as a "remembered but terminating" 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
cite="mid:CALNZuwkBOwpBjuKW5kwm7tHfH5VOtGsC5Tj3pHAB8UuwjAjE3A@mail.gmail.com"
      type="cite">
      <div dir="ltr">I didn'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 moz-do-not-send="true"
              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 "module-directory" but I'm not sure where I
                should get these modules from. Any recommended quick
                reading on this?<br>
              </div>
              <blockquote type="cite">
                <div>
                  <div class="h5">
                    <div>More lua trouble - real beginner stuff, I'm
                      afraid.<br>
                      <br>
                      Why does this not work:<br>
                      <br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; destnum = session:playAndGetDigits(3, 20,
                      3, 5000, "#",
                      "/home/oev/fs-pabx/prompts/dmsb12_mcm3.wav", "",
                      "\\d+\\*")<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 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 'strlen' (a nil value)<br>
                      stack traceback:<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/freeswitch/scripts/mcm2.lua:13:
                      in function 'getDestNumber'<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/freeswitch/scripts/mcm2.lua:49:
                      in function 'unattendedTransfer'<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /usr/local/freeswitch/scripts/mcm2.lua:24:
                      in function 'processMcmOption'<br>
                      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                      /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
                        moz-do-not-send="true"
                        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 moz-do-not-send="true"
                            href="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase"
                            target="_blank">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_phrase</a><br>
                          <a moz-do-not-send="true"
                            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 moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

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

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true"
                          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 moz-do-not-send="true" href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a>
<a moz-do-not-send="true" href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a>

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

Official FreeSWITCH Sites
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
<a moz-do-not-send="true" href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a>
<a moz-do-not-send="true" 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 moz-do-not-send="true" href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a>
<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a moz-do-not-send="true" href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a moz-do-not-send="true" href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a>
</pre>
                    <br>
                    <fieldset></fieldset>
                    <br>
                  </div>
                </div>
                <div>
                  <div class="h5">No virus found in this message.<br>
                    Checked by AVG - <a moz-do-not-send="true"
                      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 moz-do-not-send="true"
              href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
            <br>
            FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
            <a moz-do-not-send="true" href="http://www.cudatel.com"
              target="_blank">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              target="_blank">http://www.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://wiki.freeswitch.org"
              target="_blank">http://wiki.freeswitch.org</a><br>
            <a moz-do-not-send="true" 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 moz-do-not-send="true"
              href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
            UNSUBSCRIBE:<a moz-do-not-send="true"
              href="http://lists.freeswitch.org/mailman/options/freeswitch-users"
              target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org"
              target="_blank">http://www.freeswitch.org</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
<a class="moz-txt-link-abbreviated" href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</a>

FreeSWITCH-powered IP PBX: The CudaTel Communication Server
<a class="moz-txt-link-freetext" href="http://www.cudatel.com">http://www.cudatel.com</a>

Official FreeSWITCH Sites
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://wiki.freeswitch.org">http://wiki.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://www.cluecon.com">http://www.cluecon.com</a>

Join Us At ClueCon - Aug 7-9, 2012

FreeSWITCH-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a>
<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a>
UNSUBSCRIBE:<a class="moz-txt-link-freetext" href="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</a>
<a class="moz-txt-link-freetext" href="http://www.freeswitch.org">http://www.freeswitch.org</a>
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <p class="" avgcert""="" color="#000000" align="left">No virus
        found in this message.<br>
        Checked by AVG - <a moz-do-not-send="true"
          href="http://www.avg.com">www.avg.com</a><br>
        Version: 2012.0.2177 / Virus Database: 2437/5078 - Release Date:
        06/18/12</p>
    </blockquote>
    <br>
    <br>
  </body>
</html>