diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-28 17:09:29 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-06-28 18:01:47 +0800 |
commit | 4049455d744455dd48fa359a220822303fc3a5be (patch) | |
tree | 262a428bb44471ee7d7ddbdf89421633ba409392 /openbsc/src/osmo_msc.c | |
parent | 2412a07965ace5fc425b401438d21ff86ceeb2df (diff) |
bsc_msc: Remove use_count from the subscriber connection
A channel will be released in case of
* Errors via the clear_request callback...
* no more transactions and operations are going on.
This means that if we do something without a transaction
the channel might be closed down right away. The bug fix
will be to create a transaction/operation.
Diffstat (limited to 'openbsc/src/osmo_msc.c')
-rw-r--r-- | openbsc/src/osmo_msc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/openbsc/src/osmo_msc.c b/openbsc/src/osmo_msc.c index 569634d55..6a94e7abb 100644 --- a/openbsc/src/osmo_msc.c +++ b/openbsc/src/osmo_msc.c @@ -24,6 +24,7 @@ #include <openbsc/bsc_api.h> #include <openbsc/debug.h> +#include <openbsc/transaction.h> #include <openbsc/gsm_04_11.h> @@ -64,3 +65,30 @@ static struct bsc_api msc_handler = { struct bsc_api *msc_bsc_api() { return &msc_handler; } + +/* lchan release handling */ +void msc_release_connection(struct gsm_subscriber_connection *conn) +{ + struct gsm_trans *trans; + + /* skip when we are in release, e.g. due an error */ + if (conn->in_release) + return; + + /* skip releasing of silent calls as they have no transaction */ + if (conn->silent_call) + return; + + /* check if there is a pending operation */ + if (conn->loc_operation || conn->sec_operation) + return; + + llist_for_each_entry(trans, &conn->bts->network->trans_list, entry) { + if (trans->conn == conn) + return; + } + + /* no more connections, asking to release the channel */ + conn->in_release = 1; + gsm0808_clear(conn); +} |