bsc_api: Move gsm48_rcvmsg into the BSC API and dispatch.

The next step in the way to the BSC API. We have a clear a
new connection was opened signal now... and the MSC could
use it...
diff --git a/openbsc/src/bsc_api.c b/openbsc/src/bsc_api.c
index 28fc324..02fc473 100644
--- a/openbsc/src/bsc_api.c
+++ b/openbsc/src/bsc_api.c
@@ -27,6 +27,7 @@
 #include <openbsc/gsm_data.h>
 #include <openbsc/signal.h>
 #include <openbsc/abis_rsl.h>
+#include <openbsc/chan_alloc.h>
 
 #include <osmocore/talloc.h>
 
@@ -84,6 +85,27 @@
 	return work;
 }
 
+int gsm0408_rcvmsg(struct msgb *msg, uint8_t link_id)
+{
+	int rc;
+	struct gsm_subscriber_connection *conn;
+	struct bsc_api *api = msg->lchan->ts->trx->bts->network->bsc_api;
+
+	conn = &msg->lchan->conn;
+	if (conn->allocated) {
+		api->dtap(conn, msg);
+	} else {
+		/* accept the connection or close the lchan */
+		rc = api->compl_l3(conn, msg, 0);
+		if (rc == BSC_API_CONN_POL_ACCEPT)
+			conn->allocated = 1;
+		else
+			lchan_auto_release(msg->lchan);
+	}
+
+	return 0;
+}
+
 static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id)
 {
 	struct bsc_api *api;