"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/gkclient.cxx" between
h323plus-1_27_0.tar.gz and h323plus-1_27_1.tar.gz

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

gkclient.cxx  (h323plus-1_27_0):gkclient.cxx  (h323plus-1_27_1)
skipping to change at line 289 skipping to change at line 289
if (!transport->SetRemoteAddress(locatedAddress)) { if (!transport->SetRemoteAddress(locatedAddress)) {
PTRACE(2, "RAS\tInvalid gatekeeper discovery address: \"" << locatedAddress << '"'); PTRACE(2, "RAS\tInvalid gatekeeper discovery address: \"" << locatedAddress << '"');
return FALSE; return FALSE;
} }
if (gcf.HasOptionalField(H225_GatekeeperConfirm::e_alternateGatekeeper)) if (gcf.HasOptionalField(H225_GatekeeperConfirm::e_alternateGatekeeper))
SetAlternates(gcf.m_alternateGatekeeper, FALSE); SetAlternates(gcf.m_alternateGatekeeper, FALSE);
if (gcf.HasOptionalField(H225_GatekeeperConfirm::e_assignedGatekeeper)) { if (gcf.HasOptionalField(H225_GatekeeperConfirm::e_assignedGatekeeper)) {
SetAssignedGatekeeper(gcf.m_assignedGatekeeper); SetAssignedGatekeeper(gcf.m_assignedGatekeeper);
}
// switch if we are assigned to another gatekeeper, stay if its already the ri
ght one
H323TransportAddress assignedGKIP(assignedGK.rasAddress); // convert H225_Tran
sportAddress into H323TransportAddress
if (gcf.HasOptionalField(H225_GatekeeperConfirm::e_assignedGatekeeper) && assi
gnedGKIP != locatedAddress) {
// TODO: we still might have to register with this gatekeeper, because the a
ssigned gatekeeper might be down
// TODO: start a background thread to check assigned gatekeeper availability
, unless re-homing model is server-based
PTRACE(2, "RAS\tAssigned Gatekeeper redirected " << assignedGK); PTRACE(2, "RAS\tAssigned Gatekeeper redirected " << assignedGK);
// This will force the gatekeeper to register to the assigned Gatekeeper. // This will force the gatekeeper to register to the assigned Gatekeeper.
if (lastRequest->responseInfo != NULL) { if (lastRequest->responseInfo != NULL) {
H323TransportAddress & gkAddress = *(H323TransportAddress *)lastRequest->r esponseInfo; H323TransportAddress & gkAddress = *(H323TransportAddress *)lastRequest->r esponseInfo;
gkAddress = assignedGK.rasAddress; gkAddress = assignedGK.rasAddress;
gatekeeperIdentifier = PString(); gatekeeperIdentifier = PString();
} }
} else { } else {
endpoint.OnGatekeeperConfirm(); endpoint.OnGatekeeperConfirm();
discoveryComplete = TRUE; discoveryComplete = TRUE;
skipping to change at line 1403 skipping to change at line 1409
response.SetAuthenticators(authenticators); response.SetAuthenticators(authenticators);
return WritePDU(response); return WritePDU(response);
} }
static void AddInfoRequestResponseCall(H225_InfoRequestResponse & irr, static void AddInfoRequestResponseCall(H225_InfoRequestResponse & irr,
const H323Connection & connection) const H323Connection & connection)
{ {
irr.IncludeOptionalField(H225_InfoRequestResponse::e_perCallInfo); irr.IncludeOptionalField(H225_InfoRequestResponse::e_perCallInfo);
PINDEX sz = irr.m_perCallInfo.GetSize(); PINDEX sz = irr.m_perCallInfo.GetSize();
if (sz > 100) // don't include more than 100 calls in IRR to keep message size
reasonable
return;
if (!irr.m_perCallInfo.SetSize(sz+1)) if (!irr.m_perCallInfo.SetSize(sz+1))
return; return;
H225_InfoRequestResponse_perCallInfo_subtype & info = irr.m_perCallInfo[sz]; H225_InfoRequestResponse_perCallInfo_subtype & info = irr.m_perCallInfo[sz];
info.m_callReferenceValue = connection.GetCallReference(); info.m_callReferenceValue = connection.GetCallReference();
info.m_callIdentifier.m_guid = connection.GetCallIdentifier(); info.m_callIdentifier.m_guid = connection.GetCallIdentifier();
info.m_conferenceID = connection.GetConferenceIdentifier(); info.m_conferenceID = connection.GetConferenceIdentifier();
info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_orig inator); info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_orig inator);
info.m_originator = !connection.HadAnsweredCall(); info.m_originator = !connection.HadAnsweredCall();
H323_RTP_Session * session = connection.GetSessionCallbacks(RTP_Session::Defau // include details RTP info only for the first 10 calls to keep message size r
ltAudioSessionID); easonable
if (session != NULL) { if (sz <= 10) {
info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_au H323_RTP_Session * session = connection.GetSessionCallbacks(RTP_Session::Def
dio); aultAudioSessionID);
info.m_audio.SetSize(1); if (session != NULL) {
session->OnSendRasInfo(info.m_audio[0]); info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_
} audio);
info.m_audio.SetSize(1);
session->OnSendRasInfo(info.m_audio[0]);
}
session = connection.GetSessionCallbacks(RTP_Session::DefaultVideoSessionID); session = connection.GetSessionCallbacks(RTP_Session::DefaultVideoSessionID)
if (session != NULL) { ;
info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_vi if (session != NULL) {
deo); info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_
info.m_video.SetSize(1); video);
session->OnSendRasInfo(info.m_video[0]); info.m_video.SetSize(1);
session->OnSendRasInfo(info.m_video[0]);
}
} }
info.m_h245.IncludeOptionalField(H225_TransportChannelInfo::e_recvAddress);
info.m_h245.IncludeOptionalField(H225_TransportChannelInfo::e_sendAddress);
const H323Transport & controlChannel = connection.GetControlChannel(); const H323Transport & controlChannel = connection.GetControlChannel();
controlChannel.SetUpTransportPDU(info.m_h245.m_recvAddress, TRUE); controlChannel.SetUpTransportPDU(info.m_h245.m_recvAddress, false);
controlChannel.SetUpTransportPDU(info.m_h245.m_sendAddress, FALSE); controlChannel.SetUpTransportPDU(info.m_h245.m_sendAddress, true);
const H323Transport * sig = connection.GetSignallingChannel();
if (sig) {
info.m_callSignaling.IncludeOptionalField(H225_TransportChannelInfo::e_recvA
ddress);
info.m_callSignaling.IncludeOptionalField(H225_TransportChannelInfo::e_sendA
ddress);
sig->GetRemoteAddress().SetPDU(info.m_callSignaling.m_recvAddress);
sig->GetLocalAddress().SetPDU(info.m_callSignaling.m_sendAddress);
}
info.m_callType.SetTag(H225_CallType::e_pointToPoint); info.m_callType.SetTag(H225_CallType::e_pointToPoint);
info.m_bandWidth = connection.GetBandwidthUsed(); info.m_bandWidth = connection.GetBandwidthUsed();
info.m_callModel.SetTag(connection.IsGatekeeperRouted() ? H225_CallModel::e_ga tekeeperRouted info.m_callModel.SetTag(connection.IsGatekeeperRouted() ? H225_CallModel::e_ga tekeeperRouted
: H225_CallModel::e_di rect); : H225_CallModel::e_di rect);
info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_usag eInformation); info.IncludeOptionalField(H225_InfoRequestResponse_perCallInfo_subtype::e_usag eInformation);
SetRasUsageInformation(connection, info.m_usageInformation); SetRasUsageInformation(connection, info.m_usageInformation);
} }
skipping to change at line 1757 skipping to change at line 1778
transport = new H323TransportUDP(endpoint, PIPSocket::Address::GetAny(4)); transport = new H323TransportUDP(endpoint, PIPSocket::Address::GetAny(4));
transport->SetRemoteAddress(address); transport->SetRemoteAddress(address);
transport->Connect(); transport->Connect();
if (!gkid.IsEmpty()) if (!gkid.IsEmpty())
gatekeeperIdentifier = gkid; gatekeeperIdentifier = gkid;
} }
PBoolean H323Gatekeeper::MakeRequest(Request & request) PBoolean H323Gatekeeper::MakeRequest(Request & request)
{ {
if (PAssertNULL(transport) == NULL) if (transport == NULL)
return FALSE; return FALSE;
// Set authenticators if not already set by caller // Set authenticators if not already set by caller
requestMutex.Wait(); requestMutex.Wait();
if (request.requestPDU.GetAuthenticators().IsEmpty()) if (request.requestPDU.GetAuthenticators().IsEmpty())
request.requestPDU.SetAuthenticators(authenticators); request.requestPDU.SetAuthenticators(authenticators);
/* To be sure that the H323 Cleaner, H225 Caller or Monitor don't set the /* To be sure that the H323 Cleaner, H225 Caller or Monitor don't set the
transport address of the alternate while the other is in timeout. We transport address of the alternate while the other is in timeout. We
skipping to change at line 1818 skipping to change at line 1839
WORD localPort = 0; WORD localPort = 0;
do { do {
if (alt >= alternates.GetSize()) { if (alt >= alternates.GetSize()) {
if (!alternatePermanent) if (!alternatePermanent)
Connect(tempAddr,tempIdentifier); Connect(tempAddr,tempIdentifier);
requestMutex.Signal(); requestMutex.Signal();
return FALSE; return FALSE;
} }
altInfo = &alternates[alt++]; altInfo = &alternates[alt++];
transport->GetLocalAddress().GetIpAndPort(localAddress,localPort); if (transport) {
transport->CleanUpOnTermination(); transport->GetLocalAddress().GetIpAndPort(localAddress,localPort);
delete transport; transport->CleanUpOnTermination();
delete transport;
}
transport = new H323TransportUDP(endpoint,localAddress,localPort); transport = new H323TransportUDP(endpoint,localAddress,localPort);
transport->SetRemoteAddress (altInfo->rasAddress); transport->SetRemoteAddress (altInfo->rasAddress);
transport->Connect(); transport->Connect();
gatekeeperIdentifier = altInfo->gatekeeperIdentifier; gatekeeperIdentifier = altInfo->gatekeeperIdentifier;
StartChannel(); StartChannel();
} while (altInfo->registrationState == AlternateInfo::RegistrationFailed); } while (altInfo->registrationState == AlternateInfo::RegistrationFailed);
if (altInfo->registrationState == AlternateInfo::NeedToRegister) { if (altInfo->registrationState == AlternateInfo::NeedToRegister) {
altInfo->registrationState = AlternateInfo::RegistrationFailed; altInfo->registrationState = AlternateInfo::RegistrationFailed;
 End of changes. 8 change blocks. 
20 lines changed or deleted 53 lines changed or added

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