def __init__(self, host='<STR_LIT:127.0.0.1>', port=defaultAMIport, <EOL>user=None, password=None, autoInit=True):
<EOL>self._conn = None<EOL>self._amihost = host or '<STR_LIT:127.0.0.1>'<EOL>self._amiport = int(port or defaultAMIport)<EOL>self._amiuser = user<EOL>self._amipass = password<EOL>self._ami_version = None<EOL>self._asterisk_version = None<EOL>self._modules = None<EOL>self._applications = None<EOL>self._chantypes = None<EOL>if autoInit:<EOL><INDENT>if self._amiuser is None or self._amipass is None:<EOL><INDENT>if not(self._parseFreePBXconf() or self._parseAsteriskConf()):<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT><DEDENT>self._connect()<EOL>self._getGreeting()<EOL>self._login()<EOL>self._initAsteriskVersion()<EOL><DEDENT>
Initialize connection to Asterisk Manager Interface.

        @param host:     Asterisk Host
        @param port:     Asterisk Manager Port
        @param user:     Asterisk Manager User
        @param password: Asterisk Manager Password
        @param autoInit: If True connect to Asterisk Manager Interface on 
                         instantiation.