  Assuming the Riemann hypothesis, we improve the current upper and lower
bounds for the average value of Montgomery's function $F(\alpha, T)$ over long
intervals by means of a Fourier optimization framework. The function $F(\alpha,
T)$ is often used to study the pair correlation of the non-trivial zeros of the
Riemann zeta-function. Two ideas play a central role in our approach: (i) the
introduction of new averaging mechanisms in our conceptual framework and (ii)
the full use of the class of test functions introduced by Cohn and Elkies for
the sphere packing bounds, going beyond the usual class of bandlimited
functions. We conclude that such an average value, that is conjectured to be
$1$, lies between $0.9303$ and $1.3208$. Our Fourier optimization framework
also yields an improvement on the current bounds for the analogous problem
concerning the non-trivial zeros in the family of Dirichlet $L$-functions.
