At this time Joab had been fighting against the Ammonite town of Rabbah, and had captured the royal fortress.