[Freeswitch-users] lua startup scripts (possibly!)

Pete Kelly pkelly at gmail.com
Wed Sep 1 12:19:29 PDT 2010


Hi

I am new to freeswitch, so please excuse me if I have some terminology
slightly wrong! I am writing an IVR application using mod_lua, to do simple
auth then enter a menu tree etc.

I need to "preprocess" the incoming SIP INVITE by running a series of
regular expressions (which are stored in a mysql database) against the
request URI (and/or From header),   to add an extra header to the INVITE for
internal use.

I only want to read in the regular expressions from the database at
"startup" (or by a controlled reload), as the query to get them is quite
heavy and the IVR will be handling upwards of 100 concurrent calls - so to
query for the regex list on each INVITE is impractical.

Is this startup scenario possible? Two options that I think I might have
are:

1) Have a lua startup script which reads the regex list in at startup, and
listens for incoming call events. I would then apply the header within the
lua script before the dialplan extension is looked up. Does anyone have any
examples, or know of any documentation which shows something similar to this
happening. I have searched the wiki high and low but can only find very
basic documentation on event handling in lua, and startup scripts in lua.

2) Have the regular expressions stored somewhere within the dialplan (global
variables?) and make it part of a dialplan extension to add this header.


Any advice or tips anybody could give me will be very helpful.

Thanks

Pete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100901/cf11910e/attachment-0001.html 


More information about the FreeSWITCH-users mailing list