<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    Hi guys,<br>
    <br>
    Thanks for the info, I'm still trying to find the best solution for
    me. It's looking like handling it all in a lua script might be the
    way to go.<br>
    <br>
    However I would welcome expert opinions on the following concept.<br>
    <br>
    The call routes into the IVR and the following entry captures a 4
    digit keypress and sends the data to the lua script:<br>
    <br>
    &lt;entry action="menu-exec-app" digits="/^(\d{4})$/"
    param="transfer $1 LUA ivr-get-data.lua"/&gt;&nbsp; <br>
    <br>
    And either:<br>
    <br>
    The script does the db lookup and retrieves the destination number
    from the database and sends the call back into the default context:<br>
    <br>
    table.insert(ACTIONS, {"transfer", "0398776544 XML default"})<br>
    <br>
    The destination number is matched and routed out as normal.<br>
    <br>
    or<br>
    <br>
    The script retrieves further detail from the database and sends the
    call back into the ivr_next_level context and we do the dance again:<br>
    <br>
    table.insert(ACTIONS, {"transfer", "101323556 XML ivr_next_level"})<br>
    <br>
    <br>
    In terms of speed and system resources is this an efficient way to
    handle a variable keypress IVR with possible multiple levels?<br>
    <br>
    - John<br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 19/05/13 4:10 AM, Dave R. Kompel
      wrote:<br>
    </div>
    <blockquote cite="mid:20130518181004.3811e942@mail.tritonwest.net"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style>BODY{font:10pt Tahoma, Verdana, sans-serif}</style>
      <div>Just from my experence, it's a lot easier to write the whole
        logic, for a complex IVR in something (lua, perl, python, C#,
        F#) or anything else that FS supports, rather then trying to
        cram it in to the simple IVR application. Remember you can do
        foreign DB access or talk to anything else (web service, raw
        http service, etc...) from any of the languages directly.</div>
      <div>&nbsp;</div>
      <div>I do almost all external interaction with C# modules, runnig
        inside of FS. Makes life real easy :)</div>
      <div>&nbsp;</div>
      <div>--Dave</div>
      <br>
      <blockquote style="BORDER-LEFT: #0000ff 2px solid; PADDING-LEFT:
        5px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
        <hr>
        <b>From:</b> Brian Foster [<a class="moz-txt-link-freetext" href="mailto:bdfoster@davri.com">mailto:bdfoster@davri.com</a>]<br>
        <b>To:</b> FreeSWITCH Users Help
        [<a class="moz-txt-link-freetext" href="mailto:freeswitch-users@lists.freeswitch.org">mailto:freeswitch-users@lists.freeswitch.org</a>]<br>
        <b>Sent:</b> Sat, 18 May 2013 09:49:59 -0700<br>
        <b>Subject:</b> Re: [Freeswitch-users] Complex IVRs using data
        from MySQL<br>
        <br>
        <p>Whether or not you hand it back to mod_ivr or not, to set a
          channel variable in Lua:</p>
        <p>session:setVariable("varname", "varvalue");</p>
        <p>This has the same effect as using the set application in the
          dialplan:</p>
        <p>&lt;action application="set" data="varname=varvalue"/&gt;</p>
        <p>You can read the variable in Lua like this:</p>
        <p>varname = session:getVariable("varname");</p>
        <p>-BDF</p>
        <div class="gmail_quote">On May 18, 2013 12:35 PM, "Telecube -
          John" &lt;<a moz-do-not-send="true"
            href="mailto:john@telecube.com.au">john@telecube.com.au</a>&gt;
          wrote:<br type="attribution">
          <blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px
            0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Ok, if
            someone could point me in the right direction I would be
            very<br>
            grateful.<br>
            <br>
            I need to integrate database lookups into multi level IVRs
            to gather<br>
            call routing info.<br>
            <br>
            The lookups are for variable multi digit keypress data as
            well as<br>
            multiple sets of routing information.<br>
            <br>
            So far I can see my options are xml_curl or hand the call
            off to a lua<br>
            script to handle the processing.<br>
            <br>
            I can catch the multi digit keypresses with regex and give
            that detail<br>
            to a lua script, no problem.<br>
            <br>
            I'm hoping to be able to use the mod_ivr process as much as
            possible but<br>
            I'm struggling to see how I can get data back into the call
            flow after<br>
            dishing the duty off to lua.<br>
            <br>
            Can anyone point me down the right path please?<br>
            <br>
            Should I be happy to pass it off to lua and finish the
            lookups and<br>
            routing in there?<br>
            <br>
            Should I try to keep as much as possible in the core ivr?<br>
            <br>
            Thanks..<br>
            <br>
            - John<br>
            <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/">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/">http://www.cudatel.com</a><br>
            <br>
            Official FreeSWITCH Sites<br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://wiki.freeswitch.org/">http://wiki.freeswitch.org</a><br>
            <a moz-do-not-send="true" href="http://www.cluecon.com/">http://www.cluecon.com</a><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">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">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
            <a moz-do-not-send="true" href="http://www.freeswitch.org/">http://www.freeswitch.org</a><br>
          </blockquote>
        </div>
      </blockquote>
      <style>
</style>
      <div>&nbsp;</div>
      <div>&nbsp;</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>

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>
    </blockquote>
    <br>
  </body>
</html>