Get contact data for current user

I want to get contact value for current user in dial plan. I want get this for every user that income to dialplan
User2/sip:fr1crvcm@23.19.74.164:47664;transport=ws

One idea:
You can get the info from the SIP Contact header by using the PJSIP_HEADER function. Something like this in your dialplan, for example:

...
same => n,Set(XYZ=${PJSIP_HEADER(read,Contact)})

Then the ${XYZ} variable would become sip:fr1crvcm@23.19.74.164:47664 as passed in the Contact header. This does not get you the “User2” portion but I imagine you could gather that some other way if needed.

when I call to dial plan this is and that is work
Verbose("PJSIP/User2-0000001c", "<sip:p3ngb3lu@23.19.74.164:47664;transport=ws;ob>") in new stack
but in my case I want get contact when dial plan recieve message and that not work
res_pjsip_header_funcs.c:622 func_read_header: This function requires a PJSIP channel.

otherwise when ${CHANNEL(name)}=Message/ast_msg_queue above error displayed and not work.

Ah, OK. Yes, there is no Contact header in the MESSAGE method, and besides, PJSIP_HEADER does does not work since it is not a PJSIP channel…

You can get most of this info from the existing ${MESSAGE(from)} variable, however, maybe not the port and transport info that you would get from an INVITE Contact header.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.