]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_sorcery_realtime: Fix regex regression. 50/2150/1
authorMark Michelson <mmichelson@digium.com>
Tue, 2 Feb 2016 16:52:29 +0000 (10:52 -0600)
committerMark Michelson <mmichelson@digium.com>
Tue, 2 Feb 2016 16:52:29 +0000 (10:52 -0600)
commit32fc784284b570a05841d95c6d9a373b4bf3a35d
tree0fd7a2d9fa51edf0ecd7d6d09ec185bdfbfbe4a8
parentf6551868be4443da8ecf81d91b9407a834db281d
res_sorcery_realtime: Fix regex regression.

A regression was introduced where searching for realtime PJSIP objects
by regex by starting the regex with a leading "^" would cause no items
to be returned.

This was due to a change which attempted to drop the requirement for a
leading "^" to be present due to how some CLI commands formulate their
regexes. However, the change, rather than simply eliminating the
requirement, caused any regexes that did begin with "^" to end up not
returning the expected results.

This change fixes the problem by inspecting the regex and formulating
the realtime query differently depending on if it begins with "^".

ASTERISK-25702 #close
Reported by Nic Colledge

Patches:
    realtime_retrieve_regex.patch submitted by Alexei Gradinari License #5691

Change-Id: I055df608a6e6a10732044fa737a9fe8dca602693
res/res_sorcery_realtime.c