How can I back out of a friendship that I no longer want to be in?

I met someone in my school awhile back over the phone. At first I enjoyed her conversations because we seemed to have a lot in common and we talked about what we are learning in school. But it started feeling uncomfortable very early on. She started texting me a lot and calling me a lot (we live in different states). If I didn’t return the text or call right away she would try again by the end of the day. It was becoming clear very quickly that I didn’t like how I felt after getting off the phone with her. When we talked, it was always about her and she would go on and on for a long time. Most of the time I would tell her I needed to get off the phone because I had something to do. She would call me her “coach” and was always wanting advice on what to do about different negative situations in her life. It was draining me and I felt uncomfortable. I know that I should have handled this very differently right from the start, and I allowed her to treat me in a way I didn’t want to be treated. I have since just stopped returning her texts and calls. I am wondering how I should have handled this in the beginning. In the first conversation when she got long-winded and sounded like she was just complaining and wanting my advice and making the phone call about her, what should I have said? It seems like it would rude to say, “You know what, if our phone calls are going to be an hour just talking about you and your problems then I do not want to engage in them.” Or, “I am not going to be your personal coach and that is what it feels like you are wanting from me.” But is this what I should have said?