The provisions of section 791 apply, with such modification as may be necessary for the purpose of securing the attendance of a person confined in any correctional facility, who is required to give evidence at the hearing of any charge for a summary offence.