From ca5c022a3278194ba4a1d8235a31e7cc94f12f42 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 6 Nov 2010 23:35:02 +0100 Subject: bsc: Implement sending a message toward the MSC. --- openbsc/src/bsc/osmo_bsc_sccp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'openbsc') diff --git a/openbsc/src/bsc/osmo_bsc_sccp.c b/openbsc/src/bsc/osmo_bsc_sccp.c index f7f30e10d..b397b095e 100644 --- a/openbsc/src/bsc/osmo_bsc_sccp.c +++ b/openbsc/src/bsc/osmo_bsc_sccp.c @@ -115,7 +115,15 @@ static int msc_sccp_read(struct msgb *msgb, unsigned int length, void *data) int bsc_queue_for_msc(struct gsm_subscriber_connection *conn, struct msgb *msg) { - LOGP(DMSC, LOGL_ERROR, "Sending SCCP messages is not yet implemented.\n"); + struct sccp_connection *sccp = conn->sccp_con->sccp; + + if (sccp->connection_state != SCCP_CONNECTION_STATE_ESTABLISHED) { + LOGP(DMSC, LOGL_ERROR, "The connection is not established.\n"); + msgb_free(msg); + return -1; + } + + sccp_connection_write(sccp, msg); msgb_free(msg); return 0; } -- cgit v1.2.3