If the presence of a defendant on trial for an infraction or a misdemeanor, who is voluntarily absent, is necessary for any purpose, the court, upon application of the state's attorney or other person appointed to prosecute, may make an order or warrant requiring the personal attendance of the defendant at the trial.
N.D.C.C. § 29-16-05