Any person, party or witness, who disobeys an order of the court or judge or referee, duly served, may be punished by the judge as for a contempt. In all cases of commitment under this Article the person committed may, in case of inability to perform the act required, or to endure the imprisonment, be discharged from imprisonment by the judge committing him, or the judge having jurisdiction, on such terms as are just.
N.C. Gen. Stat. § 1-368