[Freeswitch-users] Newbie question: Executing Lua scripts for incoming calls, how concurrency is to be handled?

William King william.king at quentustech.com
Mon Dec 17 02:46:54 MSK 2012


Sounds like you want to take a look into mod_fifo.

William King
Senior Engineer
Quentus Technologies, INC
1037 NE 65th St Suite 273
Seattle, WA 98115
Main:   (877) 211-9337
Office: (206) 388-4772
Cell:   (253) 686-5518
william.king at quentustech.com

On 12/16/2012 03:31 PM, Sirish Masur Mohan wrote:
> Hello All,
> 
>  
> 
> I am a newbie to FreeSWITCH, please excuse if this question has already
> been answered.
> 
>  
> 
> My requirement is as follows:
> 
> ·         When an incoming call is received, it needs to be bridged to
> one of the 4 available destination lines
> 
> ·         Minimal management of these lines is required: need to keep
> track of when each line was used, so that, when a new incoming call is
> received, I can use the oldest used available line to bridge the call to
> 
>  
> 
> In order to achieve this, I have:
> 
> ·         Defined a few global variables in vars.xml, which would keep
> track of each line’s status (available/busy) and last used timestamp
> 
> ·         Implemented a Lua script which ‘chooses’ the line based on
> global variables status and timestamp (using "global_getvar") and update
> the status of the line to be used (using "global_setvar")
> 
> ·         Bridge to the line returned by the script
> 
> ·         Execute another Lua script on hang-up, which updates the
> global variables
> 
>  
> 
> I am now wondering if I would run into issues in cases where I receive
> concurrent calls (I am using a Sangoma E1 card, and will receive
> multiple concurrent calls soon)? Would I need to be applying some kind
> of explicit mutex protection in these scripts for the global variables?  
> 
>  
> 
> Thanks in advance!
> 
>  
> 
> With regards,
> 
> Sirish
> 
>  
> 
> 
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> 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



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list