I see a lot of examples for the "Perfect Negotiation" pattern, but I don't understand how to define the polite and impolite peer? Should I always use for example polite for the peer, which starts the communication? What would be the best way?
You need to assign one of the peers to be polite and the other to be impolite. It doesn't matter how you choose them.
For example you might assign a polite role to the first peer that starts the negotiation and impolite to the other. Or do this the other way around.
Or you can generate a random caller id on each side and make it so whoever has the higher id is polite and the other is impolite.
See this explanation in Mozilla docs:
How you determine which peer is polite and which is impolite is generally up to you. It could be as simple as assigning the polite role to the first peer to connect to the signaling server, or you could do something more elaborate like having the peers exchange random numbers and assigning the polite role to the winner. However you make the determination, once these roles are assigned to the two peers, they can then work together to manage signaling in a way that doesn't deadlock and doesn't require a lot of extra code to manage.