Add function to update TRAU muxer after assignment or handover

E1 based BTS use TRAU muxer to decode TRAU frames. After changing
channel from one timeslot to another (due to handover or assignment),
the TRAU muxer must be updated. The call reference of the call is
disconnected from the old channel and connected to the new channel.
diff --git a/openbsc/src/libbsc/handover_logic.c b/openbsc/src/libbsc/handover_logic.c
index 9cf26af..36a758b 100644
--- a/openbsc/src/libbsc/handover_logic.c
+++ b/openbsc/src/libbsc/handover_logic.c
@@ -39,6 +39,7 @@
 #include <openbsc/signal.h>
 #include <osmocom/core/talloc.h>
 #include <openbsc/transaction.h>
+#include <openbsc/trau_mux.h>
 
 struct bsc_handover {
 	struct llist_head list;
@@ -264,6 +265,10 @@
 
 	osmo_timer_del(&ho->T3103);
 
+	/* switch TRAU muxer for E1 based BTS from one channel to another */
+	if (is_e1_bts(new_lchan->conn->bts))
+		switch_trau_mux(ho->old_lchan, new_lchan);
+
 	/* Replace the ho lchan with the primary one */
 	if (ho->old_lchan != new_lchan->conn->lchan)
 		LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n");
@@ -278,8 +283,6 @@
 	rsl_lchan_set_state(ho->old_lchan, LCHAN_S_INACTIVE);
 	lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END);
 
-	/* do something to re-route the actual speech frames ! */
-
 	llist_del(&ho->list);
 	talloc_free(ho);