PJSIP CHANNEL(peername) equivalent

I am switching AST 16 from 13. I use Set(peer=${CHANNEL(peername)}) to get the peer that dialed the channel. I am trying to look through the Function_PJSIP_ENDPOINT to see if there is an equivalent.

Would anyone know how I can get the peer name in pjsip.

Thank you.

Such information is documented on the wiki[1]. In this case it would be the “endpoint” argument.

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Function_CHANNEL

Set(peer=${CHANNEL(endpoint)}) works fine. Thanks