From James Bamford, "They Know Much More Than You Think," New York Review of Books:
Looking back, the NSA and its predecessors have been gaining secret, illegal access to the communications of Americans for nearly a century. On July 1, 1920, a slim balding man in his early thirties moved into a four-story townhouse at 141 East 37th Street in Manhattan. This was the birth of the Black Chamber, the NSA’s earliest predecessor, and it would be hidden in the nondescript brownstone. But its chief, Herbert O. Yardley, had a problem. To gather intelligence for Woodrow Wilson’s government, he needed access to the telegrams entering, leaving, and passing through the country, but because of an early version of the Radio Communications Act, such access was illegal. With the shake of a hand, however, Yardley convinced Newcomb Carlton, the president of Western Union, to grant the Black Chamber secret access on a daily basis to the private messages passing over his wires—the Internet of the day.
For much of the next century, the solution would be the same: the NSA and its predecessors would enter into secret illegal agreements with the telecom companies to gain access to communications.