Re-pull #1061 into Ix 9.19.6 + #1813

See https://github.com/kaltura/server/pull/1061