def getTrunkStats(self, trunkList):
re_list = []<EOL>info_dict = {}<EOL>for filt in trunkList:<EOL><INDENT>info_dict[filt[<NUM_LIT:0>]] = <NUM_LIT:0><EOL>re_list.append(re.compile(filt[<NUM_LIT:1>], re.IGNORECASE))<EOL><DEDENT>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>for line in cmdresp.splitlines():<EOL><INDENT>for idx in range(len(re_list)):<EOL><INDENT>recomp = re_list[idx]<EOL>trunkid = trunkList[idx][<NUM_LIT:0>]<EOL>mobj = recomp.match(line)<EOL>if mobj:<EOL><INDENT>if len(trunkList[idx]) == <NUM_LIT:2>:<EOL><INDENT>info_dict[trunkid] += <NUM_LIT:1><EOL>continue<EOL><DEDENT>elif len(trunkList[idx]) == <NUM_LIT:4>:<EOL><INDENT>num = mobj.groupdict().get('<STR_LIT>')<EOL>if num is not None:<EOL><INDENT>(vmin,vmax) = trunkList[idx][<NUM_LIT:2>:<NUM_LIT:4>]<EOL>if int(num) >= int(vmin) and int(num) <= int(vmax):<EOL><INDENT>info_dict[trunkid] += <NUM_LIT:1><EOL>continue<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>return info_dict<EOL>
Query Asterisk Manager Interface for Trunk Stats.

        CLI Command - core show channels

        @param trunkList: List of tuples of one of the two following types:
                            (Trunk Name, Regular Expression)
                            (Trunk Name, Regular Expression, MIN, MAX)
        @return: Dictionary of trunk utilization statistics.