[asterisk-dev] [Code Review] 3161: res_sorcery_astdb.c: Fix regex handling and keep simple prefix matching performance.

rmudgett reviewboard at asterisk.org
Mon Feb 17 19:18:18 CST 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3161/
-----------------------------------------------------------

(Updated Feb. 17, 2014, 7:18 p.m.)


Review request for Asterisk Developers.


Changes
-------

Address walters comments.


Repository: Asterisk


Description
-------

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 gets all astDB members of the family and then does a normal regex pattern matching on the resulting records retrieved.


Diffs (updated)
-----

  /trunk/res/res_sorcery_astdb.c 408290 

Diff: https://reviewboard.asterisk.org/r/3161/diff/


Testing
-------

Simple regex patterns that are just prefixes are converted and the astDB just fetches the matching records.  More complex patterns fallback to getting all astDB family records and searching them by regex.


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140218/0fa9d708/attachment.html>


More information about the asterisk-dev mailing list