mirror of
				https://github.com/fairwaves/openbts-2.8.git
				synced 2025-11-03 21:43:16 +00:00 
			
		
		
		
	r4216 and 4217 in private:
Make multiple attempts at TCH channel assignment. (Yes, I saw this do something useful during one test.) Log abmormal Disconnect and Release at NOTICE level. Accessors for Cause element in L3 CC Release. git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@4350 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
		@@ -64,6 +64,9 @@ using namespace Control;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// Forward refs.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					bool callManagementDispatchGSM(TransactionEntry *transaction, GSM::LogicalChannel* LCH, const GSM::L3Message *message);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -207,34 +210,47 @@ bool assignTCHF(TransactionEntry *transaction, GSM::LogicalChannel *DCCH, GSM::T
 | 
				
			|||||||
	TCH->open();
 | 
						TCH->open();
 | 
				
			||||||
	TCH->setPhy(*DCCH);
 | 
						TCH->setPhy(*DCCH);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Send the assignment.
 | 
						// We retry this loop in case there are stray messages in the channel.
 | 
				
			||||||
	transaction->channel(TCH);
 | 
						// On some phones, we see repeated Call Confirmed messages on MTC.
 | 
				
			||||||
	LOG(DEBUG) << "updated transaction " << *transaction;
 | 
					 | 
				
			||||||
	LOG(INFO) << "sending AssignmentCommand for " << *TCH << " on " << *DCCH;
 | 
					 | 
				
			||||||
	DCCH->send(GSM::L3AssignmentCommand(TCH->channelDescription(),GSM::L3ChannelMode(GSM::L3ChannelMode::SpeechV1)));
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// This read is SUPPOSED to time out if the assignment was successful.
 | 
						GSM::Z100Timer retry(GSM::T3101ms-1000);
 | 
				
			||||||
	// Pad the timeout just in case there's a large latency somewhere.
 | 
						retry.set();
 | 
				
			||||||
	GSM::L3Frame *result = DCCH->recv(GSM::T3107ms+2000);
 | 
						while (!retry.expired()) {
 | 
				
			||||||
	if (result==NULL) {
 | 
					
 | 
				
			||||||
		LOG(INFO) << "sucessful assignment; exiting normally";
 | 
							// Send the assignment.
 | 
				
			||||||
		DCCH->send(GSM::HARDRELEASE);
 | 
							transaction->channel(TCH);
 | 
				
			||||||
		return true;
 | 
							LOG(DEBUG) << "updated transaction " << *transaction;
 | 
				
			||||||
 | 
							LOG(INFO) << "sending AssignmentCommand for " << *TCH << " on " << *DCCH;
 | 
				
			||||||
 | 
							DCCH->send(GSM::L3AssignmentCommand(TCH->channelDescription(),GSM::L3ChannelMode(GSM::L3ChannelMode::SpeechV1)));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// This read is SUPPOSED to time out if the assignment was successful.
 | 
				
			||||||
 | 
							// Pad the timeout just in case there's a large latency somewhere.
 | 
				
			||||||
 | 
							GSM::L3Frame *result = DCCH->recv(GSM::T3107ms+2000);
 | 
				
			||||||
 | 
							if (!result) {
 | 
				
			||||||
 | 
								LOG(INFO) << "sucessful assignment; exiting normally";
 | 
				
			||||||
 | 
								DCCH->send(GSM::HARDRELEASE);
 | 
				
			||||||
 | 
								return true;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							// If we got here, the assignment failed, or there was a message backlog in L3.
 | 
				
			||||||
 | 
							GSM::L3Message *msg = parseL3(*result);
 | 
				
			||||||
 | 
							if (!msg) { LOG(NOTICE) << "waiting for assignment complete, received unparsed L3 frame " << *result; }
 | 
				
			||||||
 | 
							delete result;
 | 
				
			||||||
 | 
							if (!msg) continue;
 | 
				
			||||||
 | 
							LOG(NOTICE) << "waiting for assignment complete, received " << *msg;
 | 
				
			||||||
 | 
							callManagementDispatchGSM(transaction,DCCH,msg);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// If we got here, the assignment failed.
 | 
					 | 
				
			||||||
	LOG(NOTICE) << "received " << *result;
 | 
					 | 
				
			||||||
	delete result;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	// Turn off the TCH.
 | 
						// Turn off the TCH.
 | 
				
			||||||
	TCH->send(GSM::RELEASE);
 | 
						TCH->send(GSM::RELEASE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						// RR Cause 0x04 -- "abnormal release, no activity on the radio path"
 | 
				
			||||||
 | 
						DCCH->send(GSM::L3ChannelRelease(0x04));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Dissociate channel from the transaction.
 | 
						// Dissociate channel from the transaction.
 | 
				
			||||||
	// The tranaction no longer has a channel.
 | 
						// The tranaction no longer has a channel.
 | 
				
			||||||
	transaction->channel(NULL);
 | 
						transaction->channel(NULL);
 | 
				
			||||||
	
 | 
						
 | 
				
			||||||
	// RR Cause 0x04 -- "abnormal release, no activity on the radio path"
 | 
					 | 
				
			||||||
	DCCH->send(GSM::L3ChannelRelease(0x04));
 | 
					 | 
				
			||||||
	// Shut down the SIP side of the call.
 | 
						// Shut down the SIP side of the call.
 | 
				
			||||||
	forceSIPClearing(transaction);
 | 
						forceSIPClearing(transaction);
 | 
				
			||||||
	// Indicate failure.
 | 
						// Indicate failure.
 | 
				
			||||||
@@ -310,8 +326,11 @@ bool callManagementDispatchGSM(TransactionEntry *transaction, GSM::LogicalChanne
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	// Disconnect (1st step of MOD)
 | 
						// Disconnect (1st step of MOD)
 | 
				
			||||||
	// GSM 04.08 5.4.3.2
 | 
						// GSM 04.08 5.4.3.2
 | 
				
			||||||
	if (dynamic_cast<const GSM::L3Disconnect*>(message)) {
 | 
						if (const GSM::L3Release *rls = dynamic_cast<const GSM::L3Release*>(message)) {
 | 
				
			||||||
		LOG(INFO) << "GSM Disconnect " << *transaction;
 | 
							LOG(INFO) << "GSM Disconnect " << *transaction;
 | 
				
			||||||
 | 
					               if (rls->haveCause() && (rls->cause().cause() > 0x10)) {
 | 
				
			||||||
 | 
					                       LOG(NOTICE) << "abnormal terminatation: " << *rls;
 | 
				
			||||||
 | 
					               }
 | 
				
			||||||
		/* late RLLP request */
 | 
							/* late RLLP request */
 | 
				
			||||||
		if (gConfig.defines("Control.Call.QueryRRLP.Late")) {
 | 
							if (gConfig.defines("Control.Call.QueryRRLP.Late")) {
 | 
				
			||||||
			// Query for RRLP
 | 
								// Query for RRLP
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user