aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-04-12 05:37:52 +0000
committerHolger Freyther <zecke@selfish.org>2009-04-12 05:37:52 +0000
commita1f92f0a439525d32dff1db181fbea5b3d86eaae (patch)
tree694046e4c52da47ed335d88b820cae858afe1df7 /src
parent4a49e77ff43ae0ec152a351603fbe91ec30efe8c (diff)
[subscriber] Introduce subscr_put_channel
Introduce subscr_put_channel to release a channel and to allow gsm_subscriber.c to hand this channel to any suitable pending requests.
Diffstat (limited to 'src')
-rw-r--r--src/gsm_04_08.c10
-rw-r--r--src/gsm_subscriber.c11
2 files changed, 19 insertions, 2 deletions
diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index a9183deff..85af5020e 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -1208,7 +1208,13 @@ static int gsm48_cc_rx_disconnect(struct msgb *msg)
DEBUGP(DCC, "A <- RELEASE\n");
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
GSM48_MT_CC_RELEASE);
- put_lchan(msg->lchan);
+
+ /*
+ * FIXME: This looks wrong! We should have a single
+ * place to do MMCC-REL-CNF/-REQ/-IND and then switch
+ * to the NULL state and relase the call
+ */
+ subscr_put_channel(msg->lchan);
/* forward DISCONNECT to other party */
if (!call->remote_lchan)
@@ -1294,7 +1300,7 @@ static int gsm0408_rcv_cc(struct msgb *msg)
/* need to respond with RELEASE_COMPLETE */
rc = gsm48_tx_simple(msg->lchan, GSM48_PDISC_CC,
GSM48_MT_CC_RELEASE_COMPL);
- put_lchan(msg->lchan);
+ subscr_put_channel(msg->lchan);
call->state = GSM_CSTATE_NULL;
break;
case GSM48_MT_CC_STATUS_ENQ:
diff --git a/src/gsm_subscriber.c b/src/gsm_subscriber.c
index e3cd5eb25..0c2dd7c52 100644
--- a/src/gsm_subscriber.c
+++ b/src/gsm_subscriber.c
@@ -122,3 +122,14 @@ struct gsm_subscriber *subscr_put(struct gsm_subscriber *subscr)
subscr_free(subscr);
return NULL;
}
+
+void subscr_put_channel(struct gsm_lchan *lchan)
+{
+ /*
+ * FIXME: Continue with other requests now... by checking
+ * the gsm_subscriber inside the gsm_lchan. Drop the ref count
+ * of the lchan after having asked the next requestee to handle
+ * the channel.
+ */
+ put_lchan(lchan);
+}