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

Method mmCheckNewActivity

Control/L3MMLayer.cpp:143–175  ·  view source on GitHub ↗

See if there are any new transactions to start. If all transactions are gone, initiate a channel release. Return true if anything happened.

Source from the content-addressed store, hash-verified

141// If all transactions are gone, initiate a channel release.
142// Return true if anything happened.
143bool MMContext::mmCheckNewActivity()
144{
145 // If there is a mobility management procedure in progress then we wont start anything else until it is finished.
146 // We shouldnt need to lock gMMLock yet because the MMContext cannot be deleted while in the thread that called us,
147 // and mmcServiceRequests is a thread safe queue.
148 if (! mmInMobilityManagement()) {
149 if (const L3Message *l3msg = mmcServiceRequests.readNoBlock()) {
150 const L3CMServiceRequest *cmmsg = dynamic_cast<typeof(cmmsg)>(l3msg);
151 NewCMServiceResponder(cmmsg,this);
152 delete cmmsg;
153 return true;
154 }
155 // We are refererencing the MMUser so we cannot let that change and the only
156 // completely safe way to do that is to lock the entire MMLayer.
157 // The unlock() corresponding to this lock() may be in mmuServiceMTQueues.
158 gMMLock.lock(__FILE__,__LINE__);
159 if (mmcMMU) {
160 if (mmcMMU->mmuServiceMTQueues()) { return true; }
161 }
162 gMMLock.unlock();
163 }
164 // If there are no transactions, kill the channel.
165 // TODO: A new SIP transaction could creep in here between the time
166 // we check isEmpty and when the channel actually closes.
167 // What to do about that?
168 // When we detach the MMUser, if it has anything on it, just leave it there,
169 // and paging will restart.
170 if (mmIsEmpty()) {
171 mmcChan->chanClose(L3RRCause::NormalEvent,RELEASE);
172 return true; // This is new activity - the calling loop should skip back to the top
173 }
174 return false;
175}
176
177// What a stupid language.
178MMUser::MMUser(string& wImsi)

Callers 1

checkemMessagesFunction · 0.80

Calls 3

NewCMServiceResponderFunction · 0.85
mmuServiceMTQueuesMethod · 0.80
chanCloseMethod · 0.80

Tested by

no test coverage detected