"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/h460/h46018_h225.cxx" between
h323plus-1_26_9.tar.gz and h323plus-1_27_0.tar.gz

About: H.323 Plus offers libraries for voice (VoIP) and videoconferencing using H.323.

h46018_h225.cxx  (h323plus-1_26_9):h46018_h225.cxx  (h323plus-1_27_0)
skipping to change at line 101 skipping to change at line 101
unsigned m_keepAliveInterval; unsigned m_keepAliveInterval;
PTime lastupdate; PTime lastupdate;
}; };
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
H46018TransportThread::H46018TransportThread(H323EndPoint & ep, H46018Transport * t) H46018TransportThread::H46018TransportThread(H323EndPoint & ep, H46018Transport * t)
: PThread(ep.GetSignallingThreadStackSize(), AutoDeleteThread, : PThread(ep.GetSignallingThreadStackSize(), AutoDeleteThread,
NormalPriority,"H46019 Answer:%0x"),transport(t) NormalPriority, "H46019 Answer:%0x"), transport(t)
{ {
isConnected = false; isConnected = false;
m_keepAliveInterval = H46019_KEEPALIVE_TIME; m_keepAliveInterval = H46019_KEEPALIVE_TIME;
// Start the Thread // Start the Thread
Resume(); Resume();
} }
H46018TransportThread::~H46018TransportThread() H46018TransportThread::~H46018TransportThread()
skipping to change at line 388 skipping to change at line 388
{ {
m_callSecurity = callSecurity; m_callSecurity = callSecurity;
} }
PBoolean H46018Handler::CreateH225Transport(const PASN_OctetString & information ) PBoolean H46018Handler::CreateH225Transport(const PASN_OctetString & information )
{ {
H46018_IncomingCallIndication callinfo; H46018_IncomingCallIndication callinfo;
PPER_Stream raw(information); PPER_Stream raw(information);
if (!callinfo.Decode(raw)) { if (!callinfo.Decode(raw)) {
PTRACE(2,"H46018\tUnable to decode incoming call Indication."); PTRACE(2, "H46018\tUnable to decode incoming call Indication.");
return false; return false;
} }
PTRACE(4, "H46018\t" << callinfo ); PTRACE(4, "H46018\t" << callinfo );
m_address = H323TransportAddress(callinfo.m_callSignallingAddress); m_address = H323TransportAddress(callinfo.m_callSignallingAddress);
m_callId = OpalGloballyUniqueID(callinfo.m_callID.m_guid); m_callId = OpalGloballyUniqueID(callinfo.m_callID.m_guid);
// Fix for Tandberg boxes that send duplicate SCI messages. // Fix for Tandberg boxes that send duplicate SCI messages.
if (m_callId.AsString() == lastCallIdentifer) { if (m_callId.AsString() == lastCallIdentifer) {
PTRACE(2,"H46018\tDuplicate Call Identifer " << lastCallIdentifer << " I gnoring request!"); PTRACE(2, "H46018\tDuplicate Call Identifer " << lastCallIdentifer << " Ignoring request!");
return false; return false;
} }
PTRACE(5, "H46018\tCreating H225 Channel"); PTRACE(5, "H46018\tCreating H225 Channel");
// We throw the socket creation onto another thread as with UMTS networks it may take several // We throw the socket creation onto another thread as with UMTS networks it may take several
// seconds to actually create the connection and we don't want to wait befor e signalling back // seconds to actually create the connection and we don't want to wait befor e signalling back
// to the gatekeeper. This also speeds up connection time which is also nice :) - SH // to the gatekeeper. This also speeds up connection time which is also nice :) - SH
SocketCreateThread = PThread::Create(PCREATE_NOTIFIER(SocketThread), 0, PThr ead::AutoDeleteThread, PThread::NormalPriority, "SocketCreator"); SocketCreateThread = PThread::Create(PCREATE_NOTIFIER(SocketThread), 0, PThr ead::AutoDeleteThread, PThread::NormalPriority, "SocketCreator");
skipping to change at line 698 skipping to change at line 698
} }
bool PNatMethod_H46019::IsAvailable(const PIPSocket::Address & /*address*/) bool PNatMethod_H46019::IsAvailable(const PIPSocket::Address & /*address*/)
{ {
return handler->IsEnabled() && active; return handler->IsEnabled() && active;
} }
void PNatMethod_H46019::SetAvailable() void PNatMethod_H46019::SetAvailable()
{ {
if (!available) { if (!available) {
handler->GetEndPoint()->NATMethodCallBack(GetName(),1,"Available"); handler->GetEndPoint()->NATMethodCallBack(GetName(), 1, "Available");
available = TRUE; available = TRUE;
} }
} }
#ifdef H323_H46019M #ifdef H323_H46019M
void PNatMethod_H46019::EnableMultiplex(bool enable) void PNatMethod_H46019::EnableMultiplex(bool enable)
{ {
multiplex = enable; multiplex = enable;
} }
skipping to change at line 736 skipping to change at line 736
} }
PUDPSocket * & PNatMethod_H46019::GetMultiplexSocket(bool rtp) PUDPSocket * & PNatMethod_H46019::GetMultiplexSocket(bool rtp)
{ {
if (rtp) if (rtp)
return (PUDPSocket * &)muxSockets.rtp; return (PUDPSocket * &)muxSockets.rtp;
else else
return (PUDPSocket * &)muxSockets.rtcp; return (PUDPSocket * &)muxSockets.rtcp;
} }
unsigned DetectSourceAddress(muxSocketMap & socMap, const PIPSocket::Address add r, WORD port) unsigned DetectSourceAddress(const muxSocketMap & socMap, const PIPSocket::Addre ss & addr, WORD port)
{ {
PIPSocketAddressAndPort daddr; PIPSocketAddressAndPort daddr;
daddr.SetAddress(addr,port); daddr.SetAddress(addr, port);
std::map< unsigned, PUDPSocket*>::const_iterator i; for (std::map<unsigned, PUDPSocket*>::const_iterator i = socMap.begin(); i !
for (i = socMap.begin(); i != socMap.end(); ++i) { = socMap.end(); ++i) {
PIPSocketAddressAndPort raddr; PIPSocketAddressAndPort raddr;
i->second->GetPeerAddress(raddr); if (i->second)
if (raddr.AsString() == daddr.AsString()) i->second->GetPeerAddress(raddr);
return i->first; if (raddr.AsString() == daddr.AsString())
return i->first;
} }
return 0; return 0;
} }
unsigned ResolveMuxIDFromSourceAddress(muxSocketMap & socMap, muxPortMap & portM ap, const PIPSocket::Address addr, WORD port) unsigned ResolveMuxIDFromSourceAddress(const muxSocketMap & socMap, muxPortMap & portMap, const PIPSocket::Address & addr, WORD port)
{ {
PIPSocketAddressAndPort daddr; PIPSocketAddressAndPort daddr;
daddr.SetAddress(addr,port); daddr.SetAddress(addr, port);
std::map<PString, unsigned>::const_iterator it; map<PString, unsigned>::const_iterator it = portMap.find(daddr.AsString());
it = portMap.find(daddr.AsString());
if (it != portMap.end()) if (it != portMap.end())
return it->second; return it->second;
unsigned id = DetectSourceAddress(socMap, addr, port); unsigned id = DetectSourceAddress(socMap, addr, port);
if (id) { if (id) {
PTRACE(2,"H46019M\tUnMUX Packet received from " << daddr.AsString() << " permenant assigned MUX " << id); PTRACE(2, "H46019M\tUnMUX Packet received from " << daddr.AsString() << " permenant assigned MUX " << id);
portMap.insert(pair<PString,unsigned>(daddr.AsString(),id)); portMap.insert(pair<PString,unsigned>(daddr.AsString(),id));
} }
return id; return id;
} }
unsigned ResolveSession(muxSocketMap & socMap, unsigned muxID, PBoolean rtp, con st PIPSocket::Address addr, WORD port, unsigned & correctMUX) unsigned ResolveSession(const muxSocketMap & socMap, unsigned muxID, PBoolean rt p, const PIPSocket::Address & addr, WORD port, unsigned & correctMUX)
{ {
if (PNatMethod_H46019::IsMultiplexed()) { // Check the send/receive multip lex is around the wrong way if (PNatMethod_H46019::IsMultiplexed()) { // Check the send/receive multip lex is around the wrong way
H46019UDPSocket * mapSocket = NULL; H46019UDPSocket * mapSocket = NULL;
unsigned eraseID = 0; unsigned eraseID = 0;
for (std::map< unsigned, PUDPSocket*>::const_iterator i = socMap.begin(); i != socMap.end(); ++i) { for (map<unsigned, PUDPSocket*>::const_iterator i = socMap.begin(); i != s ocMap.end(); ++i) {
if (((H46019UDPSocket *)i->second)->GetSendMultiplexID() == muxID) { if (((H46019UDPSocket *)i->second)->GetSendMultiplexID() == muxID) {
mapSocket = (H46019UDPSocket *)i->second; mapSocket = (H46019UDPSocket *)i->second;
eraseID = i->first; eraseID = i->first;
correctMUX = eraseID; correctMUX = eraseID;
break; break;
} }
} }
if (eraseID > 0) { if (eraseID > 0) {
mapSocket->SetMultiplexID(muxID,true); mapSocket->SetMultiplexID(muxID,true);
PNatMethod_H46019::RegisterSocket(rtp,muxID, mapSocket); PNatMethod_H46019::RegisterSocket(rtp,muxID, mapSocket);
PNatMethod_H46019::UnregisterSocket(rtp, eraseID); PNatMethod_H46019::UnregisterSocket(rtp, eraseID);
return muxID; return muxID;
} }
} }
return DetectSourceAddress(socMap, addr, port); return DetectSourceAddress(socMap, addr, port);
} }
void CloseAllSessions(muxSocketMap & socMap) void CloseAllSessions(const muxSocketMap & socMap)
{ {
std::map< unsigned, PUDPSocket*>::const_iterator i;
if (PNatMethod_H46019::IsMultiplexed()) { // Check the send/receive multip lex is around the wrong way if (PNatMethod_H46019::IsMultiplexed()) { // Check the send/receive multip lex is around the wrong way
for (i = socMap.begin(); i != socMap.end(); ++i) for (map<unsigned, PUDPSocket*>::const_iterator i = socMap.begin(); i !=
i->second->Close(); socMap.end(); ++i) {
i->second->Close();
}
} }
} }
void PNatMethod_H46019::StartMultiplexListener() void PNatMethod_H46019::StartMultiplexListener()
{ {
if (m_readThread) if (m_readThread)
return; return;
muxShutdown = false; muxShutdown = false;
m_readThread = PThread::Create(PCREATE_NOTIFIER(ReadThread), 0, m_readThread = PThread::Create(PCREATE_NOTIFIER(ReadThread), 0,
PThread::AutoDeleteThread, PThread::AutoDeleteThread,
PThread::NormalPriority, PThread::NormalPriority,
"GkMonitor:%x"); "GkMonitor:%x");
} }
void PNatMethod_H46019::ReadThread(PThread &, H323_INT) void PNatMethod_H46019::ReadThread(PThread &, H323_INT)
{ {
PINDEX bufferLen = 2000; PINDEX bufferLen = 2000;
RTP_MultiDataFrame buffer(bufferLen); RTP_MultiDataFrame buffer(bufferLen);
PINDEX len = bufferLen; PINDEX len = bufferLen;
PIPSocket::Address addr; PIPSocket::Address addr;
WORD port = 0; WORD port = 0;
PUDPSocket * socket = NULL; PUDPSocket * socket = NULL;
H46019MultiplexSocket::MuxType socketRead; H46019MultiplexSocket::MuxType socketRead;
PUDPSocket & dataSocket = *GetMultiplexReadSocket(true); PUDPSocket & dataSocket = *GetMultiplexReadSocket(true);
PUDPSocket & ctrlSocket = *GetMultiplexReadSocket(false); PUDPSocket & ctrlSocket = *GetMultiplexReadSocket(false);
int select = 0;
while (!muxShutdown) {
if (select == 0)
select = PIPSocket::Select(dataSocket, ctrlSocket);
int select = 0; switch (select) {
while (!muxShutdown) {
if (select == 0)
select = PIPSocket::Select(dataSocket,ctrlSocket);
switch (select) {
case -1: case -1:
socketRead = H46019MultiplexSocket::e_rtp; socketRead = H46019MultiplexSocket::e_rtp;
socket = &dataSocket; socket = &dataSocket;
select = 0; select = 0;
break; break;
case -2: case -2:
case -3: case -3:
socketRead = H46019MultiplexSocket::e_rtcp; socketRead = H46019MultiplexSocket::e_rtcp;
socket = &ctrlSocket; socket = &ctrlSocket;
if (select == -3) select = -1; // loop back to read RTP socket if (select == -3) select = -1; // loop back to read RTP socket
else select = 0; else select = 0;
break; break;
default: default:
select = 0; select = 0;
continue; continue;
} }
if (!muxShutdown && socket && socket->ReadFrom(buffer.GetPointer(), len, add
r, port)) {
int actRead = socket->GetLastReadCount();
int muxHeader = buffer.GetMultiHeaderSize();
map<unsigned, PUDPSocket*>::const_iterator it;
switch (socketRead) {
case H46019MultiplexSocket::e_rtp:
{
DWORD multiplexID = 0;
if (PNatMethod_H46019::IsMultiplexed() && !buffer.IsValidRTPPayl
oad()) {
if (!buffer.IsNotMultiplexed()) {
PTRACE(2, "H46019M\tBad RTP MUX Packet received from " <
< addr << ":" << port);
continue;
}
// We have received a valid RTP UnMuxed Packet.
muxHeader = 0; // Read from the first byte
multiplexID = ResolveMuxIDFromSourceAddress(rtpSocketMap, rt
pPortMap, addr, port);
} else {
multiplexID = buffer.GetMultiplexID();
}
if (!muxShutdown && socket && socket->ReadFrom(buffer.GetPointer(),len, it = rtpSocketMap.find(multiplexID);
addr,port)) { if (it == rtpSocketMap.end()) {
int actRead = socket->GetLastReadCount(); unsigned badMUXid = multiplexID;
int muxHeader = buffer.GetMultiHeaderSize(); unsigned rightMUXid = 0;
std::map<unsigned,PUDPSocket*>::const_iterator it; unsigned detected = ResolveSession(rtpSocketMap, badMUXi
switch (socketRead) { d, true, addr, port, rightMUXid);
case H46019MultiplexSocket::e_rtp: if (!detected) {
{ PTRACE(2, "H46019M\tReceived RTP packet with unknown
DWORD multiplexID = 0; MUX ID " << badMUXid << " " << addr << ":" << port);
if (PNatMethod_H46019::IsMultiplexed() && !buffer.IsValidRTPPay continue;
load()) { }
if (!buffer.IsNotMultiplexed()) { it = rtpSocketMap.find(detected);
PTRACE(2,"H46019M\tBad RTP MUX Packet received from " < if (it == rtpSocketMap.end()) continue;
< addr << ":" << port);
continue; if (rightMUXid == 0) {
} PTRACE(2, "H46019M\tERROR: Receive UnMultiplex Packe
// We have received a valid RTP UnMuxed Packet. t " << " " << addr << ":" << port);
muxHeader = 0; // Read from the first byte. ((H46019UDPSocket *)it->second)->WriteMultiplexBuffe
multiplexID = ResolveMuxIDFromSourceAddress(rtpSocketMap, r r(buffer.GetPointer(), actRead, addr, port);
tpPortMap, addr, port); continue;
} else { }
multiplexID = buffer.GetMultiplexID(); PTRACE(2, "H46019M\tERROR: Recover Receive Multiplex Ses
} sion " << rightMUXid << " incorrectly sent as " << badMUXid);
}
it = rtpSocketMap.find(multiplexID); break;
if (it == rtpSocketMap.end()) { }
unsigned badMUXid = multiplexID;
unsigned rightMUXid = 0; case H46019MultiplexSocket::e_rtcp:
unsigned detected = ResolveSession(rtpSocketMap, badMUXid, it = rtcpSocketMap.find(buffer.GetMultiplexID());
true, addr, port, rightMUXid); if (it == rtcpSocketMap.end()) {
if (!detected) { PTRACE(2, "H46019M\tReceived RTCP packet with unknown MU
PTRACE(2,"H46019M\tReceived RTP packet with unknown MU X ID "
X ID " << badMUXid << " " << addr << ":" << port); << buffer.GetMultiplexID() << " " << addr << ":"
continue; << port);
} continue;
it = rtpSocketMap.find(detected); }
if (it == rtpSocketMap.end()) continue; break;
default:
if (rightMUXid == 0) { PTRACE(2, "H46019M\tUnknown Muxed RTP packet received from "
PTRACE(2,"H46019M\tERROR: Receive UnMultiplex Packet " << addr << ":" << port);
<< " " << addr << ":" << port); continue;
((H46019UDPSocket *)it->second)->WriteMultiplexBuffer(
buffer.GetPointer(), actRead, addr, port);
continue;
}
PTRACE(2,"H46019M\tERROR: Recover Receive Multiplex Session
" << rightMUXid << " incorrectly sent as " << badMUXid);
}
break;
}
case H46019MultiplexSocket::e_rtcp:
it = rtcpSocketMap.find(buffer.GetMultiplexID());
if (it == rtcpSocketMap.end()) {
PTRACE(2,"H46019M\tReceived RTCP packet with unknown MUX ID
"
<< buffer.GetMultiplexID() << " " << add
r << ":" << port);
continue;
}
break;
default:
PTRACE(2,"H46019M\tUnknown Muxed RTP packet received from "
<< addr << ":" << port);
continue;
} }
((H46019UDPSocket *)it->second)->WriteMultiplexBuffer(buffer.GetPoi nter()+muxHeader, actRead-muxHeader, addr, port); ((H46019UDPSocket *)it->second)->WriteMultiplexBuffer(buffer.GetPoi nter()+muxHeader, actRead-muxHeader, addr, port);
len = bufferLen; len = bufferLen;
} else { } else {
if (muxShutdown) continue; if (muxShutdown) continue;
switch (socket->GetErrorNumber(PChannel::LastReadError)) { switch (socket->GetErrorNumber(PChannel::LastReadError)) {
case ECONNRESET : case ECONNRESET :
/* PTRACE(2, "H46019M\tUDP Port Reset! Closing all Sockets"); /* PTRACE(2, "H46019M\tUDP Port Reset! Closing all Sockets");
skipping to change at line 947 skipping to change at line 946
{ {
if (rtp) if (rtp)
rtpSocketMap.insert(pair<unsigned, PUDPSocket*>(id,socket)); rtpSocketMap.insert(pair<unsigned, PUDPSocket*>(id,socket));
else else
rtcpSocketMap.insert(pair<unsigned, PUDPSocket*>(id,socket)); rtcpSocketMap.insert(pair<unsigned, PUDPSocket*>(id,socket));
} }
void PNatMethod_H46019::UnregisterSocket(bool rtp, unsigned id) void PNatMethod_H46019::UnregisterSocket(bool rtp, unsigned id)
{ {
if (rtp) { if (rtp) {
std::map<unsigned,PUDPSocket*>::iterator it = rtpSocketMap.find(id); std::map<unsigned, PUDPSocket*>::iterator it = rtpSocketMap.find(id);
if (it != rtpSocketMap.end()) if (it != rtpSocketMap.end())
rtpSocketMap.erase(it); rtpSocketMap.erase(it);
} else { } else {
std::map<unsigned,PUDPSocket*>::iterator it = rtcpSocketMap.find(id); std::map<unsigned, PUDPSocket*>::iterator it = rtcpSocketMap.find(id);
if (it != rtcpSocketMap.end()) if (it != rtcpSocketMap.end())
rtcpSocketMap.erase(it); rtcpSocketMap.erase(it);
} }
if (rtp && rtpSocketMap.size() == 0) { if (rtp && rtpSocketMap.size() == 0) {
muxShutdown = true; muxShutdown = true;
if (muxSockets.rtp) { if (muxSockets.rtp) {
muxSockets.rtp->Close(); muxSockets.rtp->Close();
delete muxSockets.rtp; delete muxSockets.rtp;
muxSockets.rtp = NULL; muxSockets.rtp = NULL;
skipping to change at line 984 skipping to change at line 983
#ifdef H323_H46019M #ifdef H323_H46019M
H46019MultiplexSocket::H46019MultiplexSocket() H46019MultiplexSocket::H46019MultiplexSocket()
: m_subSocket(NULL), m_plexType(e_unknown) : m_subSocket(NULL), m_plexType(e_unknown)
{ {
} }
H46019MultiplexSocket::H46019MultiplexSocket(bool rtp) H46019MultiplexSocket::H46019MultiplexSocket(bool rtp)
: m_subSocket(NULL), m_plexType(rtp ? e_rtp : e_rtcp) : m_subSocket(NULL), m_plexType(rtp ? e_rtp : e_rtcp)
{ {
} }
H46019MultiplexSocket::~H46019MultiplexSocket() H46019MultiplexSocket::~H46019MultiplexSocket()
{ {
Close(); Close();
if (m_subSocket) if (m_subSocket)
delete m_subSocket; delete m_subSocket;
} }
skipping to change at line 1107 skipping to change at line 1105
keepip = ip; keepip = ip;
keepport = port; keepport = port;
} }
if (_payload > 0) if (_payload > 0)
keeppayload = _payload; keeppayload = _payload;
if (_ttl > 0) if (_ttl > 0)
keepTTL = _ttl; keepTTL = _ttl;
PTRACE(4,"H46019UDP\tSetting " << keepip << ":" << keepport << " ping " << k eepTTL << " secs."); PTRACE(4, "H46019UDP\tSetting " << keepip << ":" << keepport << " ping " << keepTTL << " secs.");
} }
void H46019UDPSocket::Activate() void H46019UDPSocket::Activate()
{ {
InitialiseKeepAlive(); InitialiseKeepAlive();
} }
void H46019UDPSocket::Activate(const H323TransportAddress & keepalive, unsigned _payload, unsigned _ttl) void H46019UDPSocket::Activate(const H323TransportAddress & keepalive, unsigned _payload, unsigned _ttl)
{ {
Allocate(keepalive,_payload,_ttl); Allocate(keepalive, _payload, _ttl);
InitialiseKeepAlive(); InitialiseKeepAlive();
} }
PBoolean H46019UDPSocket::Close() PBoolean H46019UDPSocket::Close()
{ {
#ifdef H323_H46019M #ifdef H323_H46019M
m_shutDown = true; m_shutDown = true;
#endif #endif
return H323UDPSocket::Close(); return H323UDPSocket::Close();
} }
void H46019UDPSocket::InitialiseKeepAlive() void H46019UDPSocket::InitialiseKeepAlive()
{ {
PWaitAndSignal m(PingMutex); PWaitAndSignal m(PingMutex);
if (Keep.IsRunning()) { if (Keep.IsRunning()) {
PTRACE(6,"H46019UDP\t" << (rtpSocket ? "RTP" : "RTCP") << " ping already running."); PTRACE(6, "H46019UDP\t" << (rtpSocket ? "RTP" : "RTCP") << " ping alread y running.");
return; return;
} }
if (keepTTL > 0 && keepip.IsValid() && !keepip.IsLoopback() && !keepip.IsAny ()) { if (keepTTL > 0 && keepip.IsValid() && !keepip.IsLoopback() && !keepip.IsAny ()) {
keepseqno = 100; // Some arbitrary number keepseqno = 100; // Some arbitrary number
keepStartTime = new PTime(); keepStartTime = new PTime();
PTRACE(4,"H46019UDP\tStart " << (rtpSocket ? "RTP" : "RTCP") << " pingin g " PTRACE(4, "H46019UDP\tStart " << (rtpSocket ? "RTP" : "RTCP") << " pingi ng "
<< keepip << ":" << keepport << " every " << keepTTL << " secs."); << keepip << ":" << keepport << " every " << keepTTL << " secs.");
Keep.SetNotifier(PCREATE_NOTIFIER(Ping)); Keep.SetNotifier(PCREATE_NOTIFIER(Ping));
Keep.RunContinuous(keepTTL * 1000); // This will fire at keepTTL sec t ime. Keep.RunContinuous(keepTTL * 1000); // This will fire at keepTTL sec t ime.
// To start before keepTTL interval do a number of special probes to en sure the gatekeeper // To start before keepTTL interval do a number of special probes to en sure the gatekeeper
// is reached to allow media to flow properly. // is reached to allow media to flow properly.
initialKeep = PThread::Create(PCREATE_NOTIFIER(StartKeepAlives), 0, PThr ead::AutoDeleteThread, PThread::NormalPriority, "Initial KeepAlive Thread"); initialKeep = PThread::Create(PCREATE_NOTIFIER(StartKeepAlives), 0, PThr ead::AutoDeleteThread, PThread::NormalPriority, "Initial KeepAlive Thread");
} else { } else {
PTRACE(2,"H46019UDP\t" << (rtpSocket ? "RTP" : "RTCP") << " PING NOT Re ady " PTRACE(2, "H46019UDP\t" << (rtpSocket ? "RTP" : "RTCP") << " PING NOT R eady "
<< keepip << ":" << keepport << " - " << keepTTL << " se cs."); << keepip << ":" << keepport << " - " << keepTTL << " se cs.");
} }
} }
void H46019UDPSocket::StartKeepAlives(PThread &, H323_INT) void H46019UDPSocket::StartKeepAlives(PThread &, H323_INT)
{ {
// Send a number of keep alive probes to ensure at least one reaches the gat ekeeper. // Send a number of keep alive probes to ensure at least one reaches the gat ekeeper.
// This thread MUST terminate prior to Ping timer firing at keepTTL (default 19 sec). // This thread MUST terminate prior to Ping timer firing at keepTTL (default 19 sec).
PINDEX i=0; PINDEX i=0;
while (i<H46019_KEEPALIVE_COUNT && Keep.IsRunning()) { while (i<H46019_KEEPALIVE_COUNT && Keep.IsRunning()) {
if (i>0) PThread::Sleep(H46019_KEEPALIVE_INTERVAL); if (i>0) PThread::Sleep(H46019_KEEPALIVE_INTERVAL);
rtpSocket ? SendRTPPing(keepip,keepport) : SendRTCPPing(); rtpSocket ? SendRTPPing(keepip, keepport) : SendRTCPPing();
i++; i++;
} }
} }
void H46019UDPSocket::Ping(PTimer &, H323_INT) void H46019UDPSocket::Ping(PTimer &, H323_INT)
{ {
rtpSocket ? SendRTPPing(keepip,keepport) : SendRTCPPing(); rtpSocket ? SendRTPPing(keepip, keepport) : SendRTCPPing();
} }
void H46019UDPSocket::SendRTPPing(const PIPSocket::Address & ip, const WORD & po rt, unsigned id) void H46019UDPSocket::SendRTPPing(const PIPSocket::Address & ip, const WORD & po rt, unsigned id)
{ {
RTP_DataFrame rtp; RTP_DataFrame rtp;
rtp.SetSequenceNumber(keepseqno); rtp.SetSequenceNumber(keepseqno);
rtp.SetPayloadType((RTP_DataFrame::PayloadTypes)keeppayload); rtp.SetPayloadType((RTP_DataFrame::PayloadTypes)keeppayload);
rtp.SetPayloadSize(0); rtp.SetPayloadSize(0);
skipping to change at line 1291 skipping to change at line 1289
keepTTL = val; keepTTL = val;
} }
#ifdef H323_H46019M #ifdef H323_H46019M
void H46019UDPSocket::GetMultiplexAddress(H323TransportAddress & address, unsign ed & multiID, PBoolean OLCack) void H46019UDPSocket::GetMultiplexAddress(H323TransportAddress & address, unsign ed & multiID, PBoolean OLCack)
{ {
// Get the local IP/Port of the underlying Multiplexed RTP; // Get the local IP/Port of the underlying Multiplexed RTP;
if (PNatMethod_H46019::IsMultiplexed()) { if (PNatMethod_H46019::IsMultiplexed()) {
Address addr; Address addr;
WORD port; WORD port;
PNatMethod_H46019::GetMultiplexSocket(rtpSocket)->GetLocalAddress(addr,p ort); PNatMethod_H46019::GetMultiplexSocket(rtpSocket)->GetLocalAddress(addr, port);
address = H323TransportAddress(addr,port); address = H323TransportAddress(addr,port);
} }
multiID = m_recvMultiplexID; multiID = m_recvMultiplexID;
} }
unsigned H46019UDPSocket::GetRecvMultiplexID() const unsigned H46019UDPSocket::GetRecvMultiplexID() const
{ {
return m_recvMultiplexID; return m_recvMultiplexID;
} }
unsigned H46019UDPSocket::GetSendMultiplexID() const unsigned H46019UDPSocket::GetSendMultiplexID() const
{ {
return m_sendMultiplexID; return m_sendMultiplexID;
} }
void H46019UDPSocket::SetMultiplexID(unsigned id, PBoolean isAck) void H46019UDPSocket::SetMultiplexID(unsigned id, PBoolean isAck)
{ {
if (!m_sendMultiplexID) { if (!m_sendMultiplexID) {
PTRACE(3,"H46019\t" << (rtpSocket ? "RTP" : "RTCP") PTRACE(3, "H46019\t" << (rtpSocket ? "RTP" : "RTCP")
<< " MultiplexID for send Session " << m_Session << " MultiplexID for send Session " << m_Session << " set to " << id
<< " set to " << id); );
m_sendMultiplexID = id; m_sendMultiplexID = id;
} else { } else {
if (id != m_sendMultiplexID) { if (id != m_sendMultiplexID) {
PTRACE(1,"H46019\tERROR: " << (rtpSocket ? "RTP" : "RTCP") PTRACE(1, "H46019\tERROR: " << (rtpSocket ? "RTP" : "RTCP")
<< " MultiplexID OLCack for Send Session " << m_Session << " MultiplexID OLCack for Send Session " << m_Session
<< " not match OLC " << id << " was " << m_sendMultiplexID); << " not match OLC " << id << " was " << m_sendMultiplexID);
} else { } else {
PTRACE(3,"H46019\t" << (rtpSocket ? "RTP" : "RTCP") PTRACE(3, "H46019\t" << (rtpSocket ? "RTP" : "RTCP")
<< " MultiplexID send Session " << m_Session << " MultiplexID send Session " << m_Session << " already set to
<< " already set to " << id); " << id);
} }
} }
} }
PBoolean H46019UDPSocket::WriteMultiplexBuffer(const void * buf, PINDEX len, con st Address & addr, WORD port) PBoolean H46019UDPSocket::WriteMultiplexBuffer(const void * buf, PINDEX len, con st Address & addr, WORD port)
{ {
if (rtpSocket && len == 12) { /// Filter out RTP keepAlive Packets if (rtpSocket && len == 12) { /// Filter out RTP keepAlive Packets
#ifdef H323_H46024B #ifdef H323_H46024B
if (m_h46024b && addr == m_altAddr /*&& port == m_altPort*/) { if (m_h46024b && addr == m_altAddr /*&& port == m_altPort*/) {
PTRACE(4, "H46024B\ts:" << m_Session << (rtpSocket ? " RTP " : " RTC P ") PTRACE(4, "H46024B\ts:" << m_Session << (rtpSocket ? " RTP " : " RTC P ")
skipping to change at line 1360 skipping to change at line 1356
m_multiMutex.Wait(); m_multiMutex.Wait();
m_multQueue.push(packet); m_multQueue.push(packet);
m_multiMutex.Signal(); m_multiMutex.Signal();
m_multiBuffer++; m_multiBuffer++;
if (!rtpSocket) { if (!rtpSocket) {
RTP_ControlFrame frame(len); RTP_ControlFrame frame(len);
memcpy(frame.GetPointer(),buf,len); memcpy(frame.GetPointer(),buf,len);
if (frame.GetPayloadType() == RTP_ControlFrame::e_ApplDefined) { if (frame.GetPayloadType() == RTP_ControlFrame::e_ApplDefined) {
PTRACE(6,"H46024A\tReading RTCP Probe Packet."); PTRACE(6, "H46024A\tReading RTCP Probe Packet.");
PBYTEArray tempData; PBYTEArray tempData;
tempData.SetSize(2048); tempData.SetSize(2048);
int tempLen = 2048; int tempLen = 2048;
Address tempAddr; Address tempAddr;
return ReadFrom((void *)tempData.GetPointer(), tempLen, tempAddr, po rt); return ReadFrom((void *)tempData.GetPointer(), tempLen, tempAddr, po rt);
} }
} }
return true; return true;
} }
PBoolean H46019UDPSocket::ReadMultiplexBuffer(void * buf, PINDEX & len, Address & addr, WORD & port) PBoolean H46019UDPSocket::ReadMultiplexBuffer(void * buf, PINDEX & len, Address & addr, WORD & port)
{ {
if (m_multiBuffer == 0 || m_multQueue.size() == 0) if (m_multiBuffer == 0 || m_multQueue.size() == 0)
return false; return false;
m_multiMutex.Wait(); m_multiMutex.Wait();
H46019MultiPacket & packet = m_multQueue.front(); H46019MultiPacket & packet = m_multQueue.front();
addr = packet.fromAddr; addr = packet.fromAddr;
port = packet.fromPort; port = packet.fromPort;
len = packet.frame.GetSize(); len = packet.frame.GetSize();
memcpy(buf, packet.frame.GetPointer(), len); memcpy(buf, packet.frame.GetPointer(), len);
m_multQueue.pop(); m_multQueue.pop();
m_multiMutex.Signal(); m_multiMutex.Signal();
m_multiBuffer--; m_multiBuffer--;
return true; return true;
} }
void H46019UDPSocket::ClearMultiplexBuffer() void H46019UDPSocket::ClearMultiplexBuffer()
{ {
if (m_multiBuffer > 0) { if (m_multiBuffer > 0) {
m_multiMutex.Wait(); m_multiMutex.Wait();
while (!m_multQueue.empty()) { while (!m_multQueue.empty()) {
m_multQueue.pop(); m_multQueue.pop();
} }
m_multiMutex.Signal(); m_multiMutex.Signal();
} }
m_multiBuffer = 0; m_multiBuffer = 0;
} }
PBoolean H46019UDPSocket::DoPseudoRead(int & selectStatus) PBoolean H46019UDPSocket::DoPseudoRead(int & selectStatus)
{ {
if (m_recvMultiplexID == 0) if (m_recvMultiplexID == 0)
return false; return false;
if (rtpSocket) { if (rtpSocket) {
while (!m_shutDown && m_multiBuffer == 0) while (!m_shutDown && m_multiBuffer == 0)
selectBlock.Delay(3); selectBlock.Delay(3);
skipping to change at line 1497 skipping to change at line 1493
case e_direct: probeString = "Direct"; break; case e_direct: probeString = "Direct"; break;
}; };
return probeString; return probeString;
} }
void H46019UDPSocket::SetProbeState(probe_state newstate) void H46019UDPSocket::SetProbeState(probe_state newstate)
{ {
PWaitAndSignal m(probeMutex); PWaitAndSignal m(probeMutex);
if (m_state >= newstate) { if (m_state >= newstate) {
PTRACE(4,"H46024\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") < < "current state not changed from " << ProbeState(m_state)); PTRACE(4, "H46024\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << "current state not changed from " << ProbeState(m_state));
return; return;
} }
PTRACE(4,"H46024\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << " changing state from " << ProbeState(m_state) PTRACE(4, "H46024\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << " changing state from " << ProbeState(m_state)
<< " to " << ProbeState(newstate)); << " to " << ProbeState(newstate));
m_state = newstate; m_state = newstate;
} }
int H46019UDPSocket::GetProbeState() const int H46019UDPSocket::GetProbeState() const
{ {
PWaitAndSignal m(probeMutex); PWaitAndSignal m(probeMutex);
return m_state; return m_state;
} }
void H46019UDPSocket::SetAlternateAddresses(const H323TransportAddress & address , const PString & cui, unsigned muxID) void H46019UDPSocket::SetAlternateAddresses(const H323TransportAddress & address , const PString & cui, unsigned muxID)
{ {
address.GetIpAndPort(m_altAddr,m_altPort); address.GetIpAndPort(m_altAddr, m_altPort);
m_altMuxID = muxID; m_altMuxID = muxID;
PTRACE(6,"H46024A\ts: " << m_Session << (rtpSocket ? " RTP " : " RTCP ") PTRACE(6, "H46024A\ts: " << m_Session << (rtpSocket ? " RTP " : " RTCP ")
<< "Remote Alt: " << m_altAddr << ":" << m_altPort << " CUI: " << cui); << "Remote Alt: " << m_altAddr << ":" << m_altPort << " CUI: " << cui);
if (!rtpSocket) { if (!rtpSocket) {
m_CUIrem = cui; m_CUIrem = cui;
if (GetProbeState() < e_idle) { if (GetProbeState() < e_idle) {
SetProbeState(e_idle); SetProbeState(e_idle);
StartProbe(); StartProbe();
// We Already have a direct connection but we are waiting on the CUI for the reply // We Already have a direct connection but we are waiting on the CUI for the reply
} else if (GetProbeState() == e_verify_receiver) } else if (GetProbeState() == e_verify_receiver)
ProbeReceived(false,m_pendAddr,m_pendPort); ProbeReceived(false,m_pendAddr, m_pendPort);
} }
} }
void H46019UDPSocket::GetAlternateAddresses(H323TransportAddress & address, PStr ing & cui, unsigned & muxID) void H46019UDPSocket::GetAlternateAddresses(H323TransportAddress & address, PStr ing & cui, unsigned & muxID)
{ {
PIPSocket::Address tempAddr; PIPSocket::Address tempAddr;
WORD tempPort; WORD tempPort;
if (GetLocalAddress(tempAddr,tempPort)) if (GetLocalAddress(tempAddr, tempPort))
address = H323TransportAddress(tempAddr,tempPort); address = H323TransportAddress(tempAddr, tempPort);
#ifdef H323_H46019M #ifdef H323_H46019M
muxID = m_recvMultiplexID; muxID = m_recvMultiplexID;
#else #else
muxID = 0; muxID = 0;
#endif #endif
if (!rtpSocket) if (!rtpSocket)
cui = m_CUI; cui = m_CUI;
else else
cui = PString(); cui = PString();
if (GetProbeState() < e_idle) if (GetProbeState() < e_idle)
SetProbeState(e_initialising); SetProbeState(e_initialising);
PTRACE(6,"H46024A\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << " Alt:" << address << " CUI " << cui); PTRACE(6, "H46024A\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << " Alt:" << address << " CUI " << cui);
} }
PBoolean H46019UDPSocket::IsAlternateAddress(const Address & address,WORD port) PBoolean H46019UDPSocket::IsAlternateAddress(const Address & address,WORD port)
{ {
return ((address == m_detAddr) && (port == m_detPort)); return ((address == m_detAddr) && (port == m_detPort));
} }
void H46019UDPSocket::StartProbe() void H46019UDPSocket::StartProbe()
{ {
PTRACE(4,"H46024A\ts: " << m_Session << " Starting direct connection probe." ); PTRACE(4, "H46024A\ts: " << m_Session << " Starting direct connection probe. ");
SetProbeState(e_probing); SetProbeState(e_probing);
m_probes = 0; m_probes = 0;
m_Probe.SetNotifier(PCREATE_NOTIFIER(Probe)); m_Probe.SetNotifier(PCREATE_NOTIFIER(Probe));
m_Probe.RunContinuous(H46024A_PROBE_INTERVAL); m_Probe.RunContinuous(H46024A_PROBE_INTERVAL);
} }
void H46019UDPSocket::BuildProbe(RTP_ControlFrame & report, bool probing) void H46019UDPSocket::BuildProbe(RTP_ControlFrame & report, bool probing)
{ {
report.SetPayloadType(RTP_ControlFrame::e_ApplDefined); report.SetPayloadType(RTP_ControlFrame::e_ApplDefined);
skipping to change at line 1590 skipping to change at line 1586
data.SSRC = SSRC; data.SSRC = SSRC;
data.Length = sizeof(probe_packet); data.Length = sizeof(probe_packet);
PString id = "24.1"; PString id = "24.1";
PBYTEArray bytes(id,id.GetLength(), false); PBYTEArray bytes(id,id.GetLength(), false);
memcpy(&data.name[0], bytes, 4); memcpy(&data.name[0], bytes, 4);
PMessageDigest::Result bin_digest; PMessageDigest::Result bin_digest;
PMessageDigestSHA1::Encode(m_CallId.AsString() + m_CUIrem, bin_digest); PMessageDigestSHA1::Encode(m_CallId.AsString() + m_CUIrem, bin_digest);
memcpy(&data.cui[0], bin_digest.GetPointer(), bin_digest.GetSize()); memcpy(&data.cui[0], bin_digest.GetPointer(), bin_digest.GetSize());
memcpy(report.GetPayloadPtr(),&data,sizeof(probe_packet)); memcpy(report.GetPayloadPtr(), &data, sizeof(probe_packet));
} }
void H46019UDPSocket::Probe(PTimer &, H323_INT) void H46019UDPSocket::Probe(PTimer &, H323_INT)
{ {
m_probes++; m_probes++;
if (m_probes > H46024A_MAX_PROBE_COUNT) { if (m_probes > H46024A_MAX_PROBE_COUNT) {
m_Probe.Stop(); m_Probe.Stop();
return; return;
} }
if (GetProbeState() != e_probing) if (GetProbeState() != e_probing)
return; return;
RTP_ControlFrame report; RTP_ControlFrame report;
report.SetSize(4+sizeof(probe_packet)); report.SetSize(4 + sizeof(probe_packet));
BuildProbe(report, true); BuildProbe(report, true);
if (!WriteTo(report.GetPointer(),report.GetSize(), m_altAddr, m_altPort, m_ altMuxID)) { if (!WriteTo(report.GetPointer(),report.GetSize(), m_altAddr, m_altPort, m_ altMuxID)) {
switch (GetErrorNumber()) { switch (GetErrorNumber()) {
case ECONNRESET : case ECONNRESET :
case ECONNREFUSED : case ECONNREFUSED :
PTRACE(2, "H46024A\t" << m_altAddr << ":" << m_altPort << " not ready."); PTRACE(2, "H46024A\t" << m_altAddr << ":" << m_altPort << " not ready.");
break; break;
default: default:
skipping to change at line 1633 skipping to change at line 1629
PTRACE(6, "H46024A\ts" << m_Session <<" RTCP Probe sent: " << m_altAddr << ":" << m_altPort); PTRACE(6, "H46024A\ts" << m_Session <<" RTCP Probe sent: " << m_altAddr << ":" << m_altPort);
} }
} }
void H46019UDPSocket::ProbeReceived(bool probe, const PIPSocket::Address & addr, WORD & port) void H46019UDPSocket::ProbeReceived(bool probe, const PIPSocket::Address & addr, WORD & port)
{ {
if (probe) { if (probe) {
m_Handler.H46024ADirect(true, m_Token); //< Tell remote to wait for con nection m_Handler.H46024ADirect(true, m_Token); //< Tell remote to wait for con nection
} else if (addr.IsValid() && !addr.IsLoopback() && !addr.IsAny()) { } else if (addr.IsValid() && !addr.IsLoopback() && !addr.IsAny()) {
RTP_ControlFrame reply; RTP_ControlFrame reply;
reply.SetSize(4+sizeof(probe_packet)); reply.SetSize(4 + sizeof(probe_packet));
BuildProbe(reply, false); BuildProbe(reply, false);
if (SendRTCPFrame(reply,addr, port, m_altMuxID)) { if (SendRTCPFrame(reply,addr, port, m_altMuxID)) {
PTRACE(4, "H46024A\tRTCP Reply packet sent: " << addr << ":" << port ); PTRACE(4, "H46024A\tRTCP Reply packet sent: " << addr << ":" << port );
} }
} else { } else {
PTRACE(4, "H46024A\tRTCP Reply packet invalid Address: " << addr); PTRACE(4, "H46024A\tRTCP Reply packet invalid Address: " << addr);
} }
} }
skipping to change at line 1680 skipping to change at line 1676
RTP_ControlFrame frame(2048); RTP_ControlFrame frame(2048);
/// Set the detected routed remote address (on first packet received) /// Set the detected routed remote address (on first packet received)
if (m_remAddr.IsAny()) { if (m_remAddr.IsAny()) {
m_remAddr = addr; m_remAddr = addr;
m_remPort = port; m_remPort = port;
} }
#if H323_H46024B #if H323_H46024B
if (m_h46024b && addr == m_altAddr && port == m_altPort) { if (m_h46024b && addr == m_altAddr && port == m_altPort) {
PTRACE(4, "H46024B\ts:" << m_Session << (rtpSocket ? " RTP " : " RTC P ") PTRACE(4, "H46024B\ts:" << m_Session << (rtpSocket ? " RTP " : " RTC P ")
<< "Switching to " << addr << ":" << port << " from " << m_remAd dr << ":" << m_remPort); << "Switching to " << addr << ":" << port << " from " << m_remAd dr << ":" << m_remPort);
m_detAddr = addr; m_detPort = port; m_detAddr = addr;
m_detPort = port;
SetProbeState(e_direct); SetProbeState(e_direct);
Keep.Stop(); // Stop the keepAlive Packets Keep.Stop(); // Stop the keepAlive Packets
m_h46024b = false; m_h46024b = false;
} }
#endif #endif
/// Check the probe state /// Check the probe state
switch (GetProbeState()) { switch (GetProbeState()) {
case e_initialising: // RTCP only case e_initialising: // RTCP only
case e_idle: // RTCP only case e_idle: // RTCP only
case e_probing: // RTCP only case e_probing: // RTCP only
case e_verify_receiver: // RTCP only case e_verify_receiver: // RTCP only
frame.SetSize(len); frame.SetSize(len);
memcpy(frame.GetPointer(),buf,len); memcpy(frame.GetPointer(), buf, len);
if (ReceivedProbePacket(frame,probe,success)) { if (ReceivedProbePacket(frame, probe, success)) {
if (success) if (success)
ProbeReceived(probe,addr,port); ProbeReceived(probe, addr,port);
else { else {
m_pendAddr = addr; m_pendPort = port; m_pendAddr = addr;
m_pendPort = port;
} }
continue; // don't forward on probe packets. continue; // don't forward on probe packets.
} }
break; break;
case e_wait: case e_wait:
if (addr == keepip) {// We got a keepalive ping... if (addr == keepip) {// We got a keepalive ping...
Keep.Stop(); // Stop the keepAlive Packets Keep.Stop(); // Stop the keepAlive Packets
} else if ((addr == m_altAddr) && (port == m_altPort)) { } else if ((addr == m_altAddr) && (port == m_altPort)) {
PTRACE(4, "H46024A\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << "Already sending direct!"); PTRACE(4, "H46024A\ts:" << m_Session << (rtpSocket ? " RTP " : " RTCP ") << "Already sending direct!");
m_detAddr = addr; m_detPort = port; m_detAddr = addr; m_detPort = port;
skipping to change at line 1786 skipping to change at line 1784
if (cstate > e_probing) { if (cstate > e_probing) {
PTRACE(6, "H46024A\ts:" << m_Session <<" received RTCP probe packet. IGN ORING! Already authenticated."); PTRACE(6, "H46024A\ts:" << m_Session <<" received RTCP probe packet. IGN ORING! Already authenticated.");
return false; return false;
} }
probe = (frame.GetCount() > 0); probe = (frame.GetCount() > 0);
PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply" : "Request") << " received."); PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply" : "Request") << " received.");
BYTE * data = frame.GetPayloadPtr(); BYTE * data = frame.GetPayloadPtr();
PBYTEArray bytes(20); PBYTEArray bytes(20);
memcpy(bytes.GetPointer(),data+12, 20); memcpy(bytes.GetPointer(), data + 12, 20);
PMessageDigest::Result bin_digest; PMessageDigest::Result bin_digest;
PMessageDigestSHA1::Encode(m_CallId.AsString() + m_CUI, bin_digest); PMessageDigestSHA1::Encode(m_CallId.AsString() + m_CUI, bin_digest);
PBYTEArray val(bin_digest.GetPointer(),bin_digest.GetSize()); PBYTEArray val(bin_digest.GetPointer(),bin_digest.GetSize());
if (bytes != val) { if (bytes != val) {
PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply " : "Request") << " verify FAILURE"); PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply " : "Request") << " verify FAILURE");
return false; return false;
} }
PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply" : "Request") << " verified."); PTRACE(4, "H46024A\ts:" << m_Session <<" RTCP Probe " << (probe ? "Reply" : "Request") << " verified.");
skipping to change at line 1815 skipping to change at line 1813
return true; return true;
} }
#endif #endif
#ifdef H323_H46024B #ifdef H323_H46024B
void H46019UDPSocket::H46024Bdirect(const H323TransportAddress & address, unsign ed muxID) void H46019UDPSocket::H46024Bdirect(const H323TransportAddress & address, unsign ed muxID)
{ {
if (GetProbeState() == e_direct) // We might already be doing annex A if (GetProbeState() == e_direct) // We might already be doing annex A
return; return;
address.GetIpAndPort(m_altAddr,m_altPort); address.GetIpAndPort(m_altAddr, m_altPort);
m_altMuxID = muxID; m_altMuxID = muxID;
PTRACE(6,"H46024b\ts: " << m_Session << " RTP Remote Alt: " << m_altAddr << ":" << m_altPort PTRACE(6, " H46024b\ts: " << m_Session << " RTP Remote Alt: " << m_altAddr < < ":" << m_altPort
<< " " << m_altMuxID); << " " << m_altMuxID);
m_h46024b = true; m_h46024b = true;
// Sending an empty RTP frame to the alternate address // Sending an empty RTP frame to the alternate address
// will add a mapping to the router to receive RTP from // will add a mapping to the router to receive RTP from
// the remote // the remote
for (PINDEX i=0; i<3; i++) { for (PINDEX i = 0; i < 3; i++) {
SendRTPPing(m_altAddr, m_altPort, m_altMuxID); SendRTPPing(m_altAddr, m_altPort, m_altMuxID);
PThread::Sleep(10); PThread::Sleep(10);
} }
} }
#endif // H323_H46024B #endif // H323_H46024B
#endif // H323_H460 #endif // H323_H460
 End of changes. 60 change blocks. 
160 lines changed or deleted 162 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)