]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config: Allow filters when appending to a category 87/2487/3
authorGeorge Joseph <george.joseph@fairview5.com>
Mon, 28 Mar 2016 04:33:29 +0000 (22:33 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 5 Apr 2016 16:23:50 +0000 (11:23 -0500)
commit50b0922a22ec4ab42dca4bbc89fa49c8e1f5dd23
treeb2d78d9814b90a60ab3489c830e0ae72cce3ed75
parentcac6453e9a9cbc8996769550f0de29d92a0aff56
config:  Allow filters when appending to a category

In sorcery based config files where there are multiple categories with the same
name, you can't use the (+) operator to reliably append to a category because
config.c stops looking when it finds the first one with the same name.

Example:

[1000]
type = endpoint

[1000]
type = aor

[1000](+)
authenticate_qualify = yes

This config will fail because config.c appends authenticate_qualify to the
first category it finds, the endpoint, and that's not valid for endpoint.

Solution:

The capability to find a category that contains a certain variable already
exists so the only real change was to parse anything after the '+' that's not a
comma, as a filter string.

[1000]
type = endpoint

[1000]
type = aor

[1000](+type=aor)
authenticate_qualify = yes

This now works as expected.

Although the following example doesn't make any sense for pjsip, you can even
specify multiple filters:

[1000](+type=aor&qualify_frequency=10)

ASTERISK-25868 #close
Reported-by: Nick Repin
Change-Id: I10773da4c79db36fbf1993961992af63d3441580
main/config.c