[Freeswitch-users] ivr from mysql

Michael Collins msc at freeswitch.org
Mon Mar 1 11:09:30 PST 2010


2010/3/1 michal kalinowski <michal.kalinowski at interia.pl>

> 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?
>

I ran into this issue when I was converting the demo IVR to Lua. There are
indeed 16 arguments but you've only got 13 of them. Here's a snippet from
the Lua script I'm working on:
ivr_def = {
    ["main"]                = undef,
    ["name"]                = "demo_ivr_lua",
    ["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",
    ["inter_digit_timeout"] = "2000",
    ["digit_len"]           = "4",
    ["timeout"]             = "10000",
    ["max_failures"]        = "3",
    ["max_timeouts"]        = "2"
}
Those are all 16 arguments. Notice you need tts_engine, tts_voice, and
max_timeouts. Try that and let us know how it goes.

-MC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100301/c9d27617/attachment-0002.html 


More information about the FreeSWITCH-users mailing list