${SIPUSERAGENT} is empty

${SIPUSERAGENT} is listed as one of the channel variables but if used in the dial plan it is empty. Is there a way to use the User Agent info as shown at the moment of registration in the dial plan?

${SIPUSERAGENT} * - SIP user agent is deprecated try ${SIP_HEADER(User-Agent)}

1 Like

It seems to work
NoOp(“SIP/5554-000112e9”, “The SIP user agent is: Zoiper rv2.8.10”)

Thanks a lot!

1 Like

Just one last User Agent related question. ${SIP_HEADER(User-Agent)} works when there is already an active sip channel. That is why it is a channel variable.

But I also want to know the name of the User Agent when a message is received from a User Agent, let’s say 5554 and for a sip-message there is not an active sip channel. Is there an easy way to get the user agent for use into the dial plan? Thanks in advance.

You need to be a bit more specific about what SIP request you are referring to.

If something executes within the dialplan, then there is generally a way to get at the headers in the underlying SIP request. For example, with a SIP MESSAGE request, you can use the MESSAGE_DATA function. With INVITE requests and a ‘standard’ SIP or PJSIP function, then you can use the respective header functions.

Things that don’t make it to the dialplan - such as a SIP REGISTER or a SIP SUBSCRIBE - do not expose a mechanism to programmatically retrieve or act on the headers within them.

Am I right that a Sip message (MessageSend() ) is channelless so there are no channel variables available although the processing is routed by the dial plan?

Close. The MessageSend AMI action is completely channelless. The dialplan application variant can only be invoked by a channel. However, the message that is sent and all of its properties are completely independent of the channel that invokes it. For example, you can even use a Local channel to trigger the MessageSend dialplan application and send a message to an XMPP endpoint.

1 Like