[Freeswitch-users] Accessing Config Info From Database

Leon de Rooij leon at scarlet-internet.nl
Mon Nov 16 14:02:53 PST 2009


Hi,

Since recently it's also possible to use lua *as* a dialplan:

http://wiki.freeswitch.org/wiki/Mod_lua#For_dialplan

regards,

Leon




On Mon, 2009-11-16 at 11:33 -0800, Michael Collins wrote:
> 
> 
> On Mon, Nov 16, 2009 at 9:36 AM, Jerry Richards
> <jerry.richards at teotech.com> wrote:
>         
>         I have a bit of confusion about Lua scripting.  When a script
>         is invoked,
>         should it always return an XML string that is used by FS?  Or
>         as in the case
>         of dialplan examples, does it actually execute the dialplan
>         (e.g.
>         "session:answer();")?
>         
>         Best Regards,
>         Jerry
>         
> 
> Jerry,
> 
> A Lua script that is explicitly called from the dialplan will indeed
> execute dialplan-ish stuff. For example, let's say you had this in
> conf/dialplan/default.xml:
> 
> <extension name="lua sample">
>   <condition field="destination_number" expression="9876">
>     <action application="lua" data="/path/to/myluascript.lua"/>
>   </condition>
> </extension>
> 
> Then myluascript.lua has something like:
> 
> --Sample Lua script
> session:answer()
> session:sleep(1000)
> session:streamFile("/path/to/file.wav")
> session:hangup()
> 
> Assuming an otherwise default install, the above Lua script would
> execute when a caller dialed 9876, or if a call was x-ferred to 9876.
> 
> However, if you're wanting to use Lua to serve up a dialplan then it's
> totally different. Lua is not called from the dialplan; Lua provides
> the dialplan to FreeSWITCH. This latter case is the scenario discussed
> in the wiki section you referenced.
> (http://wiki.freeswitch.org/wiki/Lua#For_serving_configuration)
> 
> Are you trying to use Lua scripting for serving up a dynamic
> configuration of some sort?
> -MC
> 
> 
> 
> _______________________________________________
> 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