def getQueueStats(self):
if not self.hasQueue():<EOL><INDENT>return None<EOL><DEDENT>info_dict = {}<EOL>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>queue = None<EOL>ctxt = None<EOL>member_states = ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", <EOL>"<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", <EOL>"<STR_LIT>")<EOL>member_state_dict = dict([(k.lower().replace('<STR_LIT:U+0020>', '<STR_LIT:_>'),<NUM_LIT:0>) <EOL>for k in member_states]) <EOL>for line in cmdresp.splitlines():<EOL><INDENT>mobj = re.match(r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>"<EOL>r"<STR_LIT>", line)<EOL>if mobj:<EOL><INDENT>ctxt = None<EOL>queue = mobj.group(<NUM_LIT:1>)<EOL>info_dict[queue] = {}<EOL>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:2>))<EOL>try:<EOL><INDENT>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:3>))<EOL><DEDENT>except ValueError:<EOL><INDENT>info_dict[queue]['<STR_LIT>'] = None<EOL><DEDENT>info_dict[queue]['<STR_LIT>'] = mobj.group(<NUM_LIT:4>)<EOL>for tkn in mobj.group(<NUM_LIT:5>).split('<STR_LIT:U+002C>'):<EOL><INDENT>mobjx = re.match(r"<STR_LIT>", tkn)<EOL>if mobjx:<EOL><INDENT>info_dict[queue]['<STR_LIT>' + mobjx.group(<NUM_LIT:2>)] = int(mobjx.group(<NUM_LIT:1>))<EOL><DEDENT><DEDENT>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:6>))<EOL>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:7>))<EOL>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:8>))<EOL>info_dict[queue]['<STR_LIT>'] = float(mobj.group(<NUM_LIT:9>))<EOL>info_dict[queue]['<STR_LIT>'] = int(mobj.group(<NUM_LIT:10>))<EOL>info_dict[queue]['<STR_LIT>'] = member_state_dict.copy() <EOL>continue<EOL><DEDENT>mobj = re.match('<STR_LIT>', line)<EOL>if mobj:<EOL><INDENT>ctxt = mobj.group(<NUM_LIT:1>).lower()<EOL>continue<EOL><DEDENT>if ctxt == '<STR_LIT>':<EOL><INDENT>mobj = re.match(r"<STR_LIT>", line)<EOL>if mobj:<EOL><INDENT>info_dict[queue]['<STR_LIT>']['<STR_LIT>'] += <NUM_LIT:1><EOL>state = mobj.group(<NUM_LIT:1>).lower().replace('<STR_LIT:U+0020>', '<STR_LIT:_>')<EOL>if state in info_dict[queue]['<STR_LIT>']:<EOL><INDENT>info_dict[queue]['<STR_LIT>'][state] += <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>raise AttributeError("<STR_LIT>"<EOL>% state)<EOL><DEDENT>continue<EOL><DEDENT><DEDENT><DEDENT>return info_dict<EOL>
Query Asterisk Manager Interface for Queue Stats.

        CLI Command: queue show

        @return: Dictionary of queue stats.