(a) In any case in which the defendant has been convicted of a misdemeanor and is serving a sentence as a result of such conviction and there has been filed and is pending in another county a complaint charging him with a misdemeanor Vehicle Code violation, the defendant may appear before the court that sentenced him, and a magistrate of that court shall give such instructions to the defendant as required by law and inform the defendant of his rights under this section, and, if the defendant desires to plead guilty or nolo contendere to the charge in the complaint, he may so advise the magistrate. If the magistrate determines that such plea would be in the interest of justice, he shall direct the defendant to appear before a specified appropriate court in the county in which defendant is serving his sentence at a designated certain time for plea and sentencing. The magistrate shall request the court in which the complaint has been filed to transmit a certified copy of the complaint and any citation and any factual report which may have been prepared by the law enforcement agency that investigated the case to the court in which defendant is to appear for plea and sentencing. If the court of which the request is made deems such action to be in the interest of justice, and the district attorney of the county in which that court sits, after notice from the court of the request it has received, does not object to such action, the court shall immediately transmit a certified copy of the complaint and any report of the law enforcement agency that investigated the case, and, if not, shall advise the requesting magistrate of its decision not to take such action. When defendant appears for plea and sentencing, and if a copy of the complaint has been transmitted, the court shall read the copy of the complaint to him, and the defendant may plead guilty or nolo contendere. Such court shall have jurisdiction to accept the plea and impose a sentence. Such court shall notify the court in which the complaint was originally filed of the disposition of the case. If defendant does not plead guilty or nolo contendere, or if transmittal of a copy of the complaint has been refused or if a copy of the complaint has not been received, the court shall terminate the proceedings under this section and shall direct the defendant to appear before the court in which the complaint was filed and is pending on or before a certain day.