Have a look at my answer at Re: Cisco Telnet.
In reply to Re^7: Cisco Telnet by McA in thread Cisco Telnet by mvip