[asterisk-dev] CLI verbosity on -rx

Russell Bryant russell at digium.com
Thu Oct 4 18:30:57 CDT 2007


Atis Lezdins wrote:
> Guys, could you please take a look at http://bugs.digium.com/view.php?id=10847
> 
> The problem is that i expect `asterisk -rx "show queues"` to return only 
> result of "show queues", as it would be in CLI with verbosity/debug 0. 
> However, sometimes i get full CLI output for quite long period of time. Qwell 
> insists that this is intended behaviour, but i don't agree. 
> 
> Is there any significant problem when executing remote command with separate 
> verbosity than main thread? 

So, here is the issue.

The main instance of Asterisk calls ast_register_verbose() and provides a
callback function called something like network_verboser().  This function
provides all of the common CLI output to remotely connected consoles.  This
output includes any log output, or verbose output.

The problem is that there is no way for the main Asterisk process to know the
difference between a regular remote console (simply -r) versus one that is only
connecting to execute a single command and exit (-rx).

The fix must make it such that the main Asterisk process can treat these two
types of remote consoles differently.  I can think of 2 ways to do it.

1) Create a 2nd unix socket.  Have connections to one for -r, and the other for
-rx.  I think this is going to be the easiest way to fix it, and thus is my
preferred method.

2) Have the remove console send over some magic text when it first connects to
indicate that it is a -rx console and should be treated as such.

Then, once the main process can treat them differently, it can properly _only_
send the output of the desired CLI command to -rx consoles.

-- 
Russell Bryant
Software Engineer
Digium, Inc.



More information about the asterisk-dev mailing list