Sunan Abi Dawud Book 2, Hadith 96
A man entered the mosque on camel and made it kneel down, and then tied his leg with rope. He then asked: Who among you is Muhammad? The Messenger of Allah (May peace be upon him) was sitting leaning upon something among them. We said to him: This white (man) who is leaning. The man said: O son of ‘Abd al-Muttalib. The Prophet (peace be upon him) said; I already responded to you. The man (again) said: O Muhammad. I am asking you. The narrator then narrated the rest of the tradition.
We came to Jabir ibn Abdullah who was sitting in his mosque. He said: The Messenger of Allah (ﷺ) came to us in this mosque and he had a twig of date-palm of the kind of Ibn Tab. He looked and saw phlegm on the wall towards qiblah. He turned to it and scraped it with the twig.
He then said: Who of you likes that Allah turns His face from him? He further said: When any of you stands for praying, Allah faces him. So he should not spit before him, nor on his right side. He should spit on his left side under his left foot. If he is in a hurry (i.e. forced to spit immediately), he should do with his cloth in this manner. He then placed the cloth on his mouth and rubbed it off.
He then said: Bring perfume. A young man of the tribe stood and hurried to his house and returned with perfume in his palm. The Messenger of Allah (ﷺ) took it and put it at the end of the twig. He then stained the mark of phlegm with it.
Jabir said: This is the reason you use perfume in your mosques.
Banu Sa’d b. Bakr sent Qamam b. Tha’labah to the apostle of Allah (May peace be upon him). He came to him and made his camel kneel down near the gate of the mosque. He then tied its leg and entered the mosque. The narrator then reported in a similar way. He then said: Who among you is the son of Abd al-Muttalib? The Messenger of Allah (May peace be upon him) replied: I am the son of Ibn ‘Abd al-Muttalib. He said: O son of ‘Abd al-Muttalib. The narrator then reported the rest of the tradition.