Syntax PJSIP_HEADER

Hi all! Who knows, how to add the following value to the Route Header: <sip:10.0.0.1;lr>
when i do that:
exten => addroute,1,Set(PJSIP_HEADER(add,Route)=<sip:10.0.0.1;lr>)

  • tells:
    WARNING[4141][C-0000000a]: pbx_variables.c:1142 pbx_builtin_setvar: Set requires an ‘=’ to be a valid assignment.

Firstly, you should not be trying to set headers that Asterisk manages using add header features. What are you really trying to do here? If you cannot do it by, for example, specifying a proxy, it is probably not safe to do it at all.

Whilst there are obvious syntax errors, because of the > and ) being commented out, I don’t really understand why you are getting a complaint about their being no equals, as Asterisk tends to and missing final )'s and the dialplan doesn’t no the valid syntax for the header value.

If this weren’t a core header, I’d suggest escaping the ; with a \ but, as it is a core header, I’d suggest trying to use it by built-in methods.

i use asterisk as a simulator for verification test scenarios. But stricts of syntax and without information of PJSIP_HEADER make this function useless.
thanks, with in-buld method i was able to add header:Route
(https://community.asterisk.org/t/route-header-pjsip/87005)
for Register: type = registration
for Invite:type = endpoint

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