Apple iPhone 3GS pinouts
The connector/pinout information may be applied to the Apple model iPhone 3GS

 Apple iPhone (1G, 3G, 3GS, 4, 4S) Dock cable connector pinout Used in iPhone (1G, 3G and 3GS) mobile phones for  charging, connecting to a PC via USB or Firewire, to a stereo via line-out, to a serial device (controlled via the Apple Accessory Protocol).
Apple iPhone (1G, 3G, 3GS, 4, 4S) Dock cable connector pinout Used in iPhone (1G, 3G and 3GS) mobile phones for  charging, connecting to a PC via USB or Firewire, to a stereo via line-out, to a serial device (controlled via the Apple Accessory Protocol). iPod Nano (4th, 5th Gen), iPhone (1st, 2nd, 3rd, 4th Gen), iPod Shuffle (3rd Gen), Cell Phone Connection pinout iPhone headphone (handsfree)
iPod Nano (4th, 5th Gen), iPhone (1st, 2nd, 3rd, 4th Gen), iPod Shuffle (3rd Gen), Cell Phone Connection pinout iPhone headphone (handsfree) Apple iPod, iPhone (2g, 3g), iPad Dock connector pinout Used in 3rd and later generation iPods for  charging, connecting to a PC via USB or Firewire,  to a stereo via line-out, to a serial device (controlled via the Apple Accessory Protocol). This connector exists in most Apple iPod MP3 players (iPod 3G, 4G, 5G Video, 5.5G Video, Nano (1G, 2G, 3G, 4G), Mini, Classic, Touch, Touch 2G, and iPhone (1G, 3G, 3GS, 4 and 4S))
Apple iPod, iPhone (2g, 3g), iPad Dock connector pinout Used in 3rd and later generation iPods for  charging, connecting to a PC via USB or Firewire,  to a stereo via line-out, to a serial device (controlled via the Apple Accessory Protocol). This connector exists in most Apple iPod MP3 players (iPod 3G, 4G, 5G Video, 5.5G Video, Nano (1G, 2G, 3G, 4G), Mini, Classic, Touch, Touch 2G, and iPhone (1G, 3G, 3GS, 4 and 4S)) Universal Apple-compatible CTIA Headset/Earphone 3.5mm Jack (LRGM) pinout for Samsung, HTC Hero, Blackberry and other cell phones with 3.5mm, 4 connection (4 "pin"), headset jack.
Universal Apple-compatible CTIA Headset/Earphone 3.5mm Jack (LRGM) pinout for Samsung, HTC Hero, Blackberry and other cell phones with 3.5mm, 4 connection (4 "pin"), headset jack.