Callers CID on Pickup


I would like to know if the following scenario is possible:

  1. Call with CID 1234 rings on extension 100.
  2. Extension 101 invokes call pickup on extension 100, but before channels are connected, CID 1234 is sent via SIP message/announced to extension 101.
  3. Person at 101 then answers call/leaves it ringing.
    In dialplan this would be implemented as:

exten => _.,1,Answer()
exten => _
.,n,GetCallerCID(${EXTEN:2}) ; ideal app for this purpose :smile:
exten => _.,n,SendText(${CALLERCID}) ; channel var that is set by GetCallerCID is sent
exten => _
.,n,Wait(3) ; time for decision
exten => _**.,n,Pickup(${EXTEN:2})

First, I was thinking of using AMI, but then I have to track all ringing events and match them in an AGI script, which IMO is not very nice solution.
Basically, all that is needed is an application that returns state of a chosen extension with some basic information.

Is this possible?

Thanks, Ales