def getVoicemailStats(self):
if not self.hasVoicemail():<EOL><INDENT>return None<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>info_dict = dict(accounts = <NUM_LIT:0>, avg_messages = <NUM_LIT:0>, max_messages = <NUM_LIT:0>, <EOL>total_messages = <NUM_LIT:0>)<EOL>for line in cmdresp.splitlines():<EOL><INDENT>mobj = re.match('<STR_LIT>', line)<EOL>if mobj:<EOL><INDENT>msgs = int(mobj.group(<NUM_LIT:1>))<EOL>info_dict['<STR_LIT>'] += <NUM_LIT:1><EOL>info_dict['<STR_LIT>'] += msgs<EOL>if msgs > info_dict['<STR_LIT>']:<EOL><INDENT>info_dict['<STR_LIT>'] = msgs<EOL><DEDENT><DEDENT><DEDENT>if info_dict['<STR_LIT>'] > <NUM_LIT:0>:<EOL><INDENT>info_dict['<STR_LIT>'] = (float(info_dict['<STR_LIT>']) <EOL>/ info_dict['<STR_LIT>'])<EOL><DEDENT>return info_dict<EOL>
Query Asterisk Manager Interface for Voicemail Stats.

        CLI Command - voicemail show users

        @return: Dictionary of statistics counters for Voicemail Accounts.