CBS  (CBS) - Get Report and AT&T (T) - Get Report on Thursday announced they have cut a deal for a new multi-year content carriage agreement, ending a 20 day-long blackout that began when the previous, seven-year deal expired.

The agreement includes re-transmission consent for all 26 CBS-owned stations in 17 U.S. markets including New York, Los Angeles, Chicago and San Francisco, the companies said. Terms of the agreement weren't disclosed.

Because of the contract dispute, CBS stations had been dark for more than 6.5 million DirecTV, DirecTV Now and AT&T U-verse customers as of 2 a.m. ET July 19.

The companies had been negotiating over pricing as well as whether AT&T could sell CBS' All-Access streaming service as a separate option, and whether CBS would be required to produce programming such as the Grammy Awards in a higher-than-typical 4K resolution, sources familiar with the negotiations told Reuters.

They had also been negotiating on whether CBS would provide AT&T with past episodes and entire seasons of shows, and whether CBS content would be available to all DirecTV consumers, according to the sources.

CBS is expected to report second-quarter earnings of $1.13 a share on revenue of $3.7 billion when it announces its results after the closing bell Thursday.

Shares of CBS were up 2.72% at $50.52. Shares of AT&T were up 0.38% at $34.21.

AT&T is a holding in Jim Cramer's Action Alerts PLUS member club. Want to be alerted before Jim Cramer buys or sells T? Learn more now.