I believe we should be slow to ask for someone's phone number. It's far preferable, I think, to wait for the other person to offer their phone number, if they so desire. I'm trying to think of what would be a good reason to request someone's phone number, and I don't see too many circumstances that make it appropriate. If I sense that a potential friendship may be budding, I'ld be more likely to hand the person a paper or card with my number on it and say, "Feel free to give me a call, if blah-blah-blah." (Like - "if you need a ride," or "if you have any questions about the job," or "if there's anything I can do for you.") This respects the other person's privacy. It leaves them in control of how they want to manage a boundary, without putting them in an awkward position. I've really appreciated when others have handed me their phone number with an invitation to call on them should I need or want to.
As I think about it, I have to say that it's very rare that I would ever consider it polite to ask someone for their phone number. It's kind of like inviting yourself to their home.
Phoning someone is very much like showing up at their door. I would never assume someone wants me to do that.