PICKUPMARK variable inaccessible for Pickup commands

I have a context, incoming-call, that every incoming call goes through. Partway through the context the value of PICKUPMARK is set so someone else can do a directed pick up. However, when another user on a different phone tries to do an actual directed pick up (by using the **number code) it fails. I can see the special-codes context get hit from the CLI, but the NoOp output indicates that PICKUPMARK is blank.

[incoming-call]
  ; dialplan code
  exten => s, n, Set(__PICKUPMARK=${HASH(phone,sip_user)}.${HASH(account,domain)}) ; from the CLI I can see this line execute
  ; more dialplan code
[special-codes]
   exten => _**., 1, Pickup(${EXTEN:2}.${SIPDOMAIN}@${PICKUPMARK})
   exten => _**., n, NoOp(Value of PickUpMark: ${PICKUPMARK}) ;this is always a blank string
   exten => _**., n, Congestion()
   exten => _**., n, Hangup()

How can I get the value of PICKUPMARK to actually save?

Is the prepending of two underscores to the PICKUPMARK variable name in the Set() call correct? If I remember correctly anything with “__” at the beginning should be inherited indefinitely by all channels spawned off the main channel.

Is this not correct? Thanks in advance for any info.

If someone else, at a different phone, is trying to do the pickup, in what way is their call’s channel spawned from the one that set it?

Looking at voip-info.org/wiki/view/Asterisk+cmd+Pickup PICKUPMARK should be a literal, not a variable reference.

[quote=“david55”]If someone else, at a different phone, is trying to do the pickup, in what way is their call’s channel spawned from the one that set it?

Looking at voip-info.org/wiki/view/Asterisk+cmd+Pickup PICKUPMARK should be a literal, not a variable reference.[/quote]

I had tried it as a literal before as well, only to get “No target channel found for …” notes in the CLI.

The page you linked me to was actually the exact page that I originally found that said to do Set(__PICKUPMARK=${EXTEN}). Since I’m doing this incorrectly (and the page’s example isn’t accurate), how should one set PICKUPMARK? Thanks in advance.

You have provided no evidence that ${PICKUPMARK} is unset on the channel on which you attempted to set it.