An energy-dependent amplitude analysis of ${\ensuremath{\pi}}^{\ifmmode\pm\else\textpm\fi{}}{\ensuremath{-}}^{12}\mathrm{C}$ elastic-scattering data in the pion energy range from 486 to 870 MeV was carried out. Using a careful treatment of Coulomb effects to describe the Coulomb nuclear interference together with the constraints from the ${\ensuremath{\pi}}^{\ifmmode\pm\else\textpm\fi{}}{\ensuremath{-}}^{12}\mathrm{C}$ forward amplitude ${f}_{0}$ by dispersion relations allows a stringent consistency check of the data. In general a satisfactory description of the data was achieved, but recent ${\ensuremath{\pi}}^{\ensuremath{-}}{\ensuremath{-}}^{12}\mathrm{C}$ elastic-scattering data need considerable normalization factors to fit into the framework. The still not measured ${\ensuremath{\pi}}^{+}{\ensuremath{-}}^{12}\mathrm{C}$ data as well as the ${\ensuremath{\pi}}^{\ifmmode\pm\else\textpm\fi{}}{\ensuremath{-}}^{12}\mathrm{C}$ data at 870 MeV are predicted. Phase shifts are calculated by partial wave projection of the amplitudes. The partial waves are summed up to obtain the total, total-elastic and total-inelastic cross sections.