From 286eec5e07fdac8ba44c60a0d28ec4baba67b793 Mon Sep 17 00:00:00 2001 From: Kurtis Heimerl Date: Mon, 30 Jan 2012 00:16:56 +0000 Subject: [PATCH] handling GPRS suspension requests git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3124 19bc5d8c-e614-43d4-8b26-e1612bc8e597 --- Control/ControlCommon.cpp | 22 +++++++++++++++++++--- apps/OpenBTS.example.sql | 1 + 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Control/ControlCommon.cpp b/Control/ControlCommon.cpp index 2c0e2c6..3540db8 100644 --- a/Control/ControlCommon.cpp +++ b/Control/ControlCommon.cpp @@ -54,7 +54,7 @@ using namespace Control; // This will mean moving all of the parsing into the control layer. // FIXME -- This needs an adjustable timeout. -L3Message* Control::getMessage(LogicalChannel *LCH, unsigned SAPI) +L3Message* getMessageCore(LogicalChannel *LCH, unsigned SAPI) { unsigned timeout_ms = LCH->N200() * T200ms; L3Frame *rcv = LCH->recv(timeout_ms,SAPI); @@ -78,9 +78,25 @@ L3Message* Control::getMessage(LogicalChannel *LCH, unsigned SAPI) return msg; } +// FIXME -- getMessage should return an L3Frame, not an L3Message. +// This will mean moving all of the parsing into the control layer. +// FIXME -- This needs an adjustable timeout. - - +L3Message* Control::getMessage(LogicalChannel *LCH, unsigned SAPI) +{ + L3Message *msg = getMessageCore(LCH,SAPI); + // Handsets should not be sending us GPRS suspension requests. + // But if they do, we should ignore them. + // They should not send more than one in any case, but we need to be + // ready for whatever crazy behavior they throw at us. + unsigned count = gConfig.getNum("GSM.Control.GPRSMaxIgnore",5); + while (count && dynamic_cast(msg)) { + LOG(NOTICE) << "ignoring GPRS suspension request"; + msg = getMessageCore(LCH,SAPI); + count--; + } + return msg; +} /* Resolve a mobile ID to an IMSI and return TMSI if it is assigned. */ diff --git a/apps/OpenBTS.example.sql b/apps/OpenBTS.example.sql index f5d45d2..a58ebc4 100644 --- a/apps/OpenBTS.example.sql +++ b/apps/OpenBTS.example.sql @@ -37,6 +37,7 @@ INSERT INTO "CONFIG" VALUES('GSM.CellSelection.RXLEV-ACCESS-MIN','0',0,0,'Cell s INSERT INTO "CONFIG" VALUES('GSM.Channels.C1sFirst',NULL,1,0,'If not NULL, allocate C-I slots first, starting at C0T1. Otherwise, allocate C-VII slots first. Static.'); INSERT INTO "CONFIG" VALUES('GSM.Channels.NumC1s','7',1,0,'Number of Combination-I timeslots to configure. The C-I slot carries a single full-rate TCH, used for speech calling. Static.'); INSERT INTO "CONFIG" VALUES('GSM.Channels.NumC7s','0',1,0,'Number of Combination-VII timeslots to configure. The C-VII slot carries 8 SDCCHs, useful to handle high registration loads or SMS. If C0T0 is C-IV, you must have at least one C-VII also. Static.'); +INSERT INTO "CONFIG" VALUES('GSM.Control.GPRSMaxIgnore','5',0,1,'The maximum number of suspension requests to ignore before aborting a transaction.'); INSERT INTO "CONFIG" VALUES('GSM.Identity.BSIC.BCC','2',0,0,'GSM basestation color code; lower 3 bits of the BSIC. BCC values in a multi-BTS network should be assigned so that BTS units with overlapping coverage do not share a BCC. This value will also select the training sequence used for all slots on this unit.'); INSERT INTO "CONFIG" VALUES('GSM.Identity.BSIC.NCC','0',0,0,'GSM network color code; upper 3 bits of the BSIC. Assigned by your national regulator. Must be distinct from NCCs of other GSM operators in your area.'); INSERT INTO "CONFIG" VALUES('GSM.Identity.CI','10',0,0,'Cell ID, 16 bits. Should be unique.');