Can't get PJSIP_CONTACT function to work

Trying to get the status of an endpoint using pjsip, but so far not having any luck.

If I use 'pjsip show contact ’ it returns ‘Status’ and ‘RTT(ms)’

From what I understand PJSIP_CONTACT function should be able to return this data, however I am not able to find any ‘objects’ to work for me, or found any relevant examples online anywhere.

NoOp(Test: ${PJSIP_CONTACT(trunk/sip:,status)}) doesn’t work
NoOp(Test: ${PJSIP_CONTACT(trunk/sip:,user_agent)}) saw this example somewhere, doesn’t work
NoOp(Test: ${PJSIP_CONTACT(trunk/sip:,rtt)}) doesn’t work

pjsip show contact trunk/sip: returns:
Contact: trunk/sip: 88c424b1fa Avail 4.30

Any suggestions or alternate function to get this information would be helpful.

Thanks in advance.

The identifier you are using in the CLI is not the identifier that can be used to query for it using the PJSIP_CONTACT dialplan function. It used to be, but some Contact URIs are quite large. You can use the PJSIP_AOR dialplan function to get the actual value. We should be able to allow both though so please file an issue on the issue tracker[1] for it.


1 Like

Thank you for the clarification, I was able to get what I needed using this workaround:


I will file an issue as you requested. Thanks!

1 Like