[asterisk-bugs] [Asterisk 0013001]: [patch] Remove the 500ms delay trying to receive all CLI command output.

noreply at bugs.digium.com noreply at bugs.digium.com
Sun Jul 6 08:42:29 CDT 2008


A NOTE has been added to this issue. 
====================================================================== 
http://bugs.digium.com/view.php?id=13001 
====================================================================== 
Reported By:                eliel
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   13001
Category:                   Core/General
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
Asterisk Version:           SVN 
SVN Branch (only for SVN checkouts, not tarball releases):  trunk 
SVN Revision (number only!): 128342 
Disclaimer on File?:        N/A 
Request Review:              
====================================================================== 
Date Submitted:             07-06-2008 01:43 CDT
Last Modified:              07-06-2008 08:42 CDT
====================================================================== 
Summary:                    [patch] Remove the 500ms delay trying to receive all
CLI command output.
Description: 
I found this way to fix the 500ms delay in the polling that was increasing
the execution time of a 'asterisk -rx' command.
I created a command '_command nextislast' that is executed when 'asterisk
-rx' is being used to connect to the asterisk socket, and this command
tells asterisk that the next command within that console is the last, so
now asterisk is the responsible for closing the socket and we just wait for
all the output forever until the socket is closed.

====================================================================== 

---------------------------------------------------------------------- 
 Corydon76 - 07-06-08 08:42  
---------------------------------------------------------------------- 
Just idly wondering... would this be easier to do if we created a prefix
instead of a separate command... for example, "cli quit after core show
channels", where the "cli quit after" was intercepted by the command
interpreter and the remaining arguments passed.  I'm suggesting this prefix
to keep with our "<module> <action> <args>" syntax.  This would also
simplify the implementation.

Not saying you have to do it this way, just looking at the problems that
this approach has and trying to come up with a better way:

I understand your approach with trying to have an output for your command,
but this is not backwards compatible:  it adds another bit of output that
needs to be removed by what is running the command (negating part of the
reason the delay was put in there in the first place: to get rid of
extraneous output).  The output, if this approach remains, should also be
an English phrase, not the cryptic "nextislast\n" anyway. 

Issue History 
Date Modified   Username       Field                    Change               
====================================================================== 
07-06-08 08:42  Corydon76      Note Added: 0089797                          
======================================================================




More information about the asterisk-bugs mailing list