Measurement of hadronic cross sections with BABAR