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

Pavel Troller patrol at sinus.cz
Thu Sep 15 00:02:51 CDT 2011


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 ?



More information about the asterisk-dev mailing list