It was always the practice of Holy Prophet (S.A.W) to bury the dead upon finding them. During the Battle of Badr, the number of corpses of the disbelievers numbered too many to be placed into individual graves, He (S.A.W) therefore ordered for all to be put into a disused Well in Badr.

The corpses were dragged inside by the Sahaba except for Umaya bin Khalf, whose body became severely decomposed at a very early stage. While being pulled towards the Well his body parts began to detach from each other and was therefore buried in the sand where he laid. (Bukhari Shareef, Vol. 2, Pg. 566)

Addressing the corpses of the Kuffaar

After the bodies were placed into the Well, Rasoolullah (S.A.W) stood at a comer and said (while addressing them by their names), "O’ Utba bin Rabia, O’ Abu Jahl etc; have you found your Lord's promise to be true?"

When Hadrat Umar Farooq (R.A) saw this he became surprised and said, "Ya Rasoolullah (S.A.W) are you speaking to lifeless bodies?" He (S.A.W) replied, "O’ Umar! By Allah (S.W.T) in whose control is my life, indeed the dead hear me more clearly than you, but they do not answer back." (Bukhari Shareef, Vol. 1, Pg. 183 & Vol. 2, Pg. 566)

IIt has been proven from authentic Ahadith such as Bukhari Shareef that the dead of the disbelievers hear the living. Then indeed the Mu'mins - especially the Ambiya (Prophets), Shuhada (Martyr) and Auliya Allah (Friends of Allah) can hear our salaam after their demise.

The above mentioned Hadith has also proven that the Holy Prophet (S.A.W) called out to the dead of the Quraish. If calling out to the Kuffaar is permissible then surely to call out to the Ambiya, Auliya and Shaheed after their demise is also permissible.

Rasoolullah (S.A.W) used to visit the cemetery of Madina Shareef (Janathul Baqi) and used to face the graves and say, “O’ people of the graves, peace be upon you. May Allah (S.W.T) forgive you and us as well. You have preceded us to the graves and we shall follow towards it soon”. (Mishkaat Shareef, Chapter Ziyaaratil-Quboor)