Photonic-bandgap microcavities in optical waveguides