BUFFALO, N.Y. -- Federal prosecutors have agreed to dismiss charges against two men who initiated and recorded a telephone call between two NFL general managers this year and then sold the recording to a website.

In return for the dismissal, Joshua Barber and Nicholas Kaiser must abide by certain conditions for 18 months, U.S. Attorney William Hochul said Wednesday.

Kaiser's attorney, Rodney Personius, said the agreement includes some community service, but other conditions weren't disclosed.

"We're very pleased by the outcome," Personius said.

The charges of intentionally intercepting a wire communication could have carried up to five years in prison and a $500,000 fine.

The two 21-year-olds from Plymouth, Mass., didn't plan what happened, Personius said, when they began angling for an NFL tryout for Barber in March.

"On the other hand ... Mr. Kaiser deeply regrets the outcome," the attorney said.

Posing as Tampa Bay Buccaneers GM Mark Dominik, Kaiser and Barber dialed Buffalo Bills then-GM Buddy Nix, authorities said. But Barber, a Bills fan, got nervous and hung up when Nix picked up. Barber then dialed Dominik's office. While he was being connected, Nix called Barber's number back, thinking he had been disconnected from Dominik, according to court filings.

Barber used the call merge function on his iPhone to connect the two GMs and put them on speaker phone, allowing Kaiser to record the nearly six-minute conversation.

"Mark, dadgum, son, I've called you back 100 times," Nix tells Dominik on the recording, which Kaiser and Barber sold to Deadspin.com for $200.

"Have you?" asks Dominik.

The GMs, each thinking the other initiated the call, are heard complaining about free agency rules before Nix talks about his team's struggles with quarterback Ryan Fitzpatrick, who was later cut.

"You can't afford that kind of money for a guy that's fighting for probably a backup job," Nix said.

The Bills and Buccaneers, through team spokesmen, declined to comment on Wednesday. Barber declined to comment when called at home.