On a generalization of the trigonometric moment problem