aboutsummaryrefslogtreecommitdiffstats
path: root/utils
AgeCommit message (Collapse)AuthorFilesLines
2007-11-16remove redundant #include "asterisk/compat.h",rizzo1-7/+1
but make sure that asterisk/compiler.h is included everywhere git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89336 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16Start untangling header inclusion in a way that does not affectrizzo3-23/+0
build times - tested, there is no measureable difference before and after this commit. In this change: use asterisk/compat.h to include a small set of system headers: inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h, stdlib.h, alloca.h, stdio.h Where available, the inclusion is conditional on HAVE_FOO_H as determined by autoconf. Normally, source files should not include any of the above system headers, and instead use either "asterisk.h" or "asterisk/compat.h" which does it better. For the time being I have left alone second-level directories (main/db1-ast, etc.). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12Don't forget the ASTERISK_VERSION for the sake of the mtx_prof stuff.murf1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89201 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12(closes issue #11221)kpfleming2-14/+2
Reported by: eliel Patches: utils.Makefile.patch uploaded by eliel (modified by me) (license 64) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89190 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-12Fix building on FreeBSD by including/not including some headers.file1-0/+2
(closes issue #11218) Reported by: ys Patches: trunk89169.diff uploaded by ys (license 281) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89177 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-09This is the perhaps the biggest, boldest, most daring change I've ever ↵murf2-3/+398
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: http://svn.digium.com/svn/asterisk/trunk@89129 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08improve linked-list macros in two ways:kpfleming1-2/+3
- the *_CURRENT macros no longer need the list head pointer argument - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-05Move AUDIO_LIBS outside the top level Makefile. This too is used onlyrizzo1-0/+4
in one place. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88770 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02Add pbx_lua as a method of doing extensionstilghman1-0/+81
Reported by: mnicholson Patch by: mnicholson Closes issue #11140 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88250 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01This commits the performance mods that give the priority processing engine ↵murf1-0/+4
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: http://svn.digium.com/svn/asterisk/trunk@88166 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01Remove another copied source file on "make clean".russell1-1/+1
(closes issue #11137) Reported by: IgorG Patches: addonclean-87971-1.patch uploaded by IgorG (license 20) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88062 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29UGH... while trying to fix #10995, I found all kinds of cruft in this ↵kpfleming2-39/+22
Makefile. It should all be gone now, and as a side effect hashtest2 now builds with --enable-dev-mode enabled without a host of errors git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87498 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-29clean up assembler and preprocessor files if they are here tookpfleming1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@87467 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-26Merged revisions 87168 via svnmerge from murf2-0/+23
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: http://svn.digium.com/svn/asterisk/trunk@87187 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17and then, I noticed the clicompat stuff.murf3-37/+10
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86182 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17more stub routines to allow linkage in stand-alone environment, with thread ↵murf1-0/+15
debugs turned on git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86181 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-17more stub routines to allow linkage in stand-alone environment, with thread ↵murf1-0/+16
debugs turned on git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86180 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-09Remove redundant includes (patch by snuffy) (Closes issue #10922)tilghman2-3/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85140 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-08Fix up tree so that it compiles when MTX Profiling is enabled.file3-0/+11
(closes issue #10898) Reported by: snuffy Patches: 10898-mtx_prof.diff uploaded by qwell (license 4) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85025 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01OK. THis a DEBUG_THREADS situation.murf1-1/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84331 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01picky gcc versions... sigh.murf1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84330 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01This mod will allow check_expr to compile in the presence of DEBUG_THREAD ↵murf1-0/+16
situations. At least, it does for me. And it's less expensive than several other approaches I tried. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@84329 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-25Add some files to the utils directory svn:ignore and Makefile clean targetrussell1-0/+1
(closes issue #10808, reported by mvanbaak) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83741 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-22Fix build of check_expr and hashtest2 when DEBUG_THREADLOCAL is definedtilghman3-11/+15
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83545 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21Merged revisions 83432 via svnmerge from russell1-5/+5
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2. (closes issue #10774, patch from qwell) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@83433 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12Change the traversal to use ao2_callback() instead of an ao2_iterator. Usingrussell1-5/+6
ao2_callback() is a much more efficient way of performing an operation on every item in the container. This change makes hashtest2 run in about 25% of the time it ran before on my system. In general, I would say that it makes the most sense to use an ao2_iterator if the operation being performed is going to take a long time and you don't want to keep the container locked while you work with each object. Otherwise, the use of ao2_callback is preferred. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82282 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11This solves an unreported solaris compile problem (missing -lnsl -lsocket).murf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82268 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11fixing up the pthread stuff for hashtest2murf1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82256 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Include string compatibility file in hashtest2.file1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82235 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Include compat.h to hopefully make it compatible with FreeBSD.file1-0/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82234 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-11Fix building under FreeBSD. Make sure alloca.h exists before including it.file1-0/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82233 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10Committing my test for astobj2, hashtest2.c, along with makefile changes in ↵murf2-1/+420
utils. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82140 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-29This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I ↵murf1-128/+414
didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81361 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24fix up the MODULEINFO in conf2ael.c as wellmurf1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80748 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24Merged revisions 80722 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80722 | russell | 2007-08-24 10:28:05 -0500 (Fri, 24 Aug 2007) | 3 lines Tweak the formatting of this MODULEINFO block. I think this would have caused a "*" to get in the menuselect-tree file. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80725 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24Merged revisions 80717 via svnmerge from murf2-1/+7
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r80717 | murf | 2007-08-24 08:48:49 -0600 (Fri, 24 Aug 2007) | 1 line This change addresses JerJer's complaint that aelparse builds and installs even if pbx_ael is unchecked in the menuselect stuff. ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80718 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22Ensure that the object code for ast_atomic_fetchadd_int() gets included in therussell1-0/+5
check_expr binary when building with LOW_MEMORY defined. (reported by Brian Capouch on the asterisk-dev list, patch by me) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80262 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20Stephn Davies reports that this will help make things work on 64-bit machinesmurf1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80075 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20pval.c should not be in svn, in the utils dirmurf1-5344/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80037 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20Bring pval.c in utils up to date with pval.c in res/ael.file1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80033 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20(closes issue #10496)file1-1/+1
Reported by: caio1982 Fix building on OSX. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79989 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-19Add strcompat dependency for check_expr (needed for platforms that don't ↵tilghman1-1/+1
have strndup) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79980 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Many thanks to mvanbaak for his update to translate hints; I added the -d ↵murf2-5/+32
option for local testing purposes. This is from bug 10472 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79736 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16mvanbaak asks: why did you include that twice? Answer: dunno. removed ↵murf1-1/+0
redundant include git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79719 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16svn did me dirty for some reason. Left 5 files out of the commit; Tilghman ↵murf2-31/+18
copied them in from the branch, but I had made changes to these. Here they are. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79714 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16Make conf2ael build on 64-bit systems.file1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79687 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-15Missing from murf's last trunk commit, which was why trunk won't compiletilghman3-0/+11951
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79623 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-15This commit closes bug 7605, and half-closes 7638. The AEL code has been ↵murf3-62/+128
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: http://svn.digium.com/svn/asterisk/trunk@79595 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-14Merged revisions 79255 via svnmerge from murf1-0/+11
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r79255 | murf | 2007-08-13 11:49:54 -0600 (Mon, 13 Aug 2007) | 1 line This patch fixes bug 10411. I added a new regression test, some regression test cleanups ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79392 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-07Add another big set of doxygen documentation improvements from snuffy.russell1-6/+16
(closes issue #9892) (closes issue #10395) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78541 f38db490-d61c-443f-a65b-d21fe96a405b