31 #ifndef OPAL_H323_PECLIENT_H 32 #define OPAL_H323_PECLIENT_H 45 #include <ptlib/safecoll.h> 64 unsigned sequenceNumber,
90 virtual const char * GetName()
const;
96 H501_ServiceRequest &
srq;
97 H501_ServiceConfirmation &
scf;
98 H501_ServiceRejection &
srj;
117 virtual const char * GetName()
const;
123 H501_DescriptorUpdate &
du;
124 H501_DescriptorUpdateAck &
ack;
143 virtual const char * GetName()
const;
150 H501_AccessConfirmation &
acf;
151 H501_AccessRejection &
arj;
165 : descriptorID(_descriptorID), state(Dirty), creator(0)
168 Comparison Compare(
const PObject & obj)
const;
171 Protocol_H323 = 0x0001,
172 Protocol_Voice = 0x0002,
173 Protocol_Max = 0x0002,
174 Option_WildCard = 0x0004,
175 Option_SendAccessRequest = 0x0008,
176 Option_NotAvailable = 0x0010,
177 Option_PrioritySet = 0x0020,
178 Option_PriorityMask = 0x1fc0,
183 DefaultPriority = 80,
187 static inline unsigned SetPriorityOption(
unsigned pri) {
return Option_PrioritySet | ((pri & 0x7f) << 6); }
188 static inline unsigned GetPriorityOption(
unsigned options) {
return (options & Option_PrioritySet) != 0 ? ((options >> 6) & 0x7f) : (int)DefaultPriority; }
190 void CopyTo(H501_Descriptor & descriptor);
191 static PBoolean CopyToAddressTemplate(H501_AddressTemplate & addressTemplates,
192 const H225_EndpointType & ep,
193 const H225_ArrayOf_AliasAddress & aliases,
194 const H225_ArrayOf_AliasAddress & transportAddress,
197 static void SetProtocolList(H501_ArrayOf_SupportedProtocols & h501Protocols,
unsigned protocols);
198 static unsigned GetProtocolList(
const H501_ArrayOf_SupportedProtocols & h501Protocols);
202 PBoolean ContainsNonexistent();
228 : serviceID(_serviceID), ordinal(0)
275 ServiceRelationshipReestablished
279 LocalServiceRelationshipOrdinal = 0,
280 NoServiceRelationshipOrdinal = 1,
281 RemoteServiceRelationshipOrdinal = 2
294 PSafetyMode mode = PSafeReference
295 ) {
return PSafePtr<H323PeerElementDescriptor>(descriptors, mode); }
298 PSafetyMode mode = PSafeReference
299 ) {
return PSafePtr<H323PeerElementServiceRelationship>(localServiceRelationships, mode); }
302 PSafetyMode mode = PSafeReference
303 ) {
return PSafePtr<H323PeerElementServiceRelationship>(remoteServiceRelationships, mode); }
305 void SetLocalName(
const PString & name);
306 PString GetLocalName()
const;
308 void SetDomainName(
const PString & name);
309 PString GetDomainName()
const;
317 PBoolean SetOnlyServiceRelationship(
const PString & peer, PBoolean keepTrying =
true);
320 PBoolean RemoveServiceRelationship(
const OpalGloballyUniqueID & serviceID,
int reason = H501_ServiceReleaseReason::e_terminated);
321 PBoolean RemoveServiceRelationship(
const H323TransportAddress & peer,
int reason = H501_ServiceReleaseReason::e_terminated);
322 PBoolean RemoveAllServiceRelationships();
336 PBoolean AddDescriptor(
338 const PStringArray & aliases,
344 PBoolean AddDescriptor(
346 const H225_ArrayOf_AliasAddress & aliases,
352 PBoolean AddDescriptor(
354 const H225_ArrayOf_AliasAddress & aliases,
355 const H225_ArrayOf_AliasAddress & transportAddr,
360 PBoolean AddDescriptor(
362 const POrdinalKey & creator,
363 const H225_ArrayOf_AliasAddress & alias,
364 const H225_ArrayOf_AliasAddress & transportAddresses,
369 PBoolean AddDescriptor(
371 const POrdinalKey & creator,
372 const H501_ArrayOf_AddressTemplate & addressTemplates,
373 const PTime & updateTime,
379 PBoolean DeleteDescriptor(
const PString & alias, PBoolean now =
false);
380 PBoolean DeleteDescriptor(
const H225_AliasAddress & alias, PBoolean now =
false);
385 PBoolean AccessRequest(
386 const PString & searchAlias,
387 PStringArray & destAliases,
392 PBoolean AccessRequest(
393 const PString & searchAlias,
394 H225_ArrayOf_AliasAddress & destAliases,
399 PBoolean AccessRequest(
400 const H225_AliasAddress & searchAlias,
401 H225_ArrayOf_AliasAddress & destAliases,
406 PBoolean AccessRequest(
407 const H225_AliasAddress & alias,
408 H225_ArrayOf_AliasAddress & destAliases,
409 H225_AliasAddress & transportAddress,
417 PBoolean UpdateDescriptor(
H323PeerElementDescriptor * descriptor, H501_UpdateInformation_updateType::Choices updateType);
422 H501_UpdateInformation_updateType::Choices updateType);
426 H501_UpdateInformation_updateType::Choices updateType);
454 PBoolean OnReceiveServiceRequest(
const H501PDU & pdu,
const H501_ServiceRequest & pduBody);
455 PBoolean OnReceiveServiceConfirmation(
const H501PDU & pdu,
const H501_ServiceConfirmation & pduBody);
457 PBoolean OnReceiveDescriptorUpdate(
const H501PDU & pdu,
const H501_DescriptorUpdate & pduBody);
458 PBoolean OnReceiveDescriptorUpdateACK(
const H501PDU & pdu,
const H501_DescriptorUpdateAck & pduBody);
460 PBoolean OnReceiveAccessRequest(
const H501PDU & pdu,
const H501_AccessRequest & pduBody);
461 PBoolean OnReceiveAccessConfirmation (
const H501PDU & pdu,
const H501_AccessConfirmation & pduBody);
462 PBoolean OnReceiveAccessRejection(
const H501PDU & pdu,
const H501_AccessRejection & pduBody);
468 : H225_AliasAddress(_alias), id(_id), pos(_pos), wild(_wild)
482 H501_UpdateInformation_updateType::Choices updateType);
492 void RemoveDescriptorInformation(
const H501_ArrayOf_AddressTemplate & addressTemplates);
519 PDICTIONARY(StringToOrdinalKey, PString, POrdinalKey);
535 #endif // OPAL_H323_PECLIENT_H Definition: peclient.h:248
H501_ServiceRequest & srq
Definition: peclient.h:96
PString localIdentifier
Definition: peclient.h:499
static unsigned GetPriorityOption(unsigned options)
Definition: peclient.h:188
virtual void OnAddServiceRelationship(const H323TransportAddress &)
Definition: peclient.h:443
H323PeerElementServiceRelationship()
Definition: peclient.h:223
H323TransportAddressArray(const OpalTransportAddress &address)
Definition: transaddr.h:97
Options
Definition: peclient.h:170
Definition: h323annexg.h:52
H323PeerElementServiceRelationship(const OpalGloballyUniqueID &_serviceID)
Definition: peclient.h:227
PSemaphore requestMutex
Definition: peclient.h:502
PTime lastUpdateTime
Definition: peclient.h:239
Error
Definition: peclient.h:270
virtual void OnRemoveServiceRelationship(const H323TransportAddress &)
Definition: peclient.h:444
Definition: transports.h:703
PSafeSortedList< H323PeerElementServiceRelationship > localServiceRelationships
Definition: peclient.h:511
StringToOrdinalKey remotePeerAddrToOrdinalKey
Definition: peclient.h:520
OpalGloballyUniqueID serviceID
Definition: peclient.h:234
PMutex aliasMutex
Definition: peclient.h:526
virtual void OnUpdateDescriptor(const H323PeerElementDescriptor &)
Definition: peclient.h:447
H501_MessageCommonInfo & confirmCommon
Definition: peclient.h:71
Definition: h323trans.h:327
PMutex remotePeerListMutex
Definition: peclient.h:516
PString name
Definition: peclient.h:237
H501_AccessRequest & arq
Definition: peclient.h:149
virtual void OnRemoveDescriptor(const H323PeerElementDescriptor &)
Definition: peclient.h:448
PTime expireTime
Definition: peclient.h:240
H501_DescriptorUpdateAck & ack
Definition: peclient.h:124
Definition: peclient.h:206
static unsigned SetPriorityOption(unsigned pri)
Definition: peclient.h:187
AliasKeyList specificAliasToDescriptorID
Definition: peclient.h:528
PString gatekeeperID
Definition: peclient.h:211
AliasKey(const H225_AliasAddress &_alias, const OpalGloballyUniqueID &_id, PINDEX _pos, PBoolean _wild=false)
Definition: peclient.h:467
PSafeSortedList< H323PeerElementDescriptor > descriptors
Definition: peclient.h:522
virtual void SetRejectReason(unsigned reasonCode)=0
H323PeerElementDescriptor(const OpalGloballyUniqueID &_descriptorID)
Definition: peclient.h:164
Definition: peclient.h:464
OpalGloballyUniqueID id
Definition: peclient.h:471
H501_AccessConfirmation & acf
Definition: peclient.h:150
AliasKeyList wildcardAliasToDescriptorID
Definition: peclient.h:529
H501Transaction(H323PeerElement &pe, const H501PDU &pdu, PBoolean hasReject)
H323PeerElement & peerElement
Definition: peclient.h:74
H501_ServiceConfirmation & scf
Definition: peclient.h:97
virtual void OnNewDescriptor(const H323PeerElementDescriptor &)
Definition: peclient.h:446
Definition: peclient.h:80
POrdinalSet localServiceOrdinals
Definition: peclient.h:513
Definition: peclient.h:219
PTime lastChanged
Definition: peclient.h:212
AliasKeyList transportAddressToDescriptorID
Definition: peclient.h:527
Definition: peclient.h:272
PDECLARE_NOTIFIER(PThread, H323Transaction, SlowHandler)
Definition: h323trans.h:223
Definition: peclient.h:107
H323TransactionPDU * request
Definition: h323trans.h:390
Definition: peclient.h:273
PSORTED_LIST(OpalH224ClientList, OpalH224Client)
Definition: h323trans.h:51
PThread * monitor
Definition: peclient.h:503
ValidationResult
Definition: h235auth.h:83
PSafePtr< H323PeerElementServiceRelationship > GetFirstLocalServiceRelationship(PSafetyMode mode=PSafeReference)
Definition: peclient.h:297
PSyncPoint monitorTickle
Definition: peclient.h:505
Definition: peclient.h:171
Definition: peclient.h:53
PSafePtr< H323PeerElementDescriptor > GetFirstDescriptor(PSafetyMode mode=PSafeReference)
Definition: peclient.h:293
POrdinalKey ordinal
Definition: peclient.h:235
Comparison Compare(const PObject &obj) const
Definition: peclient.h:231
Definition: peclient.h:271
PMutex localPeerListMutex
Definition: peclient.h:512
PMutex localNameMutex
Definition: peclient.h:498
PDICTIONARY(H323CallIdentityDict, PString, H323Connection)
PBoolean wild
Definition: peclient.h:473
OpalGloballyUniqueID descriptorID
Definition: peclient.h:200
PINDEX basePeerOrdinal
Definition: peclient.h:508
PTime createdTime
Definition: peclient.h:238
PMutex basePeerOrdinalMutex
Definition: peclient.h:507
H501_MessageCommonInfo & requestCommon
Definition: peclient.h:70
Definition: peclient.h:205
virtual Response OnHandlePDU()=0
POrdinalKey creator
Definition: peclient.h:213
PStringToString remotePeerAddrToServiceID
Definition: peclient.h:518
PINDEX pos
Definition: peclient.h:472
virtual H323TransactionPDU * CreateRIP(unsigned sequenceNumber, unsigned delay) const
PSafeSortedList< H323PeerElementServiceRelationship > remoteServiceRelationships
Definition: peclient.h:517
PBoolean monitorStop
Definition: peclient.h:504
#define OpalGloballyUniqueID
Definition: guid.h:42
Response
Definition: h323trans.h:344
H323TransportAddress peer
Definition: peclient.h:236
Definition: peclient.h:160
Definition: peclient.h:133
States
Definition: peclient.h:204
Definition: transaddr.h:66
Definition: peclient.h:274
PSafePtr< H323PeerElementServiceRelationship > GetFirstRemoteServiceRelationship(PSafetyMode mode=PSafeReference)
Definition: peclient.h:301
H501_ArrayOf_AddressTemplate addressTemplates
Definition: peclient.h:210
PString domainName
Definition: peclient.h:500
H501_AccessRejection & arj
Definition: peclient.h:151
H501_ServiceRejection & srj
Definition: peclient.h:98
virtual H235Authenticator::ValidationResult ValidatePDU() const
H501_DescriptorUpdate & du
Definition: peclient.h:123