If a judge of a court of record in any state, which by its laws has made provision for commanding persons within that state to attend and testify in this state, certifies under the seal of the court that there is a criminal prosecution pending in the court, or that a grand jury investigation has commenced or is about to commence, and that a person being within this state is a material witness in the prosecution or grand jury investigation, and that the witness’s presence will be required for a specified number of days, upon presentation of the certificate to any judge of a court of record in the county in which the person is found, the judge shall fix a time and place for a hearing, and shall make an order directing the witness to appear at a time and place certain for the hearing.