res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.
authorRichard Mudgett <rmudgett@digium.com>
Wed, 19 Feb 2014 18:29:12 +0000 (18:29 +0000)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 19 Feb 2014 18:29:12 +0000 (18:29 +0000)
commit61a4a98ed92d0a658e19226bee5e2f11435cb965
tree7f4e27590f148d0f11c9c04fa4b94427264516ae
parent98ace4b0c6e635143289801c2e6d2746d5e1d6c5
res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.

The sorcery astDB wizzard does not handle regex correctly if the pattern
begins with an anchor character.

This patch attempts to convert the anchored regex pattern to a prefix
pattern supported by astDB for performance reasons.  If it is not able to
convert the pattern it falls back to getting all astDB members of the
family and doing a normal regex pattern matching on the retrieved records.

Review: https://reviewboard.asterisk.org/r/3161/
........

Merged revisions 408385 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@408386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_sorcery_astdb.c