Recovery of ammonia from wastewater through chemical precipitation