In Fe-As based superconductors magnetism and superconductivity show strong sensitivity to the lattice, suggesting a possibility of unconventional electron-phonon coupling. We investigated c-axis polarized phonons in doped and undoped BaFe2As2 by inelastic X-ray scattering. Phonon peak positions and linewidths did not vary significantly as a function of doping either by Co or by K. The linewidth of the Fe vibration shows unusual wavevector-dependence, which may be due to hybridization with in-plane modes. Comparison with the density functional theory shows significant difference for the energy of the As-As vibrations (Raman active at the zone center) but not for the Fe-As vibrations (infrared-active at the zone center). This behavior cannot be explained by a 10% softening of Fe-As interaction strength as proposed previously for in-plane polarized vibrations.