nat: Look at the assignment command and remember on which timeslot the data is

This information will be needed when we are trying to forward
MGCP connections to and from the BSC through the IPA protocol.
diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c
index c7c6c41..1568230 100644
--- a/openbsc/src/nat/bsc_nat.c
+++ b/openbsc/src/nat/bsc_nat.c
@@ -193,6 +193,13 @@
 		case SCCP_MSG_TYPE_CREF:
 		case SCCP_MSG_TYPE_DT1:
 			con = patch_sccp_src_ref_to_bsc(msg, parsed, nat);
+			if (parsed->gsm_type == BSS_MAP_MSG_ASSIGMENT_RQST) {
+				if (con) {
+					if (bsc_mgcp_assign(con, msg) != 0)
+						LOGP(DNAT, LOGL_ERROR, "Failed to assign...\n");
+				} else
+					LOGP(DNAT, LOGL_ERROR, "Assignment command but no BSC.\n");
+			}
 			break;
 		case SCCP_MSG_TYPE_CC:
 			con = patch_sccp_src_ref_to_bsc(msg, parsed, nat);
@@ -401,7 +408,10 @@
 			break;
 		case SCCP_MSG_TYPE_RLC:
 			con = patch_sccp_src_ref_to_msc(msg, parsed, nat);
-			remove_sccp_src_ref(bsc, msg, parsed);
+			if (con) {
+				remove_sccp_src_ref(bsc, msg, parsed);
+				bsc_mgcp_clear(con);
+			}
 			break;
 		case SCCP_MSG_TYPE_UDT:
 			/* simply forward everything */