summaryrefslogtreecommitdiff
path: root/res/ael
AgeCommit message (Collapse)Author
2007-11-09This is the perhaps the biggest, boldest, most daring change I've ever ↵Steve Murphy
committed to trunk. Forgive me in advance any disruption this may cause, and please, report any problems via the bugtracker. The upside is that this can speed up large dialplans by 20 times (or more). Context, extension, and priority matching are all fairly constant-time searches. I introduce here my hashtables (hashtabs), and a regression for them. I would have used the ast_obj2 tables, but mine are resizeable, and don't need the object destruction capability. The hashtab stuff is well tested and stable. I introduce a data structure, a trie, for extension pattern matching, in which knowledge of all patterns is accumulated, and all matches can be found via a single traversal of the tree. This is per-context. The trie is formed on the first lookup attempt, and stored in the context for future lookups. Destruction routines are in place for hashtabs and the pattern match trie. You can see the contents of the pattern match trie by using the 'dialplan show' cli command when 'core set debug' has been done to put it in debug mode. The pattern tree traversal only traverses those parts of the tree that are interesting. It uses a scoreboard sort of approach to find the best match. The speed of the traversal is more a function of the length of the pattern than the number of patterns in the tree. The tree also contains the CID matching patterns. See the source code comments for details on how everything works. I believe the approach general enough that any issues that might come up involving fine points in the pattern matching algorithm, can be solved by just tweaking things. We shall see. The current pattern matcher is fairly involved, and replicating every nuance of it is difficult. If you find and report problems, I will try to resolve than as quickly as I can. The trie and hashtabs are added to the existing context and exten structs, and none of the old machinery has been removed for the sake of the multitude of functions that use them. In the future, we can (maybe) weed out the linked lists and save some space. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01This commits the performance mods that give the priority processing engine ↵Steve Murphy
in the pbx, a 25-30% speed boost. The two updates used, are, first, to merge the ast_exists_extension() and the ast_spawn_extension() where they are called sequentially in a loop in the code, into a slightly upgraded version of ast_spawn_extension(), with a few extra args; and, second, I modified the substitute_variables_helper_full, so it zeroes out the byte after the evaluated string instead of demanding you pre-zero the buffer; I also went thru the code and removed the code that zeroed this buffer before every call to the substitute_variables_helper_full. The first fix provides about a 9% speedup, and the second the rest. These figures come from the 'PIPS' benchmark I describe in blogs, conf. reports, etc. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-31Merged revisions 87775 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87775 | murf | 2007-10-30 21:51:52 -0600 (Tue, 30 Oct 2007) | 1 line Included some verbage in the check_includes func, to inform the user that included contexts that have no match in the AEL, might be OK, as AEL cannot check in the extensions.conf or the in-memory contexts, as they may not be there at the time of the check. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87776 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-26Merged revisions 87168 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config, ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24closes issue #11005, where #include uses the current dir instead of the ↵Steve Murphy
config dir (/etc/asterisk) for relative path includes for AEL git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86967 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-24Merged revisions 86936 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r86936 | murf | 2007-10-23 22:14:28 -0600 (Tue, 23 Oct 2007) | 1 line closes issue #11037 -- unable to specify app:spec in hint arguments ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-03Merged revisions 84511 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84511 | murf | 2007-10-03 08:23:00 -0600 (Wed, 03 Oct 2007) | 1 line closes issue #10834 ; where a null input to a switch statement results in a hangup; since switch is implemented with extensions, and the default case is implemented with a '.', and the '.' matches 1 or more remaining characters, the case where 0 characters exist isn't matched, and the extension isn't matched, and the goto fails, and a hangup occurs. Now, when a default case is generated, it also generates a single fixed extension that will match a null input. That extension just does a goto to the default extension for that switch. I played with an alternate solution, where I just tack an extra char onto all the patterns and the goto, but not the default case's pattern. Then even a null input will still have at least one char in it. But it made me nervous, having that extra char in , even if that's a pretty secret and low-level issue. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01Merged revisions 84239 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84239 | murf | 2007-10-01 14:27:52 -0600 (Mon, 01 Oct 2007) | 1 line closes issue #10777 -- by returning a null for the parse tree when there's really nothing there, and making sure we don't try to do checking on a null tree. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-29Merged revisions 84133 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r84133 | murf | 2007-09-29 15:47:53 -0600 (Sat, 29 Sep 2007) | 1 line This issue sort of closes 10786; All config files support #include with globbing (you know, *,[chars],?,{list,list},etc), so I've updated the AEL system to support this also. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84137 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-27deal with more gcc 4.2 const pointer warningsKevin P. Fleming
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83978 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-25Fix minor memory leak in pval.c. Overwriting a value without freeing the ↵Joshua Colp
previous result is bad, mmmk? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22Merged revisions 83589 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83589 | murf | 2007-09-22 13:39:16 -0600 (Sat, 22 Sep 2007) | 1 line This closes issue #10788 -- The exact same fixes are made here for the first arg in the for(arg1; arg2; arg3) {} statement, as were done for the 3rd arg. It can now be an assignment that will embedded in a Set() app, or a macro call, or an app call. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83590 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-22Merged revisions 83558 via svnmerge from Steve Murphy
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83558 | murf | 2007-09-22 10:41:43 -0600 (Sat, 22 Sep 2007) | 1 line This closes issue #10788 -- the 3rd arg in the for statement is now wrapped in Set() only if there's an '=' in that string. Otherwise, if it begins with '&', then a Macro call is generated; otherwise it is made into an app call. A bit more accomodating, keeps the new guys happy, and the guys with ael-1 code should be happy, too ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83575 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17Make the MALLOC_DEBUG output for free() useful again. After changing calls toRussell Bryant
free to be ast_free, astmm said all calls to free were coming from utils.h git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23an unreported crash I debugged, looked like it was backing up way too far ↵Steve Murphy
after hitting the syntax error. An inspection of the code revealed that error tokens in lists were not rearranged when the rules were rearranged as part of a code neatening-up process. By moving the error tokens to where they should be, I also reduced the number of shift/reduce conflicts to 3 instead of 8. This introduces subtle differences in error messages, so the regressions had to be updated. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80649 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21As per 10472, mvanbaak thought the generated code would look better this way.Steve Murphy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80217 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-15This commit closes bug 7605, and half-closes 7638. The AEL code has been ↵Steve Murphy
redistributed/repartitioned to allow code re-use both inside and outside of Asterisk. This commit introduces the utils/conf2ael program, and an external config-file reader, for both normal config files, and for extensions.conf (context, exten, prio); It provides an API for programs outside of asterisk to use to play with the dialplan and config files. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79595 65c4cc65-6c06-0410-ace0-fbb531ad65f3