A traffic stop is its own thing. You've presumably given them probable suspicion that you've committed some sort of infraction. Everything from something very innocuous like weaving within your lane to them seeing you run a red light. You're officially being detained, you're not free to go, and you have to answer their questions. Depending on your state, their questions may have to be related to the original purpose of the traffic stop unless they've got probably suspicion of some other infraction.
Nobody with a law degree has ever suggested that at a traffic stop you start off by saying you're not answering questions and to call your lawyer.