Log SIP caller URI

I’d like to log the caller URI with a system echo in extensions.conf but the server keep giving me the error :

func_channel.c:596 func_channel_read: Unknown or unavailable item requested: ‘uri’

Here is the extensions.conf content :

[work] exten = _6XXX,1,Set(uri=${CHANNEL(uri)}) exten = _6XXX,n,System(echo "[${STRFTIME(${EPOCH},,%b %d %H:%M:%S)}] SECURITY[] Call from ${CALLERIDNUM} to ${EXTEN} IPdetails ${uri}" >> /var/log/asterisk/sipsecurity.log) exten = _6XXX,n,Dial(PJSIP/${EXTEN},20) exten = _6XXX,n,Hangup()

I know that ‘uri’ is provided in chan_sip but I don’t know how to include it.

Could you please give me which line to add/path to include ?