summaryrefslogtreecommitdiff
path: root/main/cli.c
AgeCommit message (Collapse)Author
2008-05-01Modify TIMEOUT() to be accurate down to the millisecond.Tilghman Lesher
(closes issue #10540) Reported by: spendergrass Patches: 20080417__bug10540.diff.txt uploaded by Corydon76 (license 14) Tested by: blitzrage git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@115076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-18Go through and fix a bunch of places where character strings were being ↵Terry Wilson
interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not actual problems, per se. I also added format attributes to any printf wrapper functions I found that didn't have them. -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@109447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-03-04Whitespace changes onlyTilghman Lesher
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@105840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-02-18Context tracing for channelsTilghman Lesher
(closes issue #11268) Reported by: moy Patches: chantrace-datastored-encapsulated-rev94934.patch uploaded by moy (license 222) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@103754 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-10Check pointers before freeing (was getting WARNINGS under MALLOC_DEBUG)Terry Wilson
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09Merged revisions 97622 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 (closes issue #11718) ........ r97622 | qwell | 2008-01-09 14:28:43 -0600 (Wed, 09 Jan 2008) | 5 lines Correctly display a message if a command could not be found. Also fix a comment which may have led to this happening. Issue 11718, reported by kshumard. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97623 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09Merged revisions 97618 via svnmerge from Jason Parker
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97618 | qwell | 2008-01-09 14:05:45 -0600 (Wed, 09 Jan 2008) | 1 line Fix some locking and return value funkiness. We really shouldn't be unlocking this lock inside of a function, unless we locked it there too. ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-01-09Merged revisions 97350 via svnmerge from Tilghman Lesher
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r97350 | tilghman | 2008-01-08 18:44:14 -0600 (Tue, 08 Jan 2008) | 5 lines Allow filename completion on zero-length modules, remove a memory leak, remove a file descriptor leak, and make filename completion thread-safe. Patched and tested by tilghman. (Closes issue #11681) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@97364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-12-07Add count of total number of calls processed by asterisk during it's lifetime.Jason Parker
Add number of total calls and current calls to SNMP. Closes issue #10057, patch by jcmoore. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@91779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28file says... compile before you commit!Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28Remove "old"-style CLI handler, since nothing uses it anymore.Jason Parker
Closes issue #11403, patch by eliel. This also completes the janitor project. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@90038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-28Hide CLI commands starting with _ from tab completion as was done previously.Joshua Colp
(closes issue #11395) Reported by: eliel Patches: cli.c.patch uploaded by eliel (license 64) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89982 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-26- Mark "concise" as deprecatedOlle Johansson
- Restructure other changes to UPGRADE.txt and CHANGES We're still looking for scripts that replace asterisk -rx "show shannels concise" by using the manager interface, but still produces the same output. Anyone? git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21remove a bunch of useless #include "options.h"Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89511 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20move asterisk/paths.h outside asterisk.h and into those filesLuigi Rizzo
who really need it. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20move internal function declarations to include/asterisk/_private.hLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89465 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19another bunch of include removals (errno.h and asterisk/logger.h)Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89425 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16Start untangling header inclusion in a way that does not affectLuigi Rizzo
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: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08improve linked-list macros in two ways:Kevin P. Fleming
- 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: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-02Show the channel unique ID in the "show channel concise" outputRussell Bryant
(closes issue #11148, requested by falves11, patched by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former ↵Jason Parker
didn't make much sense git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-21Merged revisions 85532 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85532 | russell | 2007-10-13 00:24:33 -0500 (Sat, 13 Oct 2007) | 8 lines Properly handle the case where read() may return the text for more than one CLI command at once for a remote console. (closes issue #10888) Reported by: jamesgolovich Patches: asterisk-climultiple.diff.txt uploaded by jamesgolovich (license 176) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19Convert NEW_CLI to AST_CLI.Jason Parker
Closes issue #11039, as suggested by seanbright. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15Move the CLI commands that were in builtins[] into the cli_cli[] array of CLIRussell Bryant
commands and remove the cli_iterator struct. This gets tab completion working again. (closes issue #10970) Reported by: jamesgolovich Patches: asterisk-clicomplete.diff.txt uploaded by jamesgolovich (license 176) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13Fix compiling cli.c due to differences with new cli system (closes issue James Golovich
0010966) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13Merged revisions 85533 via svnmerge from Russell Bryant
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r85533 | russell | 2007-10-13 01:48:10 -0400 (Sat, 13 Oct 2007) | 12 lines Fix an issue with console verbosity when running asterisk -rx to execute a command and retrieve its output. The issue was that there was no way for the main Asterisk process to know that the remote console was connecting in the -rx mode. The way that James has fixed this is to have all remote consoles muted by default. Then, regular remote consoles automatically execute a CLI command to unmute themselves when they first start up. (closes issue #10847) Reported by: atis Patches: asterisk-consolemute.diff.txt uploaded by jamesgolovich (license 176) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-11Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)Russell Bryant
(closes issue #10724) Reported by: eliel Patches: chan_skinny.c.patch uploaded by eliel (license 64) chan_oss.c.patch uploaded by eliel (license 64) chan_mgcp.c.patch2 uploaded by eliel (license 64) pbx_config.c.patch uploaded by seanbright (license 71) iax2-provision.c.patch uploaded by eliel (license 64) chan_gtalk.c.patch uploaded by eliel (license 64) pbx_ael.c.patch uploaded by seanbright (license 71) file.c.patch uploaded by seanbright (license 71) image.c.patch uploaded by seanbright (license 71) cli.c.patch uploaded by moy (license 222) astobj2.c.patch uploaded by moy (license 222) asterisk.c.patch uploaded by moy (license 222) res_limit.c.patch uploaded by seanbright (license 71) res_convert.c.patch uploaded by seanbright (license 71) res_crypto.c.patch uploaded by seanbright (license 71) app_osplookup.c.patch uploaded by seanbright (license 71) app_rpt.c.patch uploaded by seanbright (license 71) app_mixmonitor.c.patch uploaded by seanbright (license 71) channel.c.patch uploaded by seanbright (license 71) translate.c.patch uploaded by seanbright (license 71) udptl.c.patch uploaded by seanbright (license 71) threadstorage.c.patch uploaded by seanbright (license 71) db.c.patch uploaded by seanbright (license 71) cdr.c.patch uploaded by moy (license 222) pbd_dundi.c.patch uploaded by moy (license 222) app_osplookup-rev83558.patch uploaded by moy (license 222) res_clioriginate.c.patch uploaded by moy (license 222) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85460 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01Don't set the full command string until after verifying that there is notRussell Bryant
another CLI command with the same command text registered. This prevents a crash if someone accidentally calls ast_cli_register() on the same CLI command data twice. This also fixes a small bug where the helpers list would get unlocked without being locked if building the full command failed. (closes issue #10858, reported by jamesgolovich, patched by me) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01Convert CLI helpers list to rwlist.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23(closes issue #10192)Russell Bryant
Reported by: bbryant Patches: 20070720__core_debug_by_file.patch uploaded by bbryant (license 36) (with some modifications by me) Tested by: russell, bbryant This set of changes introduces the ability to set the core debug or verbose levels on a per-file basis. Interestingly enough, in 1.4, you have the ability to set core debug for a single file, but that functionality was accidentally lost in the conversion of the CLI commands to the new format. This patch improves upon what was in 1.4 by letting you set it for more than 1 file, and by also supporting verbose. *** Janitor Project *** This patch also introduces a new macro, ast_verb(), which is similar to ast_debug(). Setting the per file verbose value only works for messages that use this macro. Converting existing uses of ast_verbose() can be done like: if (option_debug > 2) ast_verbose(VERBOSE_PREFIX_3 "Something useful\n"); ... ast_verb(3, "Something useful\n"); git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76555 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18Merge in ast_strftime branch, which changes timestamps to be accurate to the ↵Tilghman Lesher
microsecond, instead of only to the second git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02After some discussion on the asterisk-dev list, we determined that this approachRussell Bryant
for extracting application, function, manager, and agi documentation is the wrong one to take. The most severe problem is that the output depends on which modules are loaded as well as compile time options, which both determine which parts are available. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02Add a CLI command to output docs on CLI commands to a fileRussell Bryant
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-27Fix a segfault when trying to tab complete the "core show uptime" command.Jason Parker
Reported in #asterisk-dev on IRC by jcmoore, fixed by me. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72326 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14Convert uses of strdup() to ast_strdup()Russell Bryant
(issue #9983, eliel) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13Use read/write lock based lists for group counting.Joshua Colp
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06Issue 9869 - replace malloc and memset with ast_calloc, and other coding ↵Tilghman Lesher
guidelines changes git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05Found a bug where when "core set debug #" is used, the verbosity is read as theMark Michelson
old value instead of the old debug value, leading to an erroneous status message after setting. This was purely a cosmetic issue and had no other underlying problems. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25Merged revisions 61805 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ................ r61805 | file | 2007-04-25 15:21:54 -0400 (Wed, 25 Apr 2007) | 10 lines Merged revisions 61804 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.2 ........ r61804 | file | 2007-04-25 14:52:50 -0400 (Wed, 25 Apr 2007) | 2 lines Merge rewritten group counting support. No more storing data on the variable list of the channels. That was bad, mmmk? (issue #7497 reported by sabbathbh) ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-02Add the channel's Language to the "show channel" CLI command and the DumpChanRussell Bryant
application. (issue #9187, Junky) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57474 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-22Merged revisions 56008 via svnmerge from Joshua Colp
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r56008 | file | 2007-02-21 19:35:55 -0500 (Wed, 21 Feb 2007) | 2 lines Print out deprecation notice on usage output of CLI commands. (issue #8925 reported by blitzrage) ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13This introduces a new dialplan function, DEVSTATE, which allows you to do someRussell Bryant
pretty cool things. First, you can get the device state of anything in the dialplan: NoOp(SIP/mypeer has state ${DEVSTATE(SIP/mypeer)}) NoOp(The conference room 1234 has state ${DEVSTATE(MeetMe:1234)}) Most importantly, this allows you to create custom device states so you can control phone lamps directly from the dialplan. Set(DEVSTATE(Custom:mycustomlamp)=BUSY) ... exten => mycustomlamp,hint,Custom:mycustomlamp git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-13- Constify the format string passed to ast_cli()Russell Bryant
- Simplify printing out the warranty and license git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@54147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-29Add core show channels count CLI command. (issue #8932 reported by ↵Joshua Colp
mr_mehul_shah) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@52525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23Cosmetic changes. Make main source files better conform to coding guidelines ↵Joshua Colp
and standards. (issue #8679 reported by johann8384) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-18Fix filename completion for "module load" and "load" CLI commands.Jason Parker
Issue 8846 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-19remove now useless extern declarations.Luigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18convert the final clients of ast_build_string to use ast_str_*()Luigi Rizzo
Now the only module left using it is chan_sip.c git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48559 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-16another conversion from ast_build_str to ast_strLuigi Rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48517 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15simplify the ast_dynamic_str_*.... routines byLuigi Rizzo
renaming them to ast_str ... and putting the struct ast_threadstorage pointer into the struct ast_str. This makes the code a lot more readable. At this point we can use these routines also to replace ast_build_string(). git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48510 65c4cc65-6c06-0410-ace0-fbb531ad65f3