Diffusion MRI can be used to probe restricted diffusion (compartment size) and water exchange (membrane permeability), but their effects on the signal are entangled. This problem can be addressed by the use of free gradient waveforms designed to disentangle the effects. However, a previously presented approach is invalid at high b-values and long diffusion encoding times. We develop a generalised restriction-exchange model that is valid for arbitrary gradient waveform and all relevant b-values and encoding times. The approach eliminates the shortcomings of the previous restriction-exchange framework.