]> git.ipfire.org Git - thirdparty/asterisk.git/commit
sorcery: Make is_object_field_registered handle field names that are regexes.
authorGeorge Joseph <george.joseph@fairview5.com>
Fri, 21 Nov 2014 17:45:13 +0000 (17:45 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Fri, 21 Nov 2014 17:45:13 +0000 (17:45 +0000)
commit2846d2368804d9cb593d835847735623b32658dd
treecf9b9772e59217f0fca1510edaf33264529e1d07
parent4f26a7ea36368ba2d91e72fc7d50b9f7369fad18
sorcery: Make is_object_field_registered handle field names that are regexes.

As a result of https://reviewboard.asterisk.org/r/3305, res_sorcery_realtime
was tossing database fields that didn't have an exact match to a sorcery
registered field.  This broke the ability to use regexes as field names which
manifested itself as a failure of res_pjsip_phoneprov_provider which uses
this capability.  It also broke handling of fields that start with '@' in
realtime but I don't think anyone noticed.

This patch does the following...
* Modifies ast_sorcery_fields_register to pre-compile the name regex.
* Modifies ast_sorcery_is_object_field_registered to test the regex if it
  exists instead of doing an exact strcmp.
* Modifies res_pjsip_phoneprov_provider with a few tweaks to get it to work
  with realtime.

Tested-by: George Joseph
Review: https://reviewboard.asterisk.org/r/4185/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@428544 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/sorcery.c
res/res_pjsip_phoneprov_provider.c
tests/test_sorcery.c