From 56595f8647d6ee5de1c74077e83ca438102b5ff4 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Wed, 11 Sep 2013 10:46:55 +0200 Subject: ussd: Send USSD on call setup on MSC errors Send an USSD message to the mobile station requesting a connection for a call or a SMS when the link to the MSC is down or in the grace period. The messages can be set (and this feature activated) by setting bsc/missing-msc-text resp. msc/bsc-grace-text via the vty. The generation of both messages has been tested manually. Ticket: OW#957 --- openbsc/src/osmo-bsc/osmo_bsc_sccp.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'openbsc/src/osmo-bsc/osmo_bsc_sccp.c') diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 87f415e0b..aa8c79ca6 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -188,35 +188,35 @@ int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg) return 0; } -int bsc_create_new_connection(struct gsm_subscriber_connection *conn, +enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, struct osmo_msc_data *msc) { struct osmo_bsc_sccp_con *bsc_con; struct sccp_connection *sccp; /* This should not trigger */ - if (!msc->msc_con->is_authenticated) { + if (!msc || !msc->msc_con->is_authenticated) { LOGP(DMSC, LOGL_ERROR, "How did this happen? MSC is not connected. Dropping.\n"); - return -1; + return BSC_CON_REJECT_NO_LINK; } if (!bsc_grace_allow_new_connection(conn->bts->network, conn->bts)) { LOGP(DMSC, LOGL_NOTICE, "BSC in grace period. No new connections.\n"); - return -1; + return BSC_CON_REJECT_RF_GRACE; } sccp = sccp_connection_socket(); if (!sccp) { LOGP(DMSC, LOGL_ERROR, "Failed to allocate memory.\n"); - return -ENOMEM; + return BSC_CON_NO_MEM; } bsc_con = talloc_zero(conn->bts, struct osmo_bsc_sccp_con); if (!bsc_con) { LOGP(DMSC, LOGL_ERROR, "Failed to allocate.\n"); sccp_connection_free(sccp); - return -1; + return BSC_CON_NO_MEM; } /* callbacks */ @@ -237,7 +237,7 @@ int bsc_create_new_connection(struct gsm_subscriber_connection *conn, bsc_con->conn = conn; llist_add_tail(&bsc_con->entry, &active_connections); conn->sccp_con = bsc_con; - return 0; + return BSC_CON_SUCCESS; } int bsc_open_connection(struct osmo_bsc_sccp_con *conn, struct msgb *msg) -- cgit v1.2.3