Gamma-ray spectroscopy measurements of confined fast ions on ASDEX Upgrade