当前位置: 首页>>代码示例>>C++>>正文


C++ TransactionEntry::clearing方法代码示例

本文整理汇总了C++中TransactionEntry::clearing方法的典型用法代码示例。如果您正苦于以下问题:C++ TransactionEntry::clearing方法的具体用法?C++ TransactionEntry::clearing怎么用?C++ TransactionEntry::clearing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TransactionEntry的用法示例。


在下文中一共展示了TransactionEntry::clearing方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: forceGSMClearing

/**
	Force clearing on the GSM side.
	@param transaction The call transaction record.
	@param LCH The logical channel.
	@param cause The L3 abort cause.
*/
void forceGSMClearing(TransactionEntry& transaction, LogicalChannel *LCH, const L3Cause& cause)
{
	LOG(INFO) << "Q.931 state " << transaction.Q931State();
	if (transaction.Q931State()==TransactionEntry::NullState) return;
	if (!transaction.clearing()) {
		LCH->send(L3Disconnect(1-transaction.TIFlag(),transaction.TIValue(),cause));
	}
	LCH->send(L3ReleaseComplete(1-transaction.TIFlag(),transaction.TIValue()));
	LCH->send(L3ChannelRelease());
	transaction.resetTimers();
	transaction.Q931State(TransactionEntry::NullState);
	LCH->send(RELEASE);
	gTransactionTable.update(transaction);
}
开发者ID:0x7678,项目名称:openbts-uhd,代码行数:20,代码来源:CallControl.cpp

示例2: updateSignalling

/**
	Check SIP and GSM signalling.
	Can block for up to 52 GSM L1 frames (240 ms) because LCH::send is blocking.
	@param transaction The call's TransactionEntry.
	@param LCH The call's logical channel (TCH/FACCH or SDCCH).
	@return true If the call is cleared in both domains.
*/
bool updateSignalling(TransactionEntry &transaction, LogicalChannel *LCH, unsigned timeout=0)
{

	bool GSMCleared = (updateGSMSignalling(transaction,LCH,timeout));

	// Look for a SIP message.
	SIPEngine& engine = transaction.SIP();
	if (engine.MTDCheckBYE() == SIP::Clearing) {
		if (!transaction.clearing()) {
			LOG(DEBUG) << "got BYE";
			LCH->send(L3Disconnect(1-transaction.TIFlag(),transaction.TIValue()));
			transaction.T305().set();
			transaction.Q931State(TransactionEntry::DisconnectIndication);
			// Return false, because it the call is not yet cleared.
			return false;
		} else {
			// If we're already clearing, send BYE again.
			//engine.MODSendBYE();
		}
	}
	bool SIPCleared = (engine.state()==SIP::Cleared);

	return GSMCleared && SIPCleared;
}
开发者ID:0x7678,项目名称:openbts-uhd,代码行数:31,代码来源:CallControl.cpp

示例3: MOCController

/**
	Continue MOC process on the TCH.
	@param transaction The call state and SIP interface.
	@param TCH The traffic channel to be used.
*/
void Control::MOCController(TransactionEntry& transaction, TCHFACCHLogicalChannel* TCH)
{
	LOG(INFO) << "transaction: " << transaction;
	unsigned L3TI = transaction.TIValue();
	assert(transaction.TIFlag()==0);
	assert(TCH);


	// Look for RINGING or OK from the SIP side.
	// There's a T310 running on the phone now.
	// The phone will initiate clearing if it expires.
	while (transaction.Q931State()!=TransactionEntry::CallReceived) {

		if (updateGSMSignalling(transaction,TCH)) return;
		if (transaction.clearing()) return abortCall(transaction,TCH,L3Cause(0x7F));

		LOG(INFO) << "MOC A: wait for Ringing or OK";
		SIPState state = transaction.SIP().MOCWaitForOK();
		LOG(DEBUG) << "MOC A: SIP state="<<state;
		switch (state) {
			case SIP::Busy:
				LOG(INFO) << "MOC A: SIP:Busy, abort";
				return abortCall(transaction,TCH,L3Cause(0x11));
			case SIP::Fail:
				LOG(NOTICE) << "MOC A: SIP:Fail, abort";
				return abortCall(transaction,TCH,L3Cause(0x7F));
			case SIP::Ringing:
				LOG(INFO) << "MOC A: SIP:Ringing, send Alerting and move on";
				TCH->send(L3Alerting(1,L3TI));
				transaction.Q931State(TransactionEntry::CallReceived);
				break;
			case SIP::Active:
				LOG(DEBUG) << "MOC A: SIP:Active, move on";
				transaction.Q931State(TransactionEntry::CallReceived);
				break;
			case SIP::Proceeding:
				LOG(DEBUG) << "MOC A: SIP:Proceeding, send progress";
				TCH->send(L3Progress(1,L3TI));
				break;
			case SIP::Timeout:
				LOG(NOTICE) << "MOC A: SIP:Timeout, reinvite";
				state = transaction.SIP().MOCResendINVITE();
				break;
			default:
				LOG(NOTICE) << "MOC A: SIP unexpected state " << state;
				break;
		}
	}
	gTransactionTable.update(transaction);

	// There's a question here of what entity is generating the "patterns"
	// (ringing, busy signal, etc.) during call set-up.  For now, we're ignoring 
	// that question and hoping the phone will make its own ringing pattern.


	// Wait for the SIP session to start.
	// There's a timer on the phone that will initiate clearing if it expires.
	LOG(INFO) << "wait for SIP OKAY";
	SIPState state = transaction.SIP().state();
	while (state!=SIP::Active) {

		LOG(DEBUG) << "wait for SIP session start";
		state = transaction.SIP().MOCWaitForOK();
		LOG(DEBUG) << "SIP state "<< state;

		// check GSM state
		if (updateGSMSignalling(transaction,TCH)) return;
		if (transaction.clearing()) return abortCall(transaction,TCH,L3Cause(0x7F));

		// parse out SIP state
		switch (state) {
			case SIP::Busy:
				// Should this be possible at this point?
				LOG(INFO) << "MOC B: SIP:Busy, abort";
				return abortCall(transaction,TCH,L3Cause(0x11));
			case SIP::Fail:
				LOG(INFO) << "MOC B: SIP:Fail, abort";
				return abortCall(transaction,TCH,L3Cause(0x7F));
			case SIP::Proceeding:
				LOG(DEBUG) << "MOC B: SIP:Proceeding, NOT sending progress";
				//TCH->send(L3Progress(1,L3TI));
				break;
			// For these cases, do nothing.
			case SIP::Timeout:
				// FIXME We should abort if this happens too often.
				// For now, we are relying on the phone, which may have bugs of its own.
			case SIP::Active:
			default:
				break;
		}
	} 
	gTransactionTable.update(transaction);
	
	// Let the phone know the call is connected.
	LOG(INFO) << "sending Connect to handset";
//.........这里部分代码省略.........
开发者ID:0x7678,项目名称:openbts-uhd,代码行数:101,代码来源:CallControl.cpp


注:本文中的TransactionEntry::clearing方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。