How is RS232 cabling pinned out? What does each pin do?

The number preceding each signal name corresponds to the pin number defined in the standard.

DB9

  1.     Received Line Signal Detect (Carrier Detect)
  2.     Received Data
  3.     Transmitted Data
  4.     Data Terminal Ready
  5.     Signal Ground
  6.     Data Set Ready
  7.     Request to Send
  8.     Clear To Send
  9.     Ring Indicator

DB25

  1.     Protective Ground
  2.     Transmitted Data
  3.     Received Data
  4.     Request to Send
  5.     Clear To Send
  6.     Data Set Ready
  7.     Signal Ground
  8.     Received Line Signal Detect (Carrier Detect)
  9.     +P (for testing only)
  10.     -P (for testing only)
  11.     (unassigned)
  12.     Secondary Received Line Signal Detect
  13.     Secondary Clear To Send
  14.     Secondary Transmitted Data
  15.     Transmission signal element Timing
  16.     Secondary Received Data
  17.     Receiver Signal Element Timing
  18.     (unassigned)
  19.     Secondary Request To Send
  20.     Data Terminal Ready
  21.     Signal Quality Detector
  22.     Ring Indicator
  23.     Data Signal Rate Selector
  24.     Transmitter Signal Element Timing
  25.     (unassigned)