Man sentenced to 20 years in prison for sodomy charges