Perform a network initiated clearing 24.008 5.4. If things look ok send a disconnect and continue waiting for a Release message, or if things have gone wrong, send a ReleaseRequest and kill the transaction. We used to do that all the time but some handsets (BLU phone) report "Network Failure" if you dont go through the disconnect procedure. We dont send the RR releaes at this level - the MM laye
| 205 | // but some handsets (BLU phone) report "Network Failure" if you dont go through the disconnect procedure. |
| 206 | // We dont send the RR releaes at this level - the MM layer does that after this transaction dies. |
| 207 | MachineStatus CCBase::closeCall(L3Cause l3cause) |
| 208 | { |
| 209 | WATCHINFO("closeCall"<<LOGVAR2("cause",l3cause.cause()) <<" "<<channel()->descriptiveString()); |
| 210 | tran()->teCloseDialog(); // Make sure; this is redundant because the call will be repeated when the transaction is killed, |
| 211 | // We could assert this if we dont call this until after an L3Setup. |
| 212 | if (isL3TIValid()) { |
| 213 | unsigned l3ti = getL3TI(); |
| 214 | // We dont have to send a disconnect at all, but if you dont, the phone may report that the call "failed". |
| 215 | CallState ccstate = tran()->getGSMState(); |
| 216 | if (ccstate == CCState::Active) { |
| 217 | if (1) { |
| 218 | channel()->l3sendm(GSM::L3Disconnect(l3ti,l3cause)); |
| 219 | setGSMState(CCState::DisconnectIndication); |
| 220 | } else { |
| 221 | // (pat 10-24-2013) As an option per 24.008 5.4.2: we could send a Release message and start T308 |
| 222 | channel()->l3sendm(GSM::L3Release(l3ti,l3cause)); |
| 223 | setGSMState(CCState::ReleaseRequest); |
| 224 | } |
| 225 | timerStart(T308,T308ms,TimerAbortTran); |
| 226 | return MachineStatusOK; // Wait for ReleaseComplete. |
| 227 | } else if (ccstate != CCState::NullState && ccstate != CCState::ReleaseRequest) { |
| 228 | channel()->l3sendm(GSM::L3ReleaseComplete(l3ti,l3cause)); // This is a CC message that releases this Transaction. |
| 229 | } |
| 230 | } else { |
| 231 | // If no TI we cant send any CC release messages, just kill the transaction and if nothing is happening |
| 232 | // the MM layer will send an RR release on the channel. |
| 233 | } |
| 234 | WATCH("CLOSE CALL:"<<l3cause <<gMMLayer.printMMInfo()); |
| 235 | |
| 236 | setGSMState(CCState::NullState); // redundant, we are deleting this transaction. |
| 237 | LOG(DEBUG) << gMMLayer.printMMInfo(); |
| 238 | if (IS_LOG_LEVEL(DEBUG)) { CommandLine::printChansV4(cout,false); } |
| 239 | LOG(DEBUG) <<"finish"; |
| 240 | // The caller is a state machine. We cannot remove the transaction yet because the state machine is still using it. |
| 241 | // The state machine caller should return MachineStatusQuitTran which causes handleMachineStatus() |
| 242 | // to call teRemove to finish transaction destruction. |
| 243 | return MachineStatusQuitTran; |
| 244 | } |
| 245 | |
| 246 | // This is called outside the normal procedure handling, so we dont return a MachineStatus. |
| 247 | // On return the caller will release the RR channel preemptively. |
nothing calls this directly
no test coverage detected