def getChannelStats(self, chantypes=('<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>')):
if self.checkVersion('<STR_LIT>'):<EOL><INDENT>cmd = "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>cmd = "<STR_LIT>"<EOL><DEDENT>cmdresp = self.executeCommand(cmd)<EOL>info_dict ={}<EOL>for chanstr in chantypes:<EOL><INDENT>chan = chanstr.lower()<EOL>if chan in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>info_dict['<STR_LIT>'] = <NUM_LIT:0><EOL>info_dict['<STR_LIT>'] = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>info_dict[chan] = <NUM_LIT:0><EOL><DEDENT><DEDENT>for k in ('<STR_LIT>', '<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>info_dict[k] = <NUM_LIT:0><EOL><DEDENT>regexstr = ('<STR_LIT>' % '<STR_LIT:|>'.join(chantypes))    <EOL>for line in cmdresp.splitlines():<EOL><INDENT>mobj = re.match(regexstr, <EOL>line, re.IGNORECASE)<EOL>if mobj:<EOL><INDENT>chan_type = mobj.group(<NUM_LIT:1>).lower()<EOL>chan_id = mobj.group(<NUM_LIT:2>).lower()<EOL>if chan_type == '<STR_LIT>' or chan_type == '<STR_LIT>':<EOL><INDENT>if chan_id == '<STR_LIT>':<EOL><INDENT>info_dict['<STR_LIT>'] += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>info_dict['<STR_LIT>'] += <NUM_LIT:1><EOL><DEDENT><DEDENT>else:<EOL><INDENT>info_dict[chan_type] += <NUM_LIT:1><EOL><DEDENT>continue<EOL><DEDENT>mobj = re.match('<STR_LIT>', <EOL>line, re.IGNORECASE)<EOL>if mobj:<EOL><INDENT>if mobj.group(<NUM_LIT:2>) == '<STR_LIT>':<EOL><INDENT>info_dict['<STR_LIT>'] = int(mobj.group(<NUM_LIT:1>))<EOL><DEDENT>elif mobj.group(<NUM_LIT:2>) == '<STR_LIT>':<EOL><INDENT>info_dict['<STR_LIT>'] = int(mobj.group(<NUM_LIT:1>))<EOL><DEDENT>elif mobj.group(<NUM_LIT:2>) == '<STR_LIT>':<EOL><INDENT>info_dict['<STR_LIT>'] = int(mobj.group(<NUM_LIT:1>))<EOL><DEDENT>continue<EOL><DEDENT><DEDENT>return info_dict<EOL>
Query Asterisk Manager Interface for Channel Stats.

        CLI Command - core show channels

        @return: Dictionary of statistics counters for channels.
            Number of active channels for each channel type.