How to use lock/unlock in dialplan asterisk 13?

Please explain me how to use lock/unlock in asterisk dialplan (extension.conf)?
Proof-link function LOCK/UNCLOCK:
Example of using: Function LOCK and UNLOCK

What is “lock/unlock”? What do you mean by that?

I have a dialplan.
I want to lock some calls, where exists a call a agi script and unlock their after leave section.


exten => _X!,2,Set(CALLERID(ANI-all)=${HIDDENNUMB})
exten => _X!,3,Set(CHANNUM=${CHANNEL(dahdi_channel)})
exten => _X!,4,LOCK(mtx)
exten => _X!,5,AGI(
exten => _X!,6,UNLOCK(mtx)
exten => _X!,7,Dial(DAHDI/$[${CHANNUM}]/${EXTEN},60)

But in runtime when ran command, asterisk wrote me:

CLI> pbx_extension_helper: No application ‘LOCK’ for extension

BTW module is loaded.

> CLI> module show like lock  Dialplan mutexes Running core
1 module loaded

What I did wrong?

never used it, but if it’s a function, it should be something like
exten => _X!,n,Set(MyVar=${LOCK(mtx)})

You are using the syntax for an application
core show function LOCK
should work also