dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

86 Commits

Author SHA1 Message Date
russell 149e9c8fdc Show the channel unique ID in the "show channel concise" output
(closes issue #11148, requested by falves11, patched by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@88370 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-02 21:25:55 +00:00
qwell 7756b987a0 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22 20:05:18 +00:00
russell 9cac9bf42a Merged revisions 85532 via svnmerge from
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: http://svn.digium.com/svn/asterisk/trunk@86585 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-21 22:52:20 +00:00
qwell d542122e6a Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19 18:29:40 +00:00
russell cf06867b68 Move the CLI commands that were in builtins[] into the cli_cli[] array of CLI
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: http://svn.digium.com/svn/asterisk/trunk@85550 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15 13:44:53 +00:00
jamesgolovich 0a7e7ffd14 Fix compiling cli.c due to differences with new cli system (closes issue
0010966)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85535 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-13 08:38:50 +00:00
russell ac808d6bde Merged revisions 85533 via svnmerge from
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: http://svn.digium.com/svn/asterisk/trunk@85534 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-13 05:53:19 +00:00
russell 13b9c5237c Merge a ton of NEW_CLI conversions. Thanks to everyone that helped out! :)
(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: http://svn.digium.com/svn/asterisk/trunk@85460 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-11 19:03:06 +00:00
russell fae8b164a8 Don't set the full command string until after verifying that there is not
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: http://svn.digium.com/svn/asterisk/trunk@84169 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 14:55:10 +00:00
file b7bc7c5b5e Convert CLI helpers list to rwlist.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77857 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-01 15:28:02 +00:00
russell 70476ea4aa (closes issue #10192)
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: http://svn.digium.com/svn/asterisk/trunk@76555 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-23 14:21:41 +00:00
tilghman 74c2948c22 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@75706 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-18 19:47:20 +00:00
russell 7861ca021d After some discussion on the asterisk-dev list, we determined that this approach
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: http://svn.digium.com/svn/asterisk/trunk@72986 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02 23:02:16 +00:00
russell cfb405413d Add a CLI command to output docs on CLI commands to a file
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72937 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-02 20:42:14 +00:00
qwell 99cf00120f Fix a segfault when trying to tab complete the "core show uptime" command.
Reported in #asterisk-dev on IRC by jcmoore, fixed by me.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@72326 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-27 22:27:09 +00:00
russell 7a0fe5c93f Convert uses of strdup() to ast_strdup()
(issue #9983, eliel)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69436 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-14 23:01:01 +00:00
file 479087578c Use read/write lock based lists for group counting.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@69130 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-13 18:23:12 +00:00
tilghman eb5d461ed4 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@67864 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-06 21:20:11 +00:00
mmichelson fee4ee2c57 Found a bug where when "core set debug #" is used, the verbosity is read as the
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: http://svn.digium.com/svn/asterisk/trunk@67557 f38db490-d61c-443f-a65b-d21fe96a405b
2007-06-05 22:59:36 +00:00
file ec529b6fa3 Merged revisions 61805 via svnmerge from
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: http://svn.digium.com/svn/asterisk/trunk@61806 f38db490-d61c-443f-a65b-d21fe96a405b
2007-04-25 19:27:42 +00:00
russell b58b209293 Add the channel's Language to the "show channel" CLI command and the DumpChan
application.  (issue #9187, Junky)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@57474 f38db490-d61c-443f-a65b-d21fe96a405b
2007-03-02 16:59:22 +00:00
file ecb2102037 Merged revisions 56008 via svnmerge from
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: http://svn.digium.com/svn/asterisk/trunk@56009 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-22 00:38:46 +00:00
russell bb6564f8e7 This introduces a new dialplan function, DEVSTATE, which allows you to do some
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: http://svn.digium.com/svn/asterisk/trunk@54261 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-13 22:02:20 +00:00
russell 32e9fe9768 - Constify the format string passed to ast_cli()
- Simplify printing out the warranty and license


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@54147 f38db490-d61c-443f-a65b-d21fe96a405b
2007-02-13 05:57:52 +00:00
file 7f67444034 Add core show channels count CLI command. (issue #8932 reported by mr_mehul_shah)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@52525 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-29 17:49:04 +00:00
file cd15e6156e Cosmetic changes. Make main source files better conform to coding guidelines and standards. (issue #8679 reported by johann8384)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@51486 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-23 00:11:32 +00:00
qwell 22f025f885 Fix filename completion for "module load" and "load" CLI commands.
Issue 8846


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@51249 f38db490-d61c-443f-a65b-d21fe96a405b
2007-01-18 19:03:25 +00:00
rizzo 730be6778d remove now useless extern declarations.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48580 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-19 16:35:49 +00:00
rizzo d78959e745 convert the final clients of ast_build_string to use ast_str_*()
Now the only module left using it is chan_sip.c



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48559 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-18 15:38:50 +00:00
rizzo ee5146aeb7 another conversion from ast_build_str to ast_str
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48517 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-16 09:56:31 +00:00
rizzo b68b240ef8 simplify the ast_dynamic_str_*.... routines by
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: http://svn.digium.com/svn/asterisk/trunk@48510 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-15 23:10:42 +00:00
rizzo 4dd25f76a0 Make sure tab-completion works even when we have typed a fully
matching word (e.g. "sip<TAB>"); this is implemented by this one-line change

-               for (;; dst++, src += n) {
+               for (;src < argindex; dst++, src += n) {

However this code is not exactly trivial to understand, so
i am also adding some comments to help figuring out what it does.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48408 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-12 09:40:45 +00:00
russell 8048b9c718 Constify a bunch of the usage strings for CLI commands.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48302 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-06 07:23:32 +00:00
tilghman fb583000ba Merged revisions 48179 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48179 | tilghman | 2006-12-01 13:38:59 -0600 (Fri, 01 Dec 2006) | 2 lines

Double-unlock error (reported by blitzrage on IRC)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@48180 f38db490-d61c-443f-a65b-d21fe96a405b
2006-12-01 19:41:02 +00:00
rizzo 34f862cfb9 Move this macro from cli.c to cli.h so apps can use it
without duplicating the macro or the code:

/*!
 * In many cases we need to print singular or plural
 * words depending on a count. This macro helps us e.g.
 *     printf("we have %d object%s", n, ESS(n));
 */
#define ESS(x) ((x) == 1 ? "" : "s")



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47827 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-18 20:08:17 +00:00
rizzo 9c02454023 remove a debugging message
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47818 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 22:56:58 +00:00
rizzo 0d322d21da convert "help" to new style,
fix completion of arguments past the first one
that i broke earlier today.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47817 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 22:53:57 +00:00
rizzo f908b78fdb standardize "module show [like]"
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47815 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 22:02:15 +00:00
rizzo eaad3b43af describe a bit the patterns that you can have in the commands,
and add support for wildcard (spelled as '%').

On passing fix a bug in the expansion code which was hidden and
appeared when implementing the wildcard
The fix is just the line 'src != argindex', in case someone wants
to test this on 1.4 - but i would just keep this in trunk.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47813 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 21:50:55 +00:00
rizzo 40d3daf0ad merge the implemenmtation of "core set debug" and "core set verbose".
No externally visible changes.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47790 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 12:26:15 +00:00
rizzo 5cea0449f7 introduce a bit of regexp support in the internal CLI api.
Now you can specify a cli command as
	"console autoanswer [on|off]"

which means the on|off argument is optional, or

	"console {mute|unmute}"

which means the mute|unmute argument is mandatory.

The blocks in [] or {} do not necessarily need to be at the
end of the string.

Completions for the variant parts are generated automatically.
This should significantly simplify the implementation of
the various handlers.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47787 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-17 11:12:13 +00:00
rizzo 3b59d07cc5 remove an unused function
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47769 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-16 21:57:23 +00:00
rizzo e48a9fd51b reduce indentation on a large function.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47732 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-16 14:58:24 +00:00
rizzo eb37a79bc1 use atomic instructions to update the inuse counters
for CLI entriesC. The lock is not protecting this field.

I wonder if the field should be declared 'volatile' as well.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47731 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-16 14:41:28 +00:00
rizzo db4a58f62f make kevin (and 64 bit machines) happy and
remove a cast from char* to int in handling the return
values from new-style handlers.

On passing, note that main/loader.c::ast_load_resource() always return 0
so errors are not propagated up. I am not sure this is the intended
behaviour.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47727 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-16 14:21:30 +00:00
rizzo 28823899ca small simplifications and localization of variables.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47667 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15 17:17:07 +00:00
rizzo 8840b9eb9d new-style "core show channels"
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47665 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15 17:05:55 +00:00
rizzo 62e792a352 more changes to new style of "module load" and "load".
Under FreeBSD, the filename_completion used in the above commands does
not work. Not sure why, but on passing i note that the function is
part of readline and is not reentrant, so it needs to be fixed one way
or another.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47664 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15 16:39:38 +00:00
rizzo 10ba53709e move another deprecated command to the new style
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47663 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15 16:20:23 +00:00
rizzo fd41174e4a move "core set debug" to the new style, and remove duplicated
code for the deprecated handler.

On passing fix a long standing bug in find_cli() which would not
find the longest match - this part (trivial, basically
just update matchlen on a match) must go in 1.4 and possibly 1.2 as well.




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@47662 f38db490-d61c-443f-a65b-d21fe96a405b
2006-11-15 16:13:30 +00:00