[Asterisk-code-review] func_lookup: Fork of HINT function (asterisk[master])

Joshua Colp asteriskteam at digium.com
Mon Jul 19 17:35:11 CDT 2021


Attention is currently required from: N A.
Joshua Colp has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16075 )

Change subject: func_lookup: Fork of HINT function
......................................................................


Patch Set 4:

(1 comment)

Patchset:

PS4: 
> If the -2 was something else, like -666, would that make any difference? Or if there was no impact o […]
No, the priority number itself doesn't matter. As we've already discussed, I understand the reason you've implemented this the way it is - you're leveraging the dialplan because it is easy to do to get pattern matching quickly with minimal changes and effort. That doesn't change my disagreement with the fact you're leveraging the dialplan like you are. If this was pattern matched in its own configuration file out of the core and didn't use a different priority, then that would be fine.

I still believe you don't even need to build a trie/tables/context/etc or stick it in the dialplan. ast_extension_match tells you if an extension matches a pattern, and ast_extension_cmp I believe can tell you if a pattern more closely matches or not. You can iterate through the configured patterns finding the closest match, and then once done evaluate out the value. You could even stick explicit matches in a hash table for better lookups of those and prefer them. Unless you had an absurb number of things then it should still be fairly efficient.



-- 
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16075
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Change-Id: Iad81019689674c9f4ac77d235f5d7234adbb1432
Gerrit-Change-Number: 16075
Gerrit-PatchSet: 4
Gerrit-Owner: N A <mail at interlinked.x10host.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Joshua Colp <jcolp at sangoma.com>
Gerrit-Reviewer: Sarah Autumn <sarah at endlesstemple.org>
Gerrit-Attention: N A <mail at interlinked.x10host.com>
Gerrit-Comment-Date: Mon, 19 Jul 2021 22:35:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: N A <mail at interlinked.x10host.com>
Comment-In-Reply-To: Joshua Colp <jcolp at sangoma.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210719/6c476f94/attachment.html>


More information about the asterisk-code-review mailing list