[asterisk-dev] CLI verbosity on -rx

James Golovich james at gnuinter.net
Thu Oct 4 22:19:50 CDT 2007



Russell Bryant wrote:
> 
> 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).
> 
> 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.
> 

Option 2 is the way I implemented it, although I actually did it in
reverse since there is still a short time before receiving the command
that verbose and log output could make its way there.  So when a non -rx
console (or one not started with -m) connects it esentially sends over a
'logger mute silent' command which unmutes it.  I added the silent
keyword so that the "Console is not muted anymore." message doesn't get
printed every time.

It also requires the patch from bug #10888 since that first read command
that asterisk does occasionally will have 2-3 commands in it, and the
way it works now we throw away anything after the first '\0'.

James



More information about the asterisk-dev mailing list