[asterisk-dev] [Code Review] Pattern matching with the '-' char.

rmudgett reviewboard at asterisk.org
Wed Nov 21 15:09:44 CST 2012


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

(Updated Nov. 21, 2012, 3:09 p.m.)


Review request for Asterisk Developers.


Changes
-------

Fix character set sorting if the sets have the same number of characters and start with the same character.
All evidence shows that it was intended for [0-9] to sort before [02-9a] and not the other way around.


Summary
-------

The '-' char is supposed to be ignored by the dialplan pattern matching.  Unfortunately, it's treatment is not handled consistently throughout the extension matching code.

* Made the old exten matching code consistently ignore '-' chars.

* Made the old exten matching code consistently handle case in the matching.

* Made ignore empty character sets.

* Fixed ast_extension_cmp() to return -1, 0, or 1 as documented.  The only user of it in pbx_lua.c was testing for -1.  It was originally returning the strcmp() value for less than which is not always going to be -1.


This addresses bug ASTERISK-19205.
    https://issues.asterisk.org/jira/browse/ASTERISK-19205


Diffs (updated)
-----

  /branches/1.8/main/pbx.c 376583 

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


Testing
-------

The failing patterns in ASTERISK-19205 now pass except for the invalid test of goto(foo-,1) for exten "_foo.".


Thanks,

rmudgett

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20121121/c61ef684/attachment.htm>


More information about the asterisk-dev mailing list