If a person passes through this state while going to another state in obedience to a summons to attend and testify in a criminal prosecution in that state or while returning therefrom, the person, while passing through this state, shall not be subject to arrest or the service of process, civil or criminal, in connection with matters which arose before the person's entrance into this state under the summons.
N.D.C.C. § 31-03-31