(a) Any parent, relative, or other person, agency, organization or institution claiming the right to custody of a minor child may institute an action or proceeding for the custody of such child, as hereinafter provided. Any person whose actions resulted in a conviction under G.S. 14-27.2 or G.S. 14-27.3 and the conception of the minor child may not claim the right to custody of that minor child. Unless a contrary intent is clear, the word "custody" shall be deemed to include custody or visitation or both.
(a1) Notwithstanding any other provision of law, any person instituting an action or proceeding for custody ex parte who has been convicted of a sexually violent offense as defined in G.S. 14-208.6(5) shall disclose the conviction in the pleadings.
(b) Whenever it appears to the court, from the pleadings or otherwise, that an action involves a contested issue as to the custody or visitation of a minor child, the matter, where there is a program established pursuant to G.S. 7A-494, shall be set for mediation of the unresolved issues as to custody and visitation before or concurrent with the setting of the matter for hearing unless the court waives mediation pursuant to subsection (c). Issues that arise in motions for contempt or for modifications as well as in other pleadings shall be set for mediation unless mediation is waived by the court. Alimony, child support, and other economic issues may not be referred for mediation pursuant to this section. The purposes of mediation under this section include the pursuit of the following goals:
(1) To reduce any acrimony that exists between the parties to a dispute involving custody or visitation of a minor child;
(2) The development of custody and visitation agreements that are in the child's best interest;
(3) To provide the parties with informed choices and, where possible, to give the parties the responsibility for making decisions about child custody and visitation;
(4) To provide a structured, confidential, nonadversarial setting that will facilitate the cooperative resolution of custody and visitation disputes and minimize the stress and anxiety to which the parties, and especially the child, are subjected; and
(5) To reduce the relitigation of custody and visitation disputes.
(c) For good cause, on the motion of either party or on the court's own motion, the court may waive the mandatory setting under Article 39A of Chapter 7A of the General Statutes of a contested custody or visitation matter for mediation. Good cause may include, but is not limited to, the following: a showing of undue hardship to a party; an agreement between the parties for voluntary mediation, subject to court approval; allegations of abuse or neglect of the minor child; allegations of alcoholism, drug abuse, or domestic violence between the parents in common; or allegations of severe psychological, psychiatric, or emotional problems. A showing by either party that the party resides more than fifty miles from the court may be considered good cause.
(d) Either party may move to have the mediation proceedings dismissed and the action heard in court due to the mediator's bias, undue familiarity with a party, or other prejudicial ground.
(e) Mediation proceeding shall be held in private and shall be confidential. Except as provided in this Article, all verbal or written communications from either or both parties to the mediator or between the parties in the presence of the mediator made in a proceeding pursuant to this section are absolutely privileged and inadmissible in court. The mediator may assess the needs and interests of the child, and may interview the child or others who are not parties to the proceedings when he or she thinks appropriate.
(f) Neither the mediator nor any party or other person involved in mediation sessions under this section shall be competent to testify to communications made during or in furtherance of such mediation sessions; provided, there is no privilege as to communications made in furtherance of a crime or fraud. Nothing in this subsection shall be construed as permitting an individual to obtain immunity from prosecution for criminal conduct or as excusing an individual from the reporting requirements of Article 3 of Chapter 7B of the General Statutes or G.S. 108A-102.
(g) Any agreement reached by the parties as a result of the mediation shall be reduced to writing, signed by each party, and submitted to the court as soon as practicable. Unless the court finds good reason not to, it shall incorporate the agreement in a court order and it shall become enforceable as a court order. If some or all of the issues as to custody or visitation are not resolved by mediation, the mediator shall report that fact to the court.
(h) If an agreement that results from mediation and is incorporated into a court order is referred to as a "parenting agreement" or called by some similar name, it shall nevertheless be deemed to be a custody order or child custody determination for purposes of Chapter 50A of the General Statutes, G.S. 14-320.1, G.S. 110-139.1, or other places where those terms appear.
(i) If the child whose custody is the subject of an action under this Chapter also is the subject of a juvenile abuse, neglect, or dependency proceeding pursuant to Subchapter 1 of Chapter 7B of the General Statutes, then the custody action under this Chapter is stayed as provided in G.S. 7B-200.