Summary:ASTERISK-09357: show channels CLI command only returns part of the full channel ID
Reporter:bttops (bttops)Labels:
Date Opened:2007-04-30 18:43:43Date Closed:2011-06-07 14:08:05
Versions:Frequency of
Description:When trying to do some call monitoring I noticed that the show channels cli command was not return the full channel ID.  In my case it was leaving off the last 4 bytes as shown below in verbose.

-- Attempting native bridge of SIP/595-09df3258 and

asteriskpbx1*CLI> show channels
Channel              Location             State   Application(Data)
SIP/733-09e86880     (None)               Up      Bridged
SIP/ s-CHANUNAVAIL@macro- Up      VoiceMail(7823@default|u)
SIP/ s@macro-dial:10      Up      Dial(SIP/733|15|r)
SIP/sip-pri-sbc-09e7 (None)               Up      Bridged
SIP/595-09df3258     s@macro-dialout-trun Up      
5 active channels
3 active calls

asteriskpbx1*CLI> show channel SIP/sip-pri-sbc-09e7
SIP/sip-pri-sbc-09e7 is not a known channel

asteriskpbx1*CLI> show channel SIP/sip-pri-sbc-09e742e8
-- General --LI>
         Name: SIP/sip-pri-sbc-09e742e8
         Type: SIP
     UniqueID: 1177963190.435
    Caller ID: 9729555152
Caller ID Name: (N/A)
  DNID Digits: (N/A)
        State: Up (6)
        Rings: 0
 NativeFormat: 4
  WriteFormat: 4
   ReadFormat: 4
1st File Descriptor: 21
    Frames in: 5281
   Frames out: 5287
Time to Hangup: 0
 Elapsed Time: N/A
Direct Bridge: SIP/595-09df3258
Indirect Bridge: SIP/595-09df3258
--   PBX   --
      Context: from-sip-external
   Extension: >
     Priority: 1
   Call Group: 0
 Pickup Group: 0
  Application: Bridged Call
         Data: SIP/595-09df3258
  Blocking in: ast_waitfor_nandfds

As you can see, the show channels command left the last 4 bytes (42e8) of the channel ID.  As a temporary work around, I have shortened the name of the trunk to a shorter, but less descriptive name so that the channel ID will fit the fixed width show channel output format.
Comments:By: Russell Bryant (russell) 2007-05-01 11:15:35

As you noted, it is a fixed width field, so this is intended behavior.  You can use tab completion to get the full channel name when doing a "show channel".

By: bttops (bttops) 2007-05-01 12:08:11


I appreciate your quick response and your solution does work for people working in the CLI.  However, having a fixed width column output prevents using the manager API to automatically parse channel information which can be used in a number of applications.

As I stated in the bug description, this issue can be worked around by only using trunk names of 6 characters or shorter, but as I stated in the bug, you can't be very descriptive in just 6 characters.  Also, the web interface seems to allow you to enter a trunk name of infinite length, but only accepts the first 20 characters.

By: Russell Bryant (russell) 2007-05-01 13:18:34

To get channel information from the manager interface, you should use the "Status" manager command, not the "show channels" CLI command.

You mention a bug in "the web interface".  If you are talking about a problem with the Asterisk GUI that Digium is developing, then feel free to report that as a bug in the GUI project.