Pseudohermitian invariants and classification of CR mappings in generalized ellipsoids