Phonon-assisted transitions from quantum dot excitons to cavity photons