[Home]

Summary:ASTERISK-02636: 'asterisk -r -x "show channels"' often returns no channel information
Reporter:Lee Howard (faxguy)Labels:
Date Opened:2004-10-19 15:47:13Date Closed:2004-10-19 16:12:59
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:Often, when there are channels in use and when, from the CLI, the "show channels" command lists the channels while the shell command, 'asterisk -r -x "show channels"' will not show show any channels in use.
Comments:By: Brian West (bkw918) 2004-10-19 16:10:10

UPDATE! 07/26/2004-13:20  <-- kinda old ya think?  make update and try again.

By: Tilghman Lesher (tilghman) 2004-10-19 16:12:59

There isn't very much that can be done about this.  Basically, the problem is that there's no way to denote when a particular command is finished executing, so a brief hack is done like this:  if there's a 100 millisecond pause between
outputs, that's assumed to be the end of the output.  Unfortunately, there are
other reasons why a 100 millisecond pause might happen.  For example, the thread execution could be interrupted by the kernel to schedule another thread, or it could be that a particular channel has been locked for more than 100 milliseconds, and the channel cannot be printed until the command gets a lock on it.

The poll(2) that hacks in the 100 millisecond pause is in asterisk.c, around line 1434 if you want to mess with it, but this is not a fixable bug.  Sorry.

If you want a better method to query the channels, please use the manager interface.