Measuring strong and weak phases in time-independent B decays