Sayyiduna Abdullah bin Busr (may Allah be pleased with him) says that when the Prophet (peace and blessings be upon him) came to someone's door, he would stand by the wall to the right or the left, then seek permission; if it was given, well and good, otherwise he would return. This was at the time when there were no curtains on the doors, and while seeking permission he would say the greeting of peace (salam).
Hadith Referenceالسنن الكبرى للبيهقي / كتاب الأشربة والحد فيها / 17663