For an inbound channel, you can simply use the CALLERID function as you did previously. As an example:
[from-dcs]
exten => _X.,1,NoOp()
same => n,Log(NOTICE, My CallerID is: ${CALLERID(all)})
same => n,Answer()
same => n,Echo()
And on the CLI:
-- Executing [256xxxxxxx@from-dcs:1] NoOp("PJSIP/mjordan-00000838", "") in new stack
-- Executing [256xxxxxxx@from-dcs:2] Log("PJSIP/mjordan-00000838", "NOTICE, My CallerID is: "" <mjordan>") in new stack
[Jul 20 09:45:32] NOTICE[28806][C-00000b60]: Ext. 2566986741:2 @ from-dcs: My CallerID is: "" <mjordan>
-- Executing [256xxxxxxx@from-dcs:3] Answer("PJSIP/mjordan-00000838", "") in new stack
Note that the From user for the inbound call was simply my name in this case, hence why there is no DID number associated with the Caller ID.