EchoStar has agreed to sell $23 billion worth of spectrum licenses to AT&T in a deal spurred by threats made by the Federal Communications Commission to revoke EchoStar’s rights to use the spectrum.