BANGKOK — A school bookkeeper in Indonesia who recorded her boss’s lewd phone call as proof she was being harassed must serve at least six months in prison for distributing obscene material, the country’s Supreme Court has ruled.

Nuril Maknun, 41, who worked as a part-time bookkeeper at a high school on the religiously conservative island of Lombok, said on Friday that she was disappointed by the court’s ruling, which she called an “obvious injustice.” It was her final appeal in a case that has been closely followed across the country, and which became an issue during the recent presidential election.

“I, as a woman, should be protected, but then I was the one who became the victim,” she said in a telephone interview. “People should know that when we get harassed, there is no place to take refuge.”

Her boss, who goes by the single name Muslim, as is common in Indonesia, was the principal at Senior High School Seven in Mataram, Lombok’s largest city. Ms. Nuril recorded him using explicit language and hounding her to have an affair. He was never punished for harassing her and instead has been promoted repeatedly.