[asterisk-bugs] [JIRA] (ASTERISK-27438) Custom variable at endpoint definition are duplicated

Richard Mudgett (JIRA) noreply at issues.asterisk.org
Thu Nov 23 13:10:07 CST 2017


     [ https://issues.asterisk.org/jira/browse/ASTERISK-27438?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Richard Mudgett updated ASTERISK-27438:
---------------------------------------

    Attachment: pjsip.conf.txt
                full.txt
                extensions.conf.txt

This is still not a bug.

The purpose of the endpoint {{set_var}} field is to set *channel variables* on channels created with that endpoint.  It does that.  It also sets the channel variables in the order you specify in the configuration in case there are any side effects depending upon order.  Setting the channel variables in order is important because those channel variable values can be the result of dialplan functions such as {{SHELL}} or {{EVAL}}.

What you are trying to do with {{set_var}} falls into undefined territory.  The fact that you can even get any {{set_var}} values using the dialplan function {{PJSIP_ENDPOINT}} is surprising as I was not expecting that to even work.

I have attached [^pjsip.conf.txt] and [^extensions.conf.txt] showing what you did and where the {{set_var}} values are expected to be available.  Originating a local channel to the 10, 11, 12, and 13 extensions in [^extensions.conf.txt] is shown in the [^full.txt] log file.  The log output shows that reading the {{followme}} channel variable on the PJSIP channels does work as intended.

I recently remembered there is another feature that seems to do what you apparently want.  This is expressed by my arbitrarily named field {{@fred}} in the attached [^pjsip.conf.txt] file and demonstrated in the [^full.txt] log output.  The field must be prefixed with the '@' symbol.

The feature is practically undocumented and only used by these three testsuite tests:
./tests/channels/pjsip/publish/presence_xpidf
./tests/channels/pjsip/publish/presence_pidf
./tests/channels/pjsip/publish/dialog_info_xml


> Custom variable at endpoint definition are duplicated
> -----------------------------------------------------
>
>                 Key: ASTERISK-27438
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27438
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip
>    Affects Versions: 15.1.2
>         Environment: GNU/Linux 3.10.0-693.5.2.el7.x86_64 #1 SMP
>            Reporter: Alexander Rozes
>            Severity: Minor
>              Labels: NewSIP
>         Attachments: extensions.conf.txt, full.txt, pjsip.conf.txt
>
>
> If you override a custom variable in pjsip.conf, it is duplicated instead of overriding the value.
> {noformat}
> ;================================ ENDPOINT TEMPLATES ==
> [phones-tpl](!)
> type = endpoint
> ...
> set_var=followme=0
> [auth-tpl](!)
> type = auth
> auth_type = userpass
> [aor-tpl](!)
> type = aor
> ...
> max_contacts = 1
> ;================================ ENDPOINT DEFINITIONS ==
> ;----- 101 -----
> [101](phones-tpl)
> aors = 101
> auth = 101
> callerid = 101 <101>
> [101](aor-tpl)
> [101](auth-tpl)
> username = 101
> password = fake_password
> ;----- 102 -----
> [102](phones-tpl)
> aors = 102
> auth = 102
> callerid = 102 <102>
> set_var=followme=1
> [102](aor-tpl)
> [102](auth-tpl)
> username = 102
> password = fake_password
> ...
> {noformat}
> That's what happens:
> {noformat}
> aster*CLI> pjsip show endpoint 101
> ...
> followme                           : 0
> ...
> {noformat}
> {noformat}
> aster*CLI> pjsip show endpoint 102
> ...
> followme                           : 0
> followme                           : 1
> ...
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list