If a person comes into this state in obedience to a summons directing the person to attend and testify in a criminal prosecution in this state, the person shall not be subject, while in this state pursuant to such summons, 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.
31-03-31. Witness passing through state to testify in other state exempt from arrest and service of process. 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.