aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-12-27 12:31:02 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-12-27 12:55:44 +0100
commit40aac3f7f6d30f90f192b9e88c71f81b09c27840 (patch)
tree7724da8b6a1022ff599887af600208156f70bb9c
parent3365cd1cfe110e5ce3d7c65022b9b3c8c27f3e4c (diff)
bsc: Assume assignment_complete/assignment_fail is set
The osmo-nitb application sometimes crashes because the BSC API is doing an assignment underneath which is not handled by the code, add dumy handlers to not crash, the right thing to do is to change MNCC to have an assignment that can succeed/fail. The keyword to look for is MNCC_LCHAN_MODIFY and mncc_sock should wait for an ack/nack but right now the call just continues.
-rw-r--r--openbsc/src/libbsc/bsc_api.c8
-rw-r--r--openbsc/src/libmsc/osmo_msc.c27
2 files changed, 30 insertions, 5 deletions
diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c
index c1aedb2fb..ad4391d1a 100644
--- a/openbsc/src/libbsc/bsc_api.c
+++ b/openbsc/src/libbsc/bsc_api.c
@@ -380,8 +380,7 @@ static void handle_ass_compl(struct gsm_subscriber_connection *conn,
if (is_ipaccess_bts(conn->bts) && conn->lchan->tch_mode != GSM48_CMODE_SIGN)
rsl_ipacc_crcx(conn->lchan);
- if (api->assign_compl)
- api->assign_compl(conn, gh->data[0],
+ api->assign_compl(conn, gh->data[0],
lchan_to_chosen_channel(conn->lchan),
conn->lchan->encr.alg_id,
chan_mode_to_speech(conn->lchan));
@@ -451,15 +450,16 @@ static void dispatch_dtap(struct gsm_subscriber_connection *conn,
case GSM48_MT_RR_CHAN_MODE_MODIF_ACK:
osmo_timer_del(&conn->T10);
rc = gsm48_rx_rr_modif_ack(msg);
- if (rc < 0 && api->assign_fail) {
+ if (rc < 0) {
api->assign_fail(conn,
GSM0808_CAUSE_NO_RADIO_RESOURCE_AVAILABLE,
NULL);
- } else if (rc >= 0 && api->assign_compl)
+ } else if (rc >= 0) {
api->assign_compl(conn, 0,
lchan_to_chosen_channel(conn->lchan),
conn->lchan->encr.alg_id,
chan_mode_to_speech(conn->lchan));
+ }
return;
break;
}
diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c
index 8c86dcc8e..154386b13 100644
--- a/openbsc/src/libmsc/osmo_msc.c
+++ b/openbsc/src/libmsc/osmo_msc.c
@@ -60,11 +60,36 @@ static void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, st
gsm0408_dispatch(conn, msg);
}
+static void msc_assign_compl(struct gsm_subscriber_connection *conn,
+ uint8_t rr_cause, uint8_t chosen_channel,
+ uint8_t encr_alg_id, uint8_t speec)
+{
+ /*
+ * The mncc code is not doing assignment requests and
+ * we should not end here. See MNCC_LCHAN_MODIFY
+ */
+ LOGP(DMSC, LOGL_ERROR,
+ "Assignment complete should not have been reached.\n");
+}
+
+static void msc_assign_fail(struct gsm_subscriber_connection *conn,
+ uint8_t cause, uint8_t *rr_cause)
+{
+ /*
+ * The mncc code is not doing assignment requests and
+ * we should not end here. See MNCC_LCHAN_MODIFY
+ */
+ LOGP(DMSC, LOGL_ERROR,
+ "Assignment fail should not have been reached.\n");
+}
+
static struct bsc_api msc_handler = {
.sapi_n_reject = msc_sapi_n_reject,
- .clear_request = msc_clear_request,
.compl_l3 = msc_compl_l3,
.dtap = msc_dtap,
+ .clear_request = msc_clear_request,
+ .assign_compl = msc_assign_compl,
+ .assign_fail = msc_assign_fail,
};
struct bsc_api *msc_bsc_api() {