def _connect(self):
try:<EOL><INDENT>if sys.version_info[:<NUM_LIT:2>] >= (<NUM_LIT:2>,<NUM_LIT:6>):<EOL><INDENT>self._conn = telnetlib.Telnet(self._amihost, self._amiport, <EOL>connTimeout)<EOL><DEDENT>else:<EOL><INDENT>self._conn = telnetlib.Telnet(self._amihost, self._amiport)<EOL><DEDENT><DEDENT>except:<EOL><INDENT>raise Exception(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>% (self._amihost, self._amiport)<EOL>)<EOL><DEDENT>
Connect to Asterisk Manager Interface.