I know there are some products out there to control when the dog "talks". There's a collar that sprays water up when the dog barks or something. Apparently, it works well but I've never tried it myself.

Kai does a bit of this too. He likes to 'talk' to the dog then when he gets there, he's really nice. He's gotten better but when he was bad, I used a halti. When he pulls to go to the other dog, the halti closes, therefore not allowing him to bark. He then has no choice but to walk nicely with me to greet the other dog politely.