text: One thing that can work, if there is a hallway outside the offices, is simply to put up a brightly coloured "Shhh... Please be quiet!" sign outside the office. Make sure it's very visible: one university I was at complained that even a sign in the middle of the corridor wasn't working, so they put up a red flashing bicycle light on top of the sign. They've rarely had problems since.
  Evidently, you should check for departmental permission before just putting up such a sign. However, if you can, it will have two major positive effects:
  Alerts people of the need for quiet. Frequently, when people are jabbering away, it's not because they want to disturb, it's just carelessness. They hadn't thought of the fact that silence is appreciated. My guess is that a sign will take care of 80-90% of the problems.