In investigating complaints of violations by common carriers of the laws prohibiting the giving or granting of rebates and prohibiting unjust discrimination in rates and charges, the commission may exercise the power and authority to compel the shipper or consignee, or any officer, agent, or employee of a common carrier to give evidence relating to such complaints. Before any such person shall be compelled to give evidence relating to such complaints, the commission shall make an order that such witness is required by the commission to testify and that he will be exempt thereafter from indictment or prosecution for any transaction about which he is compelled to testify. When such order is made, the witness shall be compelled to give evidence touching such complaints, and he shall be forever free from indictment or prosecution in any court touching the matters about which he is compelled to testify.