"The Messenger of Allah (ﷺ) sent me on an errand, then I came back to him while he was facing the east or the west. I greeted him with salam and he gestured to me. Then when he finished he called me and said: "O Jabir!" So I came and said: "O Messenger of Allah, I greeted you with Salam but you did not answer." He said: 'I was praying.'
Sunan an-Nasa'i Book 13, Hadith 12