Dialplan with atomic instructions?

I have general Q how we can execute two line that must be atomic instruction?

for example:
I have Dialplan that limit the user in Conference by check MeetMeCount. So how I have guaranty that when I move the next line On DialPlan the
MeetMeCount is increase one?

you can run the command like
system (usr/sbin/asterisk -rx"meetme list name") then search the numbers here… it will give you exact numbers in conference…

first I need to do that from dialplan.
second continue my q, after I got the answer, the state can be change, so I cannot ensure that my ristrickt is work. i need to ensure that sombody else not join another channel between the check and apply.

think about that, I assume that user make join to confrrance only from my dialplan, say 8888. so I check first if MeetMeCount(conference[,variablename])
return number that reach to the limit. now I call to to:

but who is gurentee that between the two line, another thread execute the 8888 and add another Meetme?

I can use with MacroExclusive(macroname[,arg1[,arg2[,…]]])
but is lock all conferance while I want to lock only specific conforance.

so have solution for that?

Upgrading to 1.6 would solve your problem…

66 * Added LOCK(), TRYLOCK(), and UNLOCK(), which provide a single level dialplan
67 mutex. No deadlocks are possible, as LOCK() only allows a single lock to be
68 held for any given channel. Also, locks are automatically freed when a
69 channel is hung up.

the problem is that I can’t move to 1.6 for some reasons.

also about 1.6:

I not find the full doc for this. I only find this(on Upgrade 1.6):

Just another thought… why don’t you launch an AGI script which could do the locking.

I use FastAGI and the asterisk-java package for all my systems. This allows me to share variables and objects between channels… because every channel is executing its “Script” inside the same JVM.

that being said, it would be very easy for me to write some code which would lock on a per conference number basis.