def parse_agi_result(line):
<EOL>if line == '<STR_LIT>':<EOL><INDENT>return {'<STR_LIT:error>': '<STR_LIT>',<EOL>'<STR_LIT>': '<STR_LIT>'}<EOL><DEDENT>kwargs = dict(code=<NUM_LIT:0>, response="<STR_LIT>", line=line)<EOL>m = re_code.search(line)<EOL>try:<EOL><INDENT>kwargs.update(m.groupdict())<EOL><DEDENT>except AttributeError:<EOL><INDENT>pass<EOL><DEDENT>return agi_code_check(**kwargs)<EOL>
Parse AGI results using Regular expression.

    AGI Result examples::

        100 result=0 Trying...

        200 result=0

        200 result=-1

        200 result=132456

        200 result= (timeout)

        510 Invalid or unknown command

        520-Invalid command syntax. Proper usage follows:
        int() argument must be a string, a bytes-like object or a number, not
        'NoneType'

        HANGUP