aboutsummaryrefslogtreecommitdiffstats
path: root/cli.c
AgeCommit message (Collapse)AuthorFilesLines
2006-08-21merge new_loader_completion branch, including (at least):kpfleming1-1386/+0
- 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-08-08change constant name from MAXSTRLEN to INITLEN since it is not the maximumrussell1-2/+2
length, it is the initial length of the string when first allocated git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39274 f38db490-d61c-443f-a65b-d21fe96a405b
2006-08-08Merge team/russell/ast_verbose_threadstoragerussell1-40/+7
- instead of defining a free() wrapper in a bunch of files, define it as ast_free() in utils.h and remove the copies from all the files. - centralize and abstract the code used for doing thread storage. The code lives in threadstorage.h, with one function being implemented in utils.c. This new API includes generic thread storage as well as special functions for handling thread local dynamic length string buffers. - update ast_inet_ntoa() to use the new threadstorage API - update ast_state2str() to use the new threadstorage API - update ast_cli() to use the new threadstorage API - Modify manager_event() to use thread storage. Instead of using a buffer of 4096 characters as the workspace for building the manager event, use a thread local dynamic string. Now there is no length limitation on the length of the body of a manager event. - Significantly simplify the handling of ast_verbose() ... - Instead of using a static char buffer and a lock to make sure only one thread can be using ast_verbose() at a time, use a thread local dynamic string as the workspace for preparing the verbose message. Instead of locking around the entire function, the only locking done now is when the message has been built and is being deliviered to the list of registered verbose message handlers. - This function was doing a strdup() on every message passed to it and keeping a queue of the last 200 messages in memory. This has been completely removed. The only place this was used was that if there were any messages in the verbose queue when a verbose handler was registered, all of the messages in the queue would be fed to it. So, I just made sure that the console verbose handler and the network verbose handler (for remote asterisk consoles) were registered before any verbose messages. pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at startup, but I didn't feel the performance hit of this message queue was worth saving the initial verbose output for these very rarely used modules. - I have removed the last three arguments to the verbose handlers, leaving only the string itself because they aren't needed anymore. For example, ast_verbose had some logic for telling the verbose handler to add a newline if the buffer was completely full. Now that the buffer can grow as needed, this doesn't matter anymore. - remove unused function, ast_verbose_dmesg() which was to dispatch the message queue - Convert the list of verbose handlers to use the linked list macros. - add missing newline characters to a few ast_verbose() calls - convert the list of log channels to use the linked list macros in logger.c - fix close_logger() to close all of the files it opened for logging - update ast_log() to use a thread local dynamic string for its workspace for preparing log messages instead of a buffer of size BUFSIZ (8kB on my system) allocated on the stack. The dynamic string in this case is limited to only growing to a maximum size of BUFSIZ. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39272 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27fix crashes with MALLOC_DEBUG enabled that were a result of my recent threadrussell1-1/+10
storage changes (fixes issue #7595) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38286 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-27fix some breakage of ast_cli() that resulted in seg faults on Josh's machine.russell1-0/+2
I'm not sure why this never caused problems for me ... git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38283 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-26merge the changes from my ast_cli_tls branch ...russell1-6/+19
Instead of having a static buffer size of 16k, start out with 256 bytes and increase the size of the buffer as needed. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38223 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23Merge team/russell/ast_cli_tls into the trunk.russell1-9/+24
This improves the performance of ast_cli() by not doing a heap memory allocation and deallocation every single time the function is called. Instead, a thread-specific buffer is allocatted the first time the function is called and automatically free'd when the thread exits. Also note that this buffer will only be allocatted in threads that actually call this function, which is probably only the threads spawned to service connected asterisk consoles. This does introduce a new limitation on the maximum length of the resulting string from the arguments passed to ast_cli. Previously there was no limit since it was just allocating a buffer big enough every time the function was called. The current buffer size is 16kB. If there is ever a case where we want to print more than 16k characters in a single call to ast_cli(), this will have to be increased. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38127 f38db490-d61c-443f-a65b-d21fe96a405b
2006-07-23take the advice of an XXX comment and use an atomic operation to decrement arussell1-9/+4
variable. Also, change a use of strdup to ast_strdup and remove a duplicated error message. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@38108 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-07simplify autoconfig include mechanism (make tholo happy he can use lint ↵kpfleming1-6/+4
again :-) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32846 f38db490-d61c-443f-a65b-d21fe96a405b
2006-06-04- Add information about transcoding to "show channel"oej1-0/+4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32115 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-31remove the "frog" CLI command left over from April 1strussell1-27/+0
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@31129 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-26Fix various problems in the addition of the ability to mute log/verboserussell1-2/+2
output to remove consoles. The prototypes added to logger.h still need doxygen documentation, as well. - Add the new command line option to the man page - make the mute option a flag instead of an int since it is only a binary option - remove useless extern keywords for prototypes added to logger.h - rename ast_console_mute() to ast_console_toggle_mute() since that is what it actually does - actually apply the mute option to newly created remote consoles instead of only working when the CLI command is used - don't imply the NO_FORK option if the mute command line option is provided - place the new CLI command in the correct place in the list which has to be in alphabetical order - Finally, clean up a few spacing issues to conform to the coding guidelines git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30630 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-26Add ability to disable log / verbose output to remote consoles (issue #6524 ↵file1-0/+14
reported by mavetju) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@30603 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-19Fix tab completion when you just do a plain tab without entering anything, ↵file1-3/+6
and also fix show application tab completion. (issue #7089 reported by blitzrage) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@28792 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-09use S_OR where appropriate, comment an unclear difference in formatrizzo1-6/+12
between CONCISE and VERBOSE git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25860 f38db490-d61c-443f-a65b-d21fe96a405b
2006-05-05move ast_carefulwrite from manager.c to utils.c so that cli.c andrussell1-1/+0
res_agi.c no longer depend on manager.h (issue #6397, casper) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@25026 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-29a bunch of conversion to ast_channel_*lock (issue #7058)russell1-7/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23355 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-29move the "show version" CLI command from cli.c to asterisk.c so that only onerussell1-23/+0
file depends on version.h, and thus, only one file has to be rebuilt when version.h gets regenerated (issue #6942) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@23229 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-21- use symbolic constants and macros to play with the debug flagrizzo1-3/+4
on the frame counters. Document it in the header file. - provide a single exit point for a function; - mark XXX some unclear parts of the code. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21933 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-21make NULL and "" equivalent for some cid fields.rizzo1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@21792 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-14This rather large commit changes the way modules are loaded. rizzo1-0/+1
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-02Fix formatting of the frog codetilghman1-7/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16921 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-01fix style and printf format errors in the frog command.rizzo1-3/+4
(it's april first i guess...) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16886 f38db490-d61c-443f-a65b-d21fe96a405b
2006-04-01Added "frog" CLI command, which performs frog-in-a-blender calculations.jdixon1-0/+26
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@16868 f38db490-d61c-443f-a65b-d21fe96a405b
2006-03-28bring in the code that was discussed on Mantis #6068,rizzo1-291/+270
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-03-27Janitor work converting !ast_strlen_zero(a)?a:bmogorman1-2/+2
to S_OR functions. from bug note 6805 with minor modifications. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@15283 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-27don't try to print the help text for a CLI command when RESULT_SHOWUSAGE isrussell1-1/+4
returned if there is no help text available (issue #6604) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@11282 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-16add StopMixMonitor application (issue #6122, with mods)russell1-3/+3
Rename and export ast_complete_channels for use by cli completion functions that want to complete from the list of active channels git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10287 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-14use a delimiter for 'show channels concise' that will not appear in the ↵kpfleming1-1/+1
field contents (issue #6086, with UPGRADE.txt addition) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10085 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-14more list macro conversion (issue #6361, plus documentation for new macro)kpfleming1-57/+30
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10067 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-09conversions to memory allocation wrappers, remove duplicated error messages,russell1-17/+19
remove unnecessary casts, malloc+memset to calloc (issue #6395) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9310 f38db490-d61c-443f-a65b-d21fe96a405b
2006-02-01use string fields for some stuff in ast_channelkpfleming1-1/+1
const-ify some more APIs remove 'type' field from ast_channel, in favor of the one in the channel's tech structure allow string field module users to specify the 'chunk size' for pool allocations update chan_alsa to be compatible with recent const-ification patches git-svn-id: http://svn.digium.com/svn/asterisk/trunk@9060 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-18constify arguments in more places where strings should not be modified ↵russell1-18/+18
(issue #6286) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8203 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-18cleanup the show uptime code, and minor changesmogorman1-89/+41
to patch 6274 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8161 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-17Added tab completion for help. bug 6074mogorman1-1/+14
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8127 f38db490-d61c-443f-a65b-d21fe96a405b
2006-01-07Add support for H.264 with SIP and recordingmarkster1-4/+8
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7855 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-30update doxygen docs to specify authorsrussell1-1/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7682 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-28restore alphabetical order for builtin cli commands (issue #6073)russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7664 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-26Merged revisions 7634 via svnmerge from russell1-2/+2
https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r7634 | russell | 2005-12-26 13:19:12 -0500 (Mon, 26 Dec 2005) | 2 lines cast time_t to an int in printf/scanf (issue #5635) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7635 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-20- move the string join() function to utils.c since it is used in both cli.c ↵russell1-11/+2
and res_agi.c - reimplement ast_join to be of linear effieciency instead of quadratic - remove some useless checks for "if (e)" - reorder checks for strings starting with '_' to avoid a useless call to ast_join() - check array bounds when parsing arguments to AGI (issue #5868) git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7556 f38db490-d61c-443f-a65b-d21fe96a405b
2005-12-07This is the first round of removing applications that were marked as deprecatedrussell1-0/+58
in the 1.2 release. They are being removed from the trunk and will not be in the next major release. The following is a list of the applications that are being removed in this commit: Curl, Cut, Sort, DBPut, DBGet, ENUMLookup, Eval GetGroupCount, SetGroup, CheckGroup, GetGroupMatchCount MD5, MD5Check, Math, SetCIDName, SetCIDNum, SetRDNIS, SetCallerID TXTCIDName, AbsoluteTimeout, DigitTimeout, ResponseTimeout, SetAccount SetLanguage, SetVar (renamed to Set) These changes also include moving the "group show channels" cli command from app_groupcount.c to cli.c. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7379 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-29Add a minor optimization to CLI tab completion functions for channels.russell1-42/+65
Also, clean up some formatting and coding guidelines issues. git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7214 f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-21issue #5804russell1-5/+5
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@7159 f38db490-d61c-443f-a65b-d21fe96a405b
2005-11-05stop recompiling cli.c on every 'make'kpfleming1-5/+11
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6963 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-24Doxygen documentation update from oej (issue #5505)russell1-2/+2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6847 f38db490-d61c-443f-a65b-d21fe96a405b
2005-10-11fix command listing for top level CLI commands (issue #5416)russell1-1/+1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6740 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-25Fix CLI completion issue (bug #5041)markster1-14/+19
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6640 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-24Fix CLI memory leak (bug #5035)markster1-6/+7
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6635 f38db490-d61c-443f-a65b-d21fe96a405b
2005-09-14update MANY more files with proper copyright/license info (thanks Ian!)kpfleming1-4/+15
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6596 f38db490-d61c-443f-a65b-d21fe96a405b