Meanwhile, Joab was fighting against Rabbah, the capital of Ammon, and he captured the royal fortifications.