I am guessing you went to prison because your agent violated you after you received the ticket. Meaning, the prison term was not a direct result of the traffic ticket rather a parole violation term. If that is true and your court date was during your prison term, than when you got out you should have gone to the clerk’s office of the correct courthouse and requested to go in front of the judge and ask for a dismissal. Of course, as the above attorney said, this applies if your ticket was not for a DUI.
Vehicle Code Section 41500 is the law that requires traffic cases be dismissed against people who are sent to prison for another matter. You need to get your traffic cases before a judge. Go to the traffic court and ask that your cases be placed on calendar. Be sure to bring as much paperwork as you have regarding your prison commitment. Explain the situation to the judge and ask that the cases be dismissed.