where XXXX is the instance ID, which you would need to get from newchan events. Tracking newstate events, with suitable hints in the dialplan, might be easier, but I’m not going to work out the details of that as free consultancy. newchan events probably include the unique ID, anyway.
This assume that you want the owner side of the local channel. If you want the PBX side, you will need to use ;2.