diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-11-23 21:33:15 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2012-12-01 11:32:47 +0100 |
commit | 70ae5d3000edd12aee38497a6f541595a8c7dee8 (patch) | |
tree | 397a109e935f59783dc1c9b82b96b93b2463a696 /openbsc/src/libmsc/osmo_msc.c | |
parent | 6d818839a9febc5d8ff970b16822fe86f551f266 (diff) |
nitb: Release the channel if there is nothing on it
This is more a work around and one still needs to implement a
proper dispatch on the opening of the connection. If there is no
operation left, no transaction and no silent call, close down the
channel.
Diffstat (limited to 'openbsc/src/libmsc/osmo_msc.c')
-rw-r--r-- | openbsc/src/libmsc/osmo_msc.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/openbsc/src/libmsc/osmo_msc.c b/openbsc/src/libmsc/osmo_msc.c index 4dd172b88..90fa56507 100644 --- a/openbsc/src/libmsc/osmo_msc.c +++ b/openbsc/src/libmsc/osmo_msc.c @@ -53,7 +53,13 @@ static int msc_compl_l3(struct gsm_subscriber_connection *conn, struct msgb *msg gsm0408_dispatch(conn, msg); /* TODO: do better */ - return BSC_API_CONN_POL_ACCEPT; + if (conn->silent_call) + return BSC_API_CONN_POL_ACCEPT; + if (conn->loc_operation || conn->sec_operation || conn->anch_operation) + return BSC_API_CONN_POL_ACCEPT; + if (trans_has_conn(conn)) + return BSC_API_CONN_POL_ACCEPT; + return BSC_API_CONN_POL_REJECT; } static void msc_dtap(struct gsm_subscriber_connection *conn, uint8_t link_id, struct msgb *msg) @@ -162,10 +168,8 @@ void msc_release_connection(struct gsm_subscriber_connection *conn) if (conn->loc_operation || conn->sec_operation || conn->anch_operation) return; - llist_for_each_entry(trans, &conn->bts->network->trans_list, entry) { - if (trans->conn == conn) - return; - } + if (trans_has_conn(conn)) + return; /* no more connections, asking to release the channel */ conn->in_release = 1; |