I think it will work but it isn’t valid for me at all
I need to define a context for each extension and change it after employee go out depending of running AGI
Example extension 1000 with context bill-dep
[1000]
type=friend
context=bill-dep
secret=secret
defaultuser=1000
canreinvite=no
nat=no
setvar=DEPEXT=1000
[bill-dep]
exten=>_X.,1,NoOP(–Call from Dep ${DEPEXT})
exten=>_X.,n,Set(CDR(userfield)=${DEPEXT})
exten=>_X.,n,AGI(/opt/custom/checkinout${DEPEXT}.php)
exten=>_X.,nGoto(${CONTEXT},${EXTEN},1)
exten=> _.,1,NoOP(–Call from Dep ${DEPEXT})
exten=> _.,n,Set(CDR(userfield)=${DEPEXT})
exten=> _.,n,AGI(/opt/custom/checkinout${DEPEXT}.php)
exten=> _.,n,Goto(${CONTEXT},${EXTEN},1)
( after _ there is and asterisk ( * ) and before a dot ( . ) )
[in]
include => local-calls
include => mobile
exten=> i,1,NoOP(–Non allowed call )
exten=> i,n,Playback(invalid)
exten=> i,n,Hangup()
[out]
include => emergency
exten=> i,1,NoOP(–Non allowed call )
exten=> i,n,Playback(invalid)
exten=> i,n,Hangup()
So when they make a call the context [in] or [out] will be send.
*AGIs will be generated by other application.
Thanks you.