[Freeswitch-users] ivr from mysql

Brian West brian at freeswitch.org
Sat Feb 27 13:48:04 PST 2010


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ł





More information about the FreeSWITCH-users mailing list