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


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

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


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

示例1: checkInvite


//.........这里部分代码省略.........

	// Check SIP map.  Repeated entry?  Page again.
	// Skip this for USSD.
	if (  mSIPMap.map().readNoBlock(call_id_num) != NULL) {
		TransactionEntry transaction;
		if (!gTransactionTable.find(mobile_id,transaction)) {
			// FIXME -- Send "call leg non-existent" response on SIP interface.
			LOG(WARN) << "repeated INVITE/MESSAGE with no transaction record";
			// Delete the bogus FIFO.
			mSIPMap.remove(call_id_num);
			return false;
		}
		LOG(INFO) << "repeated SIP INVITE/MESSAGE, repaging for transaction " << transaction; 
		gBTS.pager().addID(mobile_id,requiredChannel,transaction);	
		gTransactionTable.update(transaction);
		return false;
	}

	// Add an entry to the SIP Map to route inbound SIP messages.
	addCall(call_id_num);

	// Install transaction.
	LOG(INFO) << "make new transaction for " << mobile_id;
	// Put the caller ID in here if it's available.
	const char *callerID = NULL;
	const char *callerHost = NULL;
	osip_from_t *from = osip_message_get_from(msg);
	if (from) {
		osip_uri_t* url = osip_contact_get_url(from);
		if (url) {
			callerID = url->username;
			callerHost = url->host;
		}
	}
	if (!callerID) {
		callerID = emptyString;
		callerHost = emptyString;
		LOG(NOTICE) << "INVITE/MESSAGE with no From: username for " << mobile_id;
	}
	LOG(DEBUG) << "callerID " << callerID << "@" << callerHost;

	TransactionEntry transaction;
	// In case of USSD we should check for existing transaction first, because
	// SIP MESSAGEs are sent out of call, our internal while USSD transaction
	// stays alive for the whole duration of a session.
	if (  serviceType == L3CMServiceType::SupplementaryService
		&& gTransactionTable.find(mobile_id,L3CMServiceType::SupplementaryService,transaction))
	{
		// It's old USSD. No need to page.
		shouldPage = false;
		LOG(DEBUG) << "Existing USSD transaction found: " << transaction;
	}
	else
	{
		// It's not USSD or there are no existing transaction for it.
		// Build new transaction table entry.
		// This constructor sets TI flag=0, TI=0 for an MT transaction.
		transaction = TransactionEntry(mobile_id,serviceType,callerID);
		LOG(DEBUG) << "Created new transaction";
	}
	LOG(DEBUG) << "call_id_num \"" << call_id_num << "\"";
	LOG(DEBUG) << "IMSI \"" << IMSI << "\"";

	transaction.SIP().User(call_id_num,IMSI,callerID,callerHost);
	transaction.SIP().saveINVITE(msg);
	if (  serviceType == L3CMServiceType::MobileTerminatedShortMessage
		|| serviceType == L3CMServiceType::SupplementaryService) {
		osip_body_t *body;
		osip_message_get_body(msg,0,&body);
		if (!body) return false;
		char *text = body->body;
		if (text) {
			transaction.message(text);
		}
		else LOG(NOTICE) << "MTSMS/USSD incoming MESSAGE method with no message body for " << mobile_id;
	}
	LOG(INFO) << "MTC/MTSMS/USSD is adding/updating transaction: "<< transaction;
	gTransactionTable.add(transaction);

	if (serviceType == L3CMServiceType::SupplementaryService)
	{
		// TODO:: What to do in case of MT-USSD?
		USSDData *ussdData = transaction.ussdData();
		if (ussdData)
		{
			LOG(DEBUG) << "Signaling incoming USSD data";
			ussdData->signalIncomingData();
		}
	}	

	if (shouldPage)
	{
		// Add to paging list and tell the remote SIP end that we are trying.
		LOG(DEBUG) << "MTC/MTSMS/USSD new SIP invite, initial paging for mobile ID " << mobile_id;
		gBTS.pager().addID(mobile_id,requiredChannel,transaction);	
		// FIXME -- Send TRYING?  See MTCSendTrying for example.
	}

	return true;
}
开发者ID:0x7678,项目名称:openbts-uhd,代码行数:101,代码来源:SIPInterface.cpp


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