(1) A person commits the offense of obstruction of justice if the person intentionally:
(a) When called as a witness and having been granted immunity pursuant to chapters 480 and 621C, before or after having been qualified as a witness, refuses to testify or be qualified as a witness when duly directed to testify or be qualified as a witness; or
(b) Influences; obstructs; impedes; or endeavors to influence, obstruct, or impede, the due administration of justice by means of force, threat of force, coercion, fraud, or deception.
(2) Obstruction of justice shall be a class C felony; provided that if the person engaged in activity under subsection (1)(b), obstruction of justice shall be a class B felony.