mirror of
				https://github.com/RangeNetworks/openbts.git
				synced 2025-11-04 05:43:14 +00:00 
			
		
		
		
	SIP MESSAGES now wait when they receive a 100 TRYING, rather than repeating themselves.
git-svn-id: http://wush.net/svn/range/software/public/openbts/trunk@3856 19bc5d8c-e614-43d4-8b26-e1612bc8e597
This commit is contained in:
		@@ -1153,6 +1153,8 @@ SIPState SIPEngine::MOSMSWaitForSubmit()
 | 
				
			|||||||
	Timeval timeout(gConfig.getNum("SIP.Timer.B"));
 | 
						Timeval timeout(gConfig.getNum("SIP.Timer.B"));
 | 
				
			||||||
	assert(mINVITE);
 | 
						assert(mINVITE);
 | 
				
			||||||
	osip_message_t *ok = NULL;
 | 
						osip_message_t *ok = NULL;
 | 
				
			||||||
 | 
						// have we received a 100 TRYING message? If so, don't retransmit after timeout
 | 
				
			||||||
 | 
						bool recv_trying = false;
 | 
				
			||||||
	while (!timeout.passed()) {
 | 
						while (!timeout.passed()) {
 | 
				
			||||||
		try {
 | 
							try {
 | 
				
			||||||
			// SIPInterface::read will throw SIPTIimeout if it times out.
 | 
								// SIPInterface::read will throw SIPTIimeout if it times out.
 | 
				
			||||||
@@ -1160,11 +1162,19 @@ SIPState SIPEngine::MOSMSWaitForSubmit()
 | 
				
			|||||||
			ok = gSIPInterface.read(mCallID, gConfig.getNum("SIP.Timer.A"));
 | 
								ok = gSIPInterface.read(mCallID, gConfig.getNum("SIP.Timer.A"));
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		catch (SIPTimeout& e) {
 | 
							catch (SIPTimeout& e) {
 | 
				
			||||||
 | 
								if (!recv_trying){
 | 
				
			||||||
				LOG(NOTICE) << "SIP MESSAGE packet to " << mProxyIP << ":" << mProxyPort << " timedout; resending"; 
 | 
									LOG(NOTICE) << "SIP MESSAGE packet to " << mProxyIP << ":" << mProxyPort << " timedout; resending"; 
 | 
				
			||||||
				gSIPInterface.write(&mProxyAddr,mINVITE);
 | 
									gSIPInterface.write(&mProxyAddr,mINVITE);
 | 
				
			||||||
 | 
								} else {
 | 
				
			||||||
 | 
								  	LOG(NOTICE) << "SIP MESSAGE packet to " << mProxyIP << ":" << mProxyPort << " timedout; ignoring (got 100 TRYING)"; 
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		assert(ok);
 | 
							assert(ok);
 | 
				
			||||||
 | 
							if((ok->status_code==100)) {
 | 
				
			||||||
 | 
								recv_trying = true;
 | 
				
			||||||
 | 
								LOG(INFO) << "received TRYING MESSAGE";
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if((ok->status_code==200) || (ok->status_code==202) ) {
 | 
							if((ok->status_code==200) || (ok->status_code==202) ) {
 | 
				
			||||||
			mState = Cleared;
 | 
								mState = Cleared;
 | 
				
			||||||
			LOG(INFO) << "successful SIP MESSAGE SMS submit to " << mProxyIP << ":" << mProxyPort << ": " << mINVITE;
 | 
								LOG(INFO) << "successful SIP MESSAGE SMS submit to " << mProxyIP << ":" << mProxyPort << ": " << mINVITE;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user