aboutsummaryrefslogtreecommitdiffstats
path: root/src/gsm_04_08.c
diff options
context:
space:
mode:
authorHolger Freyther <zecke@selfish.org>2009-02-06 21:55:37 +0000
committerHolger Freyther <zecke@selfish.org>2009-02-06 21:55:37 +0000
commite64a7a3c3b8152c79f38c496fd01a1174f816196 (patch)
tree98cf63d362e94675a7c61cb978d336994d6c250a /src/gsm_04_08.c
parentceb59b72c23f9af90538704d4ce29aaee80c11e4 (diff)
[rr] Send a Channel Release before deactivating the channel
After auto releasing a channel the next paging request will not be immediately answered. The hypothesis was that we do not release the channel properly. Implementing Channel Release of GSM 04.08 should have fixed it, but it didn't. According to the wireshark dissectors the message is correct though. - Add the RR cause values to gsm_04_08. - Implement the Channel Release message - Invoke the release channel function before deallocating the lchan.
Diffstat (limited to 'src/gsm_04_08.c')
-rw-r--r--src/gsm_04_08.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gsm_04_08.c b/src/gsm_04_08.c
index 2739b0b0f..541ff4202 100644
--- a/src/gsm_04_08.c
+++ b/src/gsm_04_08.c
@@ -710,6 +710,26 @@ static int gsm0408_rcv_rr(struct msgb *msg)
return rc;
}
+/* 7.1.7 and 9.1.7 Channel release*/
+int gsm48_send_rr_release(struct gsm_lchan *lchan)
+{
+ struct msgb *msg = gsm48_msgb_alloc();
+ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh));
+ u_int8_t *cause;
+
+ msg->lchan = lchan;
+ gh->proto_discr = GSM48_PDISC_RR;
+ gh->msg_type = GSM48_MT_RR_CHAN_REL;
+
+ cause = msgb_put(msg, 1);
+ cause[0] = GSM48_RR_CAUSE_NORMAL;
+
+ DEBUGP(DRR, "Sending Channel Release: Chan: Number: %d Type: %d\n",
+ lchan->nr, lchan->type);
+
+ return gsm48_sendmsg(msg);
+}
+
/* Call Control */
static int gsm48_cc_tx_status(struct gsm_lchan *lchan)