Orange County prosecutors obtained improper phone recordings of jail inmates and their attorneys in eight criminal cases, including one that was dismissed, according to court testimony Monday that added fuel to the growing fire over the alleged breach of confidentiality.

The testimony came during a hearing in the attempted murder case against Joshua Waring, the son of a former cast member of “The Real Housewives of Orange County” reality television show, Lauri Peterson.

Waring’s attorney, Joel Garson, said Monday the recordings didn’t surface until the jail’s phone provider, GTL Corp., notified sheriff’s officials as part of Waring’s case that it had inadvertently recorded attorney-client calls during a three-year period that ended in July.

The number of recorded calls has changed repeatedly over the last few months, most recently set at nearly 34,000 recordings, with 347 of them accessed by sheriff’s personnel. At least eight of those recordings were given to prosecutors, testified Deputy District Attorney Denise Hernandez of the office’s Special Investigations Unit.

Said Garson: “I’m shocked eight different cases have ended up with tapes in the D.A.’s file and nobody mentioned it until (Waring’s) case in June.”

One domestic violence case was dismissed Oct. 18 after phone recordings were obtained by a prosecutor. A memo from the District Attorney’s Office said the prosecutor didn’t remember requesting the recordings, but said he may have been trying to see if the defense lawyer advised the defendant to threaten the victim.

Another defendant, Lonnie Koncontes, who is accused of killing his ex-wife on an Italian cruise in 2006, was improperly recorded twice talking with an attorney, once by GTL in a Florida jail and again by GTL in Orange County. Deputy District Attorney Susan Price testified Monday that she ordered copies of the Florida recordings, although it was unclear if she knew beforehand of the attorney-client conversation.

An attorney-client phone call was also recorded in the case of Hossein Nayeri, one of three inmates who escaped in January 2016 from the jail and avoided capture for a week. Nayeri, awaiting trial on kidnapping and torture charges, had been compared to fictional cannibalistic killer Hannibal Lecter. In that case, prosecutor Cynthia Nichols immediately notified the defense and turned the recording over to the judge.

Also among the eight recordings obtained by prosecutors are discussions between Michael Saenz — indicted in a criminal traffic case — and his attorney.

Waring’s case was not among the eight recordings. But he believes prosecutors listened to his legally confidential conversations and is seeking to dismiss charges that he shot at a man at a Costa Mesa sober living home.