A man called out to another at al-Baqi, "Abu Qasim!" The Messenger of Allah turned toward him, and the man said, "Messenger of Allah, I did not mean you. I was only calling so-and-so."The Messenger of Allah ﷺ said, "Take my name, but do not take my kunyah."
نادى رجل رجلا بالبقيع يا أبا القاسم، فالتفت إليه رسول الله، فقال يا رسول الله، إني لم أعنك، إنما دعوت فلانا، فقال رسول الله ﷺ: تسموا باسمي، ولا تكنوا بكنيتي.
Bukhari narrated it in the Book of Sales (2121), and Muslim in the Book of Manners (2131), both through routes from Humayd, from Anas, as mentioned. The wording given here is Muslim's.