Re: latest cvs version issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2011-03-04 16:03 +0100, Jan Willamowius wrote openh323gk-users@xxxxxxxxxxxx:

JW>Georgiewskiy Yuriy wrote:
JW>> JW>can you pinpoint when T38 fax stopped working for you ? between the
JW>> JW>2.3.4 release and the current CVS ? Or between 2.3.3 and 2.3.4 ?
JW>> 
JW>> Hi, no, T38 works on latest stable, and don't works on current cvs only.
JW>
JW>There haven't been too many changes since the last release. Can you
JW>check which one broke T38 ?

Hi, it seems it is a commit from 2011-02-15 on ProxyChannel.cxx, i make a diff, after 
this changes faxes other t38 don't work.

--- /home/src/gnugk/openh323gk/ProxyChannel.cxx	2011-03-16 22:35:18.000000000 +0300
+++ /tmp/openh323gk/ProxyChannel.cxx	2011-03-16 22:43:24.000000000 +0300
@@ -304,10 +304,10 @@
 	bool isMute() { return mute; }
 	void SetMute(bool toMute) { mute = toMute; }
 	void OnHandlerSwapped() { std::swap(fnat, rnat); }
+	void SetRTPSessionID(WORD id) { m_sessionID = id; }
 #ifdef HAS_H46018
 	void SetUsesH46019fc(bool fc) { m_h46019fc = fc; }
 	void SetH46019Direction(int dir) { m_h46019dir = dir; }
-	void SetH46024SessionID(WORD id) { m_sessionID = id; }
 	void SetH46019UniDirectional(bool val) { m_h46019uni = val; }
 	// disabled for now, until we handle 2 payload types per UDPProxy
 	// void SetKeepAlivePayloadType(int pt) { m_keepAlivePayloadType = pt; }
@@ -337,6 +337,7 @@
 	bool mute;
 	bool m_dontQueueRTP;
 	bool m_EnableRTCPStats;
+	WORD m_sessionID;
 #ifdef HAS_H46018
 	// also used as indicator whether H.460.19 should be used
 //	int m_keepAlivePayloadType;
@@ -350,7 +351,6 @@
 	int m_h46019olc;
 	int m_h46019dir;
     bool m_h46019uni;
-	WORD m_sessionID;
 	H323TransportAddress m_h46019fwd;
 	H323TransportAddress m_h46019rev;
 	bool m_OLCrev;
@@ -427,7 +427,7 @@
 	void SetUsesH46019fc(bool);
 	void SetH46019Direction(int dir);
     void SetH46019UniDirectional(bool uni);
-	void SetH46024SessionID(WORD id);
+	void SetRTPSessionID(WORD id);
 
 private:
 	void SetNAT(bool);
@@ -5360,12 +5360,12 @@
 #endif
 
 // class UDPProxySocket
-UDPProxySocket::UDPProxySocket(const char *t) 
+UDPProxySocket::UDPProxySocket(const char *t)
 	: ProxySocket(this, t),
 		fSrcIP(0), fDestIP(0), rSrcIP(0), rDestIP(0),
-		fSrcPort(0), fDestPort(0), rSrcPort(0), rDestPort(0)
+		fSrcPort(0), fDestPort(0), rSrcPort(0), rDestPort(0), m_sessionID(0)
 #ifdef HAS_H46018
-	, m_h46019fc(false), m_h46019olc(H46019_NONE), m_h46019dir(H46019_NONE), m_h46019uni(false), m_sessionID(0), m_OLCrev(false)
+	, m_h46019fc(false), m_h46019olc(H46019_NONE), m_h46019dir(H46019_NONE), m_h46019uni(false), m_OLCrev(false)
 	//, m_keepAlivePayloadType(H46019_UNDEFINED_PAYLOAD_TYPE), m_keepAliveTypeSet(false)
 #endif
 {
@@ -5503,6 +5503,14 @@
 	WORD fromPort;
 	GetLastReceiveAddress(fromIP, fromPort);
 	buflen = (WORD)GetLastReadCount();
+	// verify packet
+	unsigned int version = 0;
+	if (buflen >= 1)
+		version = (((int)wbuffer[0] & 0xc0) >> 6);
+	if (version != 2) {
+		PTRACE(1, "RTP\tInvalid RTP/RTCP packet: version=" << version);
+		return NoData;
+	}
 #ifdef HAS_H46018
 	int payloadType = H46019_UNDEFINED_PAYLOAD_TYPE;
 	if (buflen >= 2)
@@ -5707,23 +5715,27 @@
 		bool direct = ((*m_call)->GetSRC_media_control_IP() == fromIP.AsString());
 		PIPSocket::Address addr = (DWORD)0;
 		(*m_call)->GetMediaOriginatingIp(addr);
+		if (buflen < 4) {
+			PTRACE(1, "RTCP\tInvalid RTCP frame");
+			return NoData;
+		}
 
 		RTP_ControlFrame frame(2048);
 		frame.Attach(wbuffer, buflen);
 		do {
 			BYTE * payload = frame.GetPayloadPtr();
 			unsigned size = frame.GetPayloadSize();
-			if ((payload == NULL) || (size == 0) || ((payload + size) > (frame.GetPointer() + frame.GetSize()))) {
-			/* TODO: 1.shall we test for a maximum size ? Indeed but what's the value ? *
-				 2. what's the correct exit status ? */
-				PTRACE(1, "RTCP\tSession invalid frame");
-				// TODO: return NoData; ?
-				break;
+			if ((payload == NULL) || (size == 0)
+				|| (frame.GetVersion() != 2)
+				|| ((payload + size) > (frame.GetPointer() + frame.GetSize()))) {
+				// TODO: test for a maximum size ? what is the max size ?
+				PTRACE(1, "RTCP\tInvalid RTCP frame");
+				return NoData;
 			}
 			switch (frame.GetPayloadType()) {
 			case RTP_ControlFrame::e_SenderReport :
 				PTRACE(5, "RTCP\tSession SenderReport packet");
-				if (size >= sizeof(RTP_ControlFrame::SenderReport)) {
+				if (size >= (sizeof(PUInt32b)+sizeof(RTP_ControlFrame::SenderReport) + frame.GetCount() * sizeof(RTP_ControlFrame::ReceiverReport))) {
 					const RTP_ControlFrame::SenderReport & sr = *(const RTP_ControlFrame::SenderReport *)(payload);
 					if (direct) {
 						if (m_sessionID == RTP_Session::DefaultAudioSessionID) {
@@ -5751,7 +5763,7 @@
 				break;
 			case RTP_ControlFrame::e_ReceiverReport:
 				PTRACE(5, "RTCP\tSession ReceiverReport packet");
-				if (size >= 4) {
+				if (size >= (sizeof(PUInt32b)+frame.GetCount()*sizeof(RTP_ControlFrame::ReceiverReport))) {
 					BuildReceiverReport(frame, sizeof(PUInt32b), direct);
 				} else {
 					PTRACE(5, "RTP\tSession ReceiverReport packet truncated");
@@ -5760,7 +5772,7 @@
 			case RTP_ControlFrame::e_SourceDescription :
 				PTRACE(5, "RTCP\tSession SourceDescription packet");		    
 				if ((!(*m_call)->GetRTCP_SRC_sdes_flag() && direct) || (!(*m_call)->GetRTCP_DST_sdes_flag() && !direct))
-					if (size >= frame.GetCount()*sizeof(RTP_ControlFrame::SourceDescription)) {
+					if (size >= (frame.GetCount()*sizeof(RTP_ControlFrame::SourceDescription))) {
 						const RTP_ControlFrame::SourceDescription * sdes = (const RTP_ControlFrame::SourceDescription *)payload;
 						for (PINDEX srcIdx = 0; srcIdx < (PINDEX)frame.GetCount(); srcIdx++) {
 							const RTP_ControlFrame::SourceDescription::Item * item = sdes->item;
@@ -6129,16 +6141,15 @@
 		    rtcp->SetH46019UniDirectional(true);	
     }
 }
+#endif
 
-
-void RTPLogicalChannel::SetH46024SessionID(WORD id)
+void RTPLogicalChannel::SetRTPSessionID(WORD id)
 {
 	if (rtp)
-		rtp->SetH46024SessionID(id);
+		rtp->SetRTPSessionID(id);
 	if (rtcp)
-		rtcp->SetH46024SessionID(id);	
+		rtcp->SetRTPSessionID(id);	
 }
-#endif
 
 void RTPLogicalChannel::SetMediaControlChannelSource(const H245_UnicastAddress_iPAddress & addr)
 {
@@ -6442,8 +6453,8 @@
 
 #ifdef HAS_H46018
 	lc->SetH46019Direction(m_H46019dir);
-	lc->SetH46024SessionID((WORD)h225Params->m_sessionID);
 #endif
+	lc->SetRTPSessionID((WORD)h225Params->m_sessionID);
 
 	H245_UnicastAddress_iPAddress *addr;
 	bool changed = false;
@@ -6598,7 +6609,7 @@
 				((RTPLogicalChannel*)lc)->SetUsesH46019fc(UsesH46019fc());
 				((RTPLogicalChannel*)lc)->SetH46019Direction(GetH46019Direction());
                 ((RTPLogicalChannel*)lc)->SetH46019UniDirectional(m_h46019uni);
-				((RTPLogicalChannel*)lc)->SetH46024SessionID((WORD)h225Params->m_sessionID);
+				((RTPLogicalChannel*)lc)->SetRTPSessionID((WORD)h225Params->m_sessionID);
 			} else {
 				PTRACE(1, "Can't find RTP port for logical channel " << flcn);
 			}


C уважением                       With Best Regards
Георгиевский Юрий.                Georgiewskiy Yuriy
+7 4872 711666                    +7 4872 711666
факс +7 4872 711143               fax +7 4872 711143
Компания ООО "Ай Ти Сервис"       IT Service Ltd
http://nkoort.ru                  http://nkoort.ru
JID: GHhost@xxxxxxxxxxxxxxxxxxxxx JID: GHhost@xxxxxxxxxxxxxxxxxxxxx
YG129-RIPE                        YG129-RIPE
------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________________

Posting: mailto:Openh323gk-users@xxxxxxxxxxxxxxxxxxxxx
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/

[Index of Archives]     [SIP]     [Open H.323]     [Gnu Gatekeeper]     [Asterisk PBX]     [ISDN Cause Codes]     [Yosemite News]

  Powered by Linux