Buried in the user’s manual (PDF) for the iPhone is the following:
Using iPhone with a Teletype (TTY) Machine
Teletype (TTY) machines are used by the hearing impaired to communicate by typing and reading text. If you have the iPhone TTY Adapter cable, available at www.apple.com/store, you can use iPhone with a TTY machine.
Connect iPhone to a TTY machine
From the Home screen choose Settings → Phone, then turn TTY on. Then connect iPhone to your TTY machine using the adapter cable.
For information about using the TTY machine, see the documentation that came with the machine.
Yes, you can plug in an external TTY and it will work. You need an adapter, typically overpriced for Apple at $19. (I bet it’s a standard jack converter you could get somewhere else.)
I suppose this is halfway decent, but if the iPhone has a TTY mode and a keyboard, why doesn’t it work as a self-contained TTY? (Presumably it uses only the so-called ASCII telecommunications protocol, not the ancient Baudot.) We’ve already got complaints from deaf people about the lack of iChat and captioning.
UPDATE, 2007.07.03: On second thought, I suspect TTY mode at present merely allows passthrough of signals from your external TTY. For the iPhone to transmit TTY tones would require either a software encoder of some kind or a chip that supports the ostensibly standard but actually obscure V.18 specification. I wouldn’t expect either of those before iPhone 2.0, if ever.