[Freeswitch-users] ivr from mysql

michal kalinowski michal.kalinowski at interia.pl
Mon Mar 1 03:51:55 PST 2010


Thank's Brian

So at this moment i have only clean configuration in lua without any XML.

I get example from wiki:

hash={["main"]=undef,

   ["name"]="top",

         ["greet_long"]="phrase:demo_ivr_main_menu",

["greet_short"]="phrase:demo_ivr_main_menu_short",

["invalid_sound"]="ivr/ivrthat_was_an_invalid_entry.wav",

["exit_sound"]="voicemail/vmgoodbye.wav",

["confirm_macro"]="undef",

 ["confirm_key"]="undef",

    ["confirm_attempts"]="3",

      ["inter_digit_timeout"]="2000",

       ["digit_len"]="1",

               ["timeout"]="10000",
["max_failures"]="3"
}
top = freeswitch.IVRMenu(hash["main"],
hash["name"],
hash["greet_long"],hash["greet_short"],
hash["invalid_sound"],
hash["exit_sound"],
hash["confirm_macro"],
hash["confirm_key"],
hash["confirm_attempts"],
hash["inter_digit_timeout"],
hash["digit_len"],
hash["timeout"],
hash["max_failures"]);

top:bindAction("menu-exec-app", "playback/tmp/swimp.raw","2");
top:execute(session, "top");

But something is wrong freeswitch say
2010-03-01 13:02:43.633721 [ERR] mod_lua.cpp:182 Error in IVRMenu
expected 16..16 args, got 13
stack traceback:
        [C]: in function 'IVRMenu'
        /usr/local/freeswitch/scripts/ivr.lua:19: in main chunk

What args FS expect?

BR,
Michał
W dniu 27 lutego 2010 22:48 użytkownik Brian West
<brian at freeswitch.org> napisał:
> can you point out on the wiki that indicated you are able to dot his?  You're mixing two concepts incorrectly here.
>
> For example you can't do "set" and exec the file to get the contents.. you can however on linux use "exec" instead of set.  But your script needs to print it to stdout.  Your example in your lua script is for the config engine in in lua thats like XML curl... in which case you're not building the full document like you should.  Read thru the XML CURL docs if you want to do "XML_STRING = mydialplan".
>
> /b
>
>
> On Feb 27, 2010, at 3:10 PM, michal kalinowski wrote:
>
>> Coming back to this case I create in lua some script with XML ivr.
>>
>> #!/usr/local/bin/lua
>>
>> mydialplan = [[
>> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
>> <document type="freeswitch/xml">
>> <include>
>>  <!-- demo IVR setup -->
>>  <!-- demo IVR, Main Menu -->
>>  <menu name="demo_ivr"
>>      greet-long="phrase:demo_ivr_main_menu"
>>      greet-short="phrase:demo_ivr_main_menu_short"
>>      invalid-sound="ivr/ivr-that_was_an_invalid_entry.wav"
>>      exit-sound="voicemail/vm-goodbye.wav"
>>      confirm-macro=""
>>      confirm-key=""
>>      tts-engine="flite"
>>      tts-voice="rms"
>>      confirm-attempts="3"
>>      timeout="10000"
>>      inter-digit-timeout="2000"
>>      max-failures="3"
>>      max-timeouts="3"
>>      digit-len="4">
>>
>>    <!-- The following are the definitions for the digits the user dials -->
>>    <!-- Digit 1 transfer caller to the public FreeSWITCH conference -->
>>    <entry action="menu-exec-app" digits="1" param="bridge
>> sofia/$${domain}/888 at conference.freeswitch.org"/>
>>    <entry action="menu-exec-app" digits="2" param="transfer 9996 XML
>> default"/>    <!-- FS echo -->
>>    <entry action="menu-exec-app" digits="3" param="transfer 9999 XML
>> default"/>    <!-- MOH -->
>>    <entry action="menu-exec-app" digits="4" param="transfer 9991 XML
>> default"/>    <!-- ClueCon -->
>>    <entry action="menu-exec-app" digits="5" param="transfer 1234*256
>> enum"/>       <!-- Screaming monkeys -->
>>    <entry action="menu-sub" digits="6" param="demo_ivr_submenu"/>
>>             <!-- demo sub menu -->
>>    <!-- Using a regex in the digits tag lets you define a dial
>> pattern for the caller
>>         You may define multiple regexes if you need a different
>> pattern for some reason -->
>>    <entry action="menu-exec-app" digits="/^(10[01][0-9])$/"
>> param="transfer $1 XML features"/>
>>    <entry action="menu-top" digits="9"/>          <!-- Repeat this menu -->
>>  </menu>
>>
>> </include>
>> ]]
>> XML_STRING = mydialplan
>>
>> in dialplan I have context with this ivr
>>
>>  <context name="ivr">
>> <extension name="ivr">
>>     <condition field="caller_id_number" expression="^[0-9]"/>
>>     <condition field="destination_number" expression="^(\d{11})$">
>>        <action application="answer"/>
>>        <action application="ivr" data="demo_ivr"/>
>>     </condition>
>> </extension>
>>  </context>
>>
>> in ivr.conf i have this
>>
>> <configuration name="ivr.conf" description="IVR menus">
>>  <menus>
>>        <X-PRE-PROCESS cmd="set" data="application=lua lua.ivr"/>
>>  </menus>
>> </configuration>
>>
>> but for some reasons Freeswitch say "2010-02-27 22:27:48.380342 [ERR]
>> mod_dptools.c:1247 Unable to find menu"
>> what I do wrong ?
>>
>>
>> BR,
>> Michał
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>




More information about the FreeSWITCH-users mailing list