LOCK(lockname)
Attempts to grab a named lock exclusively, and prevents other channels from obtaining the same lock. LOCK will wait for the lock to become available. Returns 1 if the lock was obtained or 0 on error.
Note
To avoid the possibility of a deadlock, LOCK will only attempt to obtain the lock for 3 seconds if the channelA single call leg passing through Asterisk. Channels represent connections to endpoints and are what dialplan applications act on. already has another lock.
Note
If live_dangerously in asterisk.conf is set to no, this function can only be executed from the dialplanThe core call-routing configuration of Asterisk, written mostly in extensions.conf as contexts, extensions, and priorities that decide how every call is handled. Full definition →, and not directly from external protocols.
locknamerequired
User Notes
Know a tip or gotcha for this topic? Share it below and help others.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.