Use a dialog profile. Use $fu as the key ("value"). Check if profile size is > 1, refuse the call.
That's what they're there for. Jayesh Nambiar wrote: > Hi, > I am looking at an option to limit more than one call per user even if > they are registered from multiple locations. > Basically if User A calls from location A and if the call is active, > User A registered from location B should not be allowed to make a call. > What I did was: > > 1) Create a dialog after every initial INVITE initiated by users > 2) Before creating the dialog, query the dialog table to check if $fu > has an entry in the dialog table using avp_db_query. > 3) If yes, means user A is already on a call so send a 403, Forbidden. > 4) Else, create the dialog and process call. > > Although this works, i just wonder if doing avp_db_query everytime to > check if the caller has a call active is an efficient way of doing it?? > Is it possible to store these dialog parameters in localcache using > memcache module or access the dialog parameters from memory and compare > it with the INVITE messages !!! > > Just trying to find a more efficient way of achieving this. > > Thanks for any inputs you might have !! > > --- Jay > > > ------------------------------------------------------------------------ > > _______________________________________________ > Users mailing list > Users@lists.opensips.org > http://lists.opensips.org/cgi-bin/mailman/listinfo/users -- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 _______________________________________________ Users mailing list Users@lists.opensips.org http://lists.opensips.org/cgi-bin/mailman/listinfo/users