"I had been on the phone with my sister when the bell rang."
"I was on the phone with my sister when the bell rang."
Do these two sentences have the same meaning?
These have nearly the same meaning.
The first one implies that the action "had been on the phone" ended when (or before) the bell rang ... the most likely scenario is that the speaker ended her conversation and went to answer the door.
The second one doesn't imply that. So it's possible that the speaker ignored the bell and continued talking with her sister.
The sentence 'I had been on the phone with my sister when the bell rang' indicates that the action was already over when the bell rang.The sentence 'I was on the phone when the bell rang' indicates that the bell rang during the course of action.I hope this helped you.