(a) A witness who is sworn and who appears before a magistrate is subject to the penalties for perjury and aggravated perjury provided by law.
(b) A referring court may fine or imprison a witness or other court participant for failure to appear after being summoned, refusal to answer questions, or other acts of direct contempt before a magistrate.