I have a couple contexts as described below. A channel is passed into the call-park context during extension routing when it is determined the extensions is 700-799. This is a 1.8 setup.
[call-park]
include => parkedcalls
exten => _700, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
exten => _700, n, Set(VOIP_AddParkedCall(701,141)=) ; 701 hardcoded because I can't determine where the call is getting parked!
exten => _700, n, Park(45000,call-park-timeout,1,1,r,)
exten => _700, n, Hangup()
exten => _7XX, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
exten => _7XX, n, Set(verified=${VOIP_VerifyParkedCall(${EXTEN},${HASH(account,id)})})
exten => _7XX, n, GotoIf($["${verified}" != "1"]?NOT_VERIFIED)
exten => _7XX, n, Set(VOIP_DeleteParkedCall(${EXTEN})=)
exten => _7XX, n, ParkedCall(${EXTEN},)
exten => _7XX, n, Hangup()
exten => _7XX, n(NOT_VERIFIED), Playback(sorry)
exten => _7XX, n, Playback(the-number-dialed)
exten => _7XX, n, Playback(is-curntly-unavail)
exten => _7XX, n, Hangup()
[call-park-timeout]
exten => s, 1, NoOp(=-=-=- ${EXTEN}@${CONTEXT} -=-=-=)
exten => s, n, Set(VOIP_DeleteParkedCall(701)=) ;701 is hardcoded because I couldn't determine where the call was parked!
exten => s, n, Hangup()
VOIP_Add/DeleteParkedCall, VOIP_VerifyParkedCall are func_odbc methods that add/remove values from a table that associated a parked extension with an account ID, which will permit me to enforce security and forbid cross-account unparking. The only problem is that I cannot seem to get the value of the parking spot that Park() has just placed a call in. Hence me hardcoding 701.
Is there some channel variable that Park() emits like ${PARKED_SPOT} or something so I know where the call was parked? Thanks.