How do you get a pjsip endpoint ip address?

I am transferring my dialplan to the new pjsip channel driver and I cannot find the built in variable that will give me the ip address of the current endpoint.

I was using this variable before but it is not recognized anymore by asterisk when using PJSIP:


By the way, where can I find all the builtin variables available for a channel with PJSIP?


The IP address you want is of the contact associated with the AOR that’s associated with the endpoint.

So, use the PJSIP_AOR dial plan function, e.g.:


and you’ll get something like


Check out the PJSIP_ functions from: … +Functions


As well the CHANNEL specific arguments for PJSIP are documented at … on_CHANNEL

Thanx a lot! Here is a complete example working for me:

It is a bit more work than before it’s ok.

exten => *63,1,NoOp()
same => n,Verbose(${CHANNEL(endpoint)})
same => n,Set(IP=${PJSIP_AOR(${CHANNEL(endpoint)},contact)})
same => n,Set(IP=${CUT(IP,:,2)})
same => n,Set(IP=${CUT(IP,@,2)})
same => n,Verbose(My IP Is ${IP})
same => n,Hangup()