MCPcopy Create free account
hub / github.com/RangeNetworks/openbts / handleStatus

Function handleStatus

Control/L3StateMachine.cpp:209–244  ·  view source on GitHub ↗

TODO: Current this twiddles the RRLP status flags; the whole RRLP server needs to turn into some kind of state machine so we can tell what is going on, and whether a status message might be for RRLP or something else.

Source from the content-addressed store, hash-verified

207// the whole RRLP server needs to turn into some kind of state machine so we can tell what is going on,
208// and whether a status message might be for RRLP or something else.
209static void handleStatus(const L3Message *l3msg, MMContext *mmchan)
210{
211 assert(l3msg->MTI() == L3RRMessage::RRStatus);
212
213 const L3RRStatus *statusMsg = dynamic_cast<typeof(statusMsg)>(l3msg);
214 if (!statusMsg) {
215 LOG(ERR) << "Could not cast Layer 3 RR Status message?";
216 return;
217 }
218 int cause = statusMsg->cause().causeValue();
219
220 switch (cause) {
221 case 97:
222 LOG(INFO) << "Received RR status message with cause: message not implemented";
223 // (pat) TODO: Figure out if this is in response to RRLP or not...
224 //Rejection code only useful if we're gathering IMEIs
225 if (gConfig.getBool("Control.LUR.QueryIMEI")){
226 // flag unsupported in SR so we don't waste time on it again
227 string imsi = mmchan->mmGetImsi(false); // with false flag, empty if no imsi
228 if (imsi.size() >= 14 && isdigit(imsi[0])) { // Cheap partial validation
229 imsi = string("IMSI") + imsi;
230 // TODO : disabled because of upcoming RRLP changes and need to rip out direct SR access
231 //if (gSubscriberRegistry.imsiSet(imsi, "RRLPSupported", "0")) {
232 // LOG(INFO) << "SR update problem";
233 //}
234 }
235 }
236 return;
237 case 98:
238 LOG(INFO) << "Received RR status message with cause: message type not compatible with protocol state";
239 return;
240 default:
241 LOG(INFO) << "Received RR Status with"<<LOGHEX(cause);
242 return;
243 }
244}
245
246// code copied from DCCHDispatchMessage() and descendents.
247// Return TRUE if handled.

Callers 1

handleCommonMessagesFunction · 0.85

Calls 5

causeValueMethod · 0.80
causeMethod · 0.80
mmGetImsiMethod · 0.80
MTIMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected