aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk.h
AgeCommit message (Collapse)AuthorFilesLines
2009-08-21Permit DEBUG_FD_LEAKS to be used with C++ source files.tilghman1-0/+6
(closes issue #15698) Reported by: slavon Patches: 20090817__issue15698.diff.txt uploaded by tilghman (license 14) Tested by: slavon, tilghman git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@213559 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04Safely handle AMI connections/reload requests that occur during startup.seanbright1-0/+12
During asterisk startup, a lock on the list of modules is obtained by the primary thread while each module is initialized. Issue 13778 pointed out a problem with this approach, however. Because the AMI is loaded before other modules, it is possible for a module reload to be issued by a connected client (via Action: Command), causing a deadlock. The resolution for 13778 was to move initialization of the manager to happen after the other modules had already been lodaded. While this fixed this particular issue, it caused a problem for users (like FreePBX) who call AMI scripts via an #exec in a configuration file (See issue 15189). The solution I have come up with is to defer any reload requests that come in until after the server is fully booted. When a call comes in to ast_module_reload (from wherever) before we are fully booted, the request is added to a queue of pending requests. Once we are done booting up, we then execute these deferred requests in turn. Note that I have tried to make this a bit more intelligent in that it will not queue up more than 1 request for the same module to be reloaded, and if a general reload request comes in ('module reload') the queue is flushed and we only issue a single deferred reload for the entire system. As for how this will impact existing installations - Before 13778, a reload issued before module initialization was completed would result in a deadlock. After 13778, you simply couldn't connect to the manager during startup (which causes problems with #exec-that-calls-AMI configuration files). I believe this is a good general purpose solution that won't negatively impact existing installations. (closes issue #15189) (closes issue #13778) Reported by: p_lindheimer Patches: 06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71) Tested by: p_lindheimer, seanbright Review: https://reviewboard.asterisk.org/r/272/ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@199022 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09Add debugging mode for diagnosing file descriptor leaks.tilghman1-0/+29
(Related to issue #14625) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@187300 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27fix some minor issues with rev 144924kpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@144925 f38db490-d61c-443f-a65b-d21fe96a405b
2008-09-27improve header inclusion process in a few small ways:kpfleming1-7/+4
- it is no longer necessary to forcibly include asterisk/autoconfig.h; every module already includes asterisk.h as its first header (even before system headers), which serves the same purpose - astmm.h is now included by asterisk.h when needed, instead of being forced by the Makefile; this means external modules will build properly against installed headers with MALLOC_DEBUG enabled - simplify the usage of some of these headers in the AEL-related stuff in the utils directory git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@144924 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-03Merge in some changes from team/russell/autoservice-nochans-1.4russell1-0/+1
These changes fix up some dubious code that I came across while auditing what happens in the autoservice thread when there are no channels currently in autoservice. 1) Change it so that autoservice thread doesn't keep looping around calling ast_waitfor_n() on 0 channels twice a second. Instead, use a thread condition so that the thread properly goes to sleep and does not wake up until a channel is put into autoservice. This actually fixes an interesting bug, as well. If the autoservice thread is already running (almost always is the case), then when the thread goes from having 0 channels to have 1 channel to autoservice, that channel would have to wait for up to 1/2 of a second to have the first frame read from it. 2) Fix up the code in ast_waitfor_nandfds() for when it gets called with no channels and no fds to poll() on, such as was the case with the previous code for the autoservice thread. In this case, the code would call alloca(0), and pass the result as the first argument to poll(). In this case, the 2nd argument to poll() specified that there were no fds, so this invalid pointer shouldn't actually get dereferenced, but, this code makes it explicit and ensures the pointers are NULL unless we have valid data to put there. (related to issue #12116) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@105563 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-13Only compile in tracking astobj2 statistics if dev-mode is enabled. Also, whenrussell1-0/+1
dev mode is enabled, register the CLI command that can be used to run the astobj2 test and print out statistics. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@82337 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-09Merged revisions 60849 via svnmerge from tilghman1-0/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r60849 | tilghman | 2007-04-08 21:49:06 -0500 (Sun, 08 Apr 2007) | 2 lines Don't check for error when lowering priority (according to the manpage, it should never happen anyway). It might could happen, though, if another thread messed with the priority, so safeguard against that (reported via -dev list). ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@60850 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-04add support for tracking thread-local-storage objects that exist via ↵kpfleming1-0/+1
'threadstorage' CLI commands git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@49553 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-16since we really, really have to have autoconfig.h included before all other ↵kpfleming1-0/+7
headers (especially system headers), the Makefile will now force it to happen (this will fix build problems with files like ast_expr2f.c, where we can't control the inclusion order in the file itself) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@48521 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-04make LOW_MEMORY builds actually workkpfleming1-25/+29
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44390 f38db490-d61c-443f-a65b-d21fe96a405b
2006-10-04ensure that local include files are always usedkpfleming1-1/+1
avoid a duplicate function name (term_init()) git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44322 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-22add a new include file for out-of-tree modules that need to know where ↵kpfleming1-1/+1
things are located git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40853 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21restore 'preload' functionality in loaderkpfleming1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40796 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-1/+7
- restructured build tree and makefiles to eliminate recursion problems - support for embedded modules - support for static builds - simpler cross-compilation support - simpler module/loader interface (no exported symbols) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40722 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09there is no reason to define our own 'maximum path length' when the POSIX ↵kpfleming1-20/+20
headers already define one for us git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33351 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-09Move a couple semicolons to a more traditional location. Was pointed out by ↵jcollie1-2/+2
Steven <critch@basesys.com> on the -dev list. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@33152 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-08Doxygen formattingoej1-25/+15
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32971 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07move autoconfig.h to the include/asterisk directory so it will get installedkpfleming1-1/+1
install asterisk.h include the system's default include directory git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32860 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-0/+2
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-24Thanks to the fine work of Russell Bryant and Dancho Lazarov, we now have ↵kpfleming1-3/+3
autoconf and menuselect tools for Asterisk! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@22267 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-15We are shaking up trunk tonight! allow data dir to be specified (issue #6967 ↵file1-0/+1
reported by tzafrir) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20330 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-14This rather large commit changes the way modules are loaded. rizzo1-4/+20
As partly documented in loader.c and include/asterisk/module.h, modules are now expected to return all of their methods and flags into a structure 'mod_data', and are normally loaded with RTLD_NOW | RTLD_LOCAL, so symbols are resolved immediately and conflicts should be less likely. Only in a small number of cases (res_*, typically) modules are loaded RTLD_GLOBAL, so they can export symbols. The core of the change is only the two files loader.c and include/asterisk/module.h, all the rest is simply adaptation of the existing modules to the new API, a rather mechanical (but believe me, time and finger-consuming!) process whose detail you can figure out by svn diff'ing any single module. Expect some minor compilation issue after this change, please report it on mantis http://bugs.digium.com/view.php?id=6968 so we collect all the feedback in one place. I am just sorry that this change missed SVN version number 20000! git-svn-id: http://svn.digium.com/svn/asterisk/trunk@20003 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-12add 'show threads' and 'show profile' commands.rizzo1-0/+35
These are momstly debugging tools for developers, a bit documented in the header files (utils.h), although more documentation is definitely necessary. The performance impact is close to zero(*) so there is no need to compile it conditionally. (*) not completely true - thread destruction still needs to search a list _but_ this can be easily optimized if we end up with hundreds of active threads (in which case, though, the problem is clearly elsewhere). git-svn-id: http://svn.digium.com/svn/asterisk/trunk@19544 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-11as discussed with kevin, moverizzo1-0/+14
ast_register_atexit()/ ast_unregister_atexit() into asterisk.h These are general functions, not restricted to modules, so move them in a more proper place. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@19223 f38db490-d61c-443f-a65b-d21fe96a405b
2006-03-29Add two widely used constantsrizzo1-0/+3
#define DEFAULT_SAMPLE_RATE 8000 #define DEFAULT_SAMPLES_PER_MS ((DEFAULT_SAMPLE_RATE)/1000) to the main header, and remove equivalent ones from plc.[ch] This will simplify the cleanup of the codec/ and formats/ files. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15969 f38db490-d61c-443f-a65b-d21fe96a405b
2006-03-28bring in the code that was discussed on Mantis #6068,rizzo1-0/+2
which is the basis for several simplifications and fixes to the CLI interfaces. The core is in cli.c, some documentation on a new function to help command completion is in cli.h, and one line of glue code in the other two files. Next step is to bring in the patches described in #6066 and other simplifications. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15817 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-14add 'systemname' option to prefix channel unique IDs with (issue #5825)kpfleming1-0/+1
convert chan->uniqueid to a stringfield from a fixed-size buffer git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10088 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-14Bug 4377 - Initial round of loader changestilghman1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10084 f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-29git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7221 ↵kpfleming1-0/+0
f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-08issue #5599kpfleming1-12/+13
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7007 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-26more doxygenification (issue #5513)russell1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6852 f38db490-d61c-443f-a65b-d21fe96a405b
2005-08-23make sure realtime/high scheduling priority is relinquished before executing ↵kpfleming1-0/+2
an AGI script (issue #4930) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6368 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-25process asterisk.conf in a single pass, instead of twice (bug #4689)kpfleming1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6216 f38db490-d61c-443f-a65b-d21fe96a405b
2005-07-05add support for 'early loading' modules, so that nearly all configuration ↵kpfleming1-1/+1
files can be read from Realtime storage add warning for when file mapping is found but the engine is not available add warning for trying to map 'logger.conf', since it cannot be reliably mapped git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6034 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-07fix version-string builds for non-gcc compilerskpfleming1-3/+5
don't build version-string stuff for LOW_MEMORY builds git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5873 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-07add note about examplekpfleming1-0/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5872 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-07add doxygen docs for file version stuffkpfleming1-0/+35
make doxygen expand __GNUC__ protected code blocks make doxygen process include/asterisk.h git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5871 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06more file version tagskpfleming1-3/+3
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5866 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06remove experimental module version tagskpfleming1-3/+20
add per-file revision tags and 'show version files' CLI command git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5864 f38db490-d61c-443f-a65b-d21fe96a405b
2005-06-06major Makefile and build process improvements, including removal of all ↵kpfleming1-16/+14
hardcoded paths (modules must now use run-time paths as they should) (bug #4116) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5855 f38db490-d61c-443f-a65b-d21fe96a405b
2005-04-21use double-quotes instead of angle-brackets for non-system include files ↵kpfleming1-0/+59
(bug #4058) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5490 f38db490-d61c-443f-a65b-d21fe96a405b