[asterisk-dev] Channel lock in "core show channel" CLI command ?

Kevin P. Fleming kpfleming at digium.com
Thu Sep 15 06:53:27 CDT 2011


On 09/15/2011 12:02 AM, Pavel Troller wrote:
> Hi!
>    I've found that executing the "core show channel" from the primary Asterisk
> console (the one which it spawns upon startup) causes the channel audio to be
> muted during the command execution. I think it's a locking issue: the command
> is executed in the locked state of the channel. However, on a primary console,
> execution of this command can take about 2 seconds, especially on a system
> with framebuffer consoles (no X) and thus slow scrolling, and when there are
> many channel variables. Because ast_cli function seems to run synchronously,
> i.e. blocking until the text is really output, for all this time the channel is
> dead. Using remote console (asterisk -r even on the local host) doesn't make
> problems, probably because ast_cli runs asynchronously in this case and the
> text is buffered on the remote console.
>    Would it be possible to use something like a sprintf() function to prepare
> the command output to an extra buffer, unlock the channel and then call the
> ast_cli with the buffer instead of live data ? I don't see a major problem
> there. If you agree, I could try to write a small patch for it.
>    With regards,
>      Pavel Troller
>
> P.S. It's on 1.8 branch, maybe the problem is already fixed in trunk ?

No, I don't think any attempt has been made to address this; however, as 
you say, the problem is not really in Asterisk, it's caused by the 
console being incredibly slow. The solution, of course, is to not 
configure your system in a way that causes the console to be so slow :-)

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list