00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322 #ifndef __OPAL_H323EP_H
00323 #define __OPAL_H323EP_H
00324
00325 #include "h323.h"
00326 #include "h323con.h"
00327
00328 class PHandleAggregator;
00329
00330 #ifdef H323_TRANSNEXUS_OSP
00331 #include "opalosp.h"
00332 #endif
00333
00334
00335
00336
00337
00338
00339 class H225_EndpointType;
00340 class H225_VendorIdentifier;
00341 class H225_H221NonStandard;
00342 class H225_ServiceControlDescriptor;
00343
00344 class H323SignalPDU;
00345 class H323ConnectionsCleaner;
00346 class H323ServiceControlSession;
00347
00348 #if OPAL_H224
00349 class OpalH224Handler;
00350 class OpalH281Handler;
00351 #endif
00352
00353 #ifndef DISABLE_CALLAUTH
00354 #include "h235auth.h"
00355 #endif
00356
00357 #ifdef H323_T120
00358 class OpalT120Protocol;
00359 #endif
00360
00361 #ifdef H323_T38
00362 class OpalT38Protocol;
00363 #endif
00364
00365 #ifdef OPAL_H224
00366 class OpalH224Handler;
00367 class OpalH281Handler;
00368 #endif
00369
00370 #ifdef P_STUN
00371 #include <ptclib/pnat.h>
00372 class PSTUNClient;
00373 #endif
00374
00375 #ifdef P_USE_PRAGMA
00376 #pragma interface
00377 #endif
00378
00379 #ifdef H323_H460
00380 #include "h4601.h"
00381 #endif
00382
00384
00397 class H323EndPoint : public PObject
00398 {
00399 PCLASSINFO(H323EndPoint, PObject);
00400
00401 public:
00402 enum {
00403 DefaultTcpPort = 1720
00404 };
00405
00410 H323EndPoint();
00411
00414 ~H323EndPoint();
00415
00418 virtual void SetEndpointTypeInfo(
00419 H225_EndpointType & info
00420 ) const;
00421
00424 virtual void SetVendorIdentifierInfo(
00425 H225_VendorIdentifier & info
00426 ) const;
00427
00430 virtual void SetH221NonStandardInfo(
00431 H225_H221NonStandard & info
00432 ) const;
00434
00435
00446 void AddCapability(
00447 H323Capability * capability
00448 );
00449
00470 PINDEX SetCapability(
00471 PINDEX descriptorNum,
00472 PINDEX simultaneous,
00473 H323Capability * cap
00474 );
00475
00480 PINDEX AddAllCapabilities(
00481 PINDEX descriptorNum,
00482 PINDEX simultaneous,
00483 const PString & name
00484 );
00485
00488 void AddAllUserInputCapabilities(
00489 PINDEX descriptorNum,
00490 PINDEX simultaneous
00491 );
00492
00495 void RemoveCapabilities(
00496 const PStringArray & codecNames
00497 );
00498
00501 void ReorderCapabilities(
00502 const PStringArray & preferenceOrder
00503 );
00504
00507 H323Capability * FindCapability(
00508 const H245_Capability & cap
00509 ) const;
00510
00513 H323Capability * FindCapability(
00514 const H245_DataType & dataType
00515 ) const;
00516
00519 H323Capability * FindCapability(
00520 H323Capability::MainTypes mainType,
00521 unsigned subType
00522 ) const;
00524
00544 BOOL UseGatekeeper(
00545 const PString & address = PString::Empty(),
00546 const PString & identifier = PString::Empty(),
00547 const PString & localAddress = PString::Empty()
00548 );
00549
00560 BOOL SetGatekeeper(
00561 const PString & address,
00562 H323Transport * transport = NULL
00563 );
00564
00579 BOOL SetGatekeeperZone(
00580 const PString & address,
00581 const PString & identifier,
00582 H323Transport * transport = NULL
00583 );
00584
00594 BOOL LocateGatekeeper(
00595 const PString & identifier,
00596 H323Transport * transport = NULL
00597 );
00598
00607 BOOL DiscoverGatekeeper(
00608 H323Transport * transport = NULL
00609 );
00610
00618 virtual H323Gatekeeper * CreateGatekeeper(
00619 H323Transport * transport
00620 );
00621
00624 H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00625
00628 BOOL IsRegisteredWithGatekeeper() const;
00629
00635 BOOL RemoveGatekeeper(
00636 int reason = -1
00637 );
00638
00641 virtual void SetGatekeeperPassword(
00642 const PString & password
00643 );
00644
00647 virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00648
00651 virtual H235Authenticators CreateAuthenticators();
00652
00655 virtual void OnGatekeeperConfirm();
00656
00659 virtual void OnGatekeeperReject();
00660
00663 virtual void OnRegistrationConfirm();
00664
00667 virtual void OnRegistrationReject();
00669
00670 #ifdef H323_TRANSNEXUS_OSP
00671
00677 inline int SetOSPProvider(
00678 const PString & server
00679 )
00680 { return SetOSPProvider(server, PDirectory()); }
00681 virtual int SetOSPProvider(
00682 const PString & server,
00683 const PDirectory & ospDir
00684 );
00685 virtual void SetOSPProvider(
00686 OpalOSP::Provider * provider
00687 );
00688
00691 virtual OpalOSP::Provider * GetOSPProvider()
00692 { return ospProvider; }
00693
00694 #endif
00695
00712 BOOL StartListener(
00713 H323Listener * listener
00714 );
00715
00727 BOOL StartListener(
00728 const H323TransportAddress & iface
00729 );
00730
00747 BOOL StartListeners(
00748 const H323TransportAddressArray & ifaces
00749 );
00750
00754 BOOL RemoveListener(
00755 H323Listener * listener
00756 );
00757
00760 H323TransportAddressArray GetInterfaceAddresses(
00761 BOOL excludeLocalHost = TRUE,
00762 H323Transport * associatedTransport = NULL
00764 );
00765
00766 #ifndef DISABLE_CALLAUTH
00767
00771 H323Connection * MakeAuthenticatedCall (
00772 const PString & remoteParty,
00773 const PString & UserName,
00774 const PString & Password,
00775 PString & token,
00776 void * userData = NULL
00777 );
00778 #endif
00779
00798 H323Connection * MakeCall(
00799 const PString & remoteParty,
00800 PString & token,
00801 void * userData = NULL
00802 );
00803
00824 H323Connection * MakeCall(
00825 const PString & remoteParty,
00826 H323Transport * transport,
00827 PString & token,
00828 void * userData = NULL
00829 );
00830
00841 H323Connection * MakeCallLocked(
00842 const PString & remoteParty,
00843 PString & token,
00844 void * userData = NULL,
00845 H323Transport * transport = NULL
00846 );
00847
00848 #ifdef H323_H450
00849
00870 virtual H323Connection * SetupTransfer(
00871 const PString & token,
00872 const PString & callIdentity,
00873 const PString & remoteParty,
00874 PString & newToken,
00875 void * userData = NULL
00876 );
00877
00883 void TransferCall(
00884 const PString & token,
00885 const PString & remoteParty,
00886 const PString & callIdentity = PString::Empty()
00888 );
00889
00896 void ConsultationTransfer(
00897 const PString & primaryCallToken,
00898 const PString & secondaryCallToken
00899 );
00900
00904 void HoldCall(
00905 const PString & token,
00906 BOOL localHold
00907 );
00908
00912 H323Connection * IntrudeCall(
00913 const PString & remoteParty,
00914 PString & token,
00915 unsigned capabilityLevel,
00916 void * userData = NULL
00917 );
00918
00919 H323Connection * IntrudeCall(
00920 const PString & remoteParty,
00921 H323Transport * transport,
00922 PString & token,
00923 unsigned capabilityLevel,
00924 void * userData = NULL
00925 );
00926
00927 #endif // H323_H450
00928
00932 BOOL ResolveCallParty(
00933 const PString & _remoteParty,
00934 PStringList & addresses
00935 );
00936
00943 BOOL ParsePartyName(
00944 const PString & party,
00945 PString & alias,
00946 H323TransportAddress & address
00947 );
00948
00953 virtual BOOL ClearCall(
00954 const PString & token,
00955 H323Connection::CallEndReason reason =
00956 H323Connection::EndedByLocalUser
00957 );
00958
00964 virtual void OnCallClearing(H323Connection * connection,
00965 H323Connection::CallEndReason reason
00966 );
00967
00972 virtual BOOL ClearCallSynchronous(
00973 const PString & token,
00974 H323Connection::CallEndReason reason =
00975 H323Connection::EndedByLocalUser
00976 );
00977 virtual BOOL ClearCallSynchronous(
00978 const PString & token,
00979 H323Connection::CallEndReason reason,
00980 PSyncPoint * sync
00981 );
00982
00989 virtual void ClearAllCalls(
00990 H323Connection::CallEndReason reason =
00991 H323Connection::EndedByLocalUser,
00992 BOOL wait = TRUE
00993 );
00994
00997 virtual BOOL HasConnection(
00998 const PString & token
00999 );
01000
01012 H323Connection * FindConnectionWithLock(
01013 const PString & token
01014 );
01015
01018 PStringList GetAllConnections();
01019
01031 virtual BOOL OnIncomingCall(
01032 H323Connection & connection,
01033 const H323SignalPDU & setupPDU,
01034 H323SignalPDU & alertingPDU
01035 );
01036 virtual BOOL OnIncomingCall(
01037 H323Connection & connection,
01038 const H323SignalPDU & setupPDU,
01039 H323SignalPDU & alertingPDU,
01040 H323Connection::CallEndReason & reason
01041 );
01042
01047 virtual BOOL OnCallTransferInitiate(
01048 H323Connection & connection,
01049 const PString & remoteParty
01050 );
01051
01056 virtual BOOL OnCallTransferIdentify(
01057 H323Connection & connection
01058 );
01059
01064 virtual void OnSendARQ(
01065 H323Connection & conn,
01066 H225_AdmissionRequest & arq
01067 );
01068
01087 virtual H323Connection::AnswerCallResponse OnAnswerCall(
01088 H323Connection & connection,
01089 const PString & callerName,
01090 const H323SignalPDU & setupPDU,
01091 H323SignalPDU & connectPDU
01092 );
01093
01104 virtual BOOL OnAlerting(
01105 H323Connection & connection,
01106 const H323SignalPDU & alertingPDU,
01107 const PString & user
01108 );
01109
01118 virtual BOOL OnConnectionForwarded(
01119 H323Connection & connection,
01120 const PString & forwardParty,
01121 const H323SignalPDU & pdu
01122 );
01123
01132 virtual BOOL ForwardConnection(
01133 H323Connection & connection,
01134 const PString & forwardParty,
01135 const H323SignalPDU & pdu
01136 );
01137
01144 virtual void OnConnectionEstablished(
01145 H323Connection & connection,
01146 const PString & token
01147 );
01148
01151 virtual BOOL IsConnectionEstablished(
01152 const PString & token
01153 );
01154
01161 virtual void OnConnectionCleared(
01162 H323Connection & connection,
01163 const PString & token
01164 );
01165
01170 static PString BuildConnectionToken(
01171 const H323Transport & transport,
01172 unsigned callReference,
01173 BOOL fromRemote
01174 );
01175
01181 virtual H323Connection * OnIncomingConnection(
01182 H323Transport * transport,
01183 H323SignalPDU & setupPDU
01184 );
01185
01192 virtual BOOL OnOutgoingCall(
01193 H323Connection & conn,
01194 const H323SignalPDU & connectPDU
01195 );
01196
01199 virtual H323Connection * CreateConnection(
01200 unsigned callReference,
01201 void * userData,
01202 H323Transport * transport,
01203 H323SignalPDU * setupPDU
01204 );
01205 virtual H323Connection * CreateConnection(
01206 unsigned callReference,
01207 void * userData
01208 );
01209 virtual H323Connection * CreateConnection(
01210 unsigned callReference
01211 );
01212
01219 virtual void CleanUpConnections();
01221
01222 #ifndef DISABLE_CALLAUTH
01223
01231 virtual H235Authenticators CreateEPAuthenticators();
01232
01236 virtual BOOL GetEPCredentials(PString & password,
01237 PString & username
01238 );
01239
01242 virtual void SetEPCredentials(PString password,
01243 PString username
01244 );
01245
01246 enum EPSecurityPolicy
01247 {
01248 SecNone,
01249 SecRequest,
01250 SecRequired
01251 };
01252
01255 virtual void SetEPSecurityPolicy(EPSecurityPolicy policy);
01256
01259 virtual EPSecurityPolicy GetEPSecurityPolicy();
01260
01264 H235AuthenticatorList GetAuthenticatorList();
01265
01275 virtual BOOL OnCallAuthentication(const PString & username,
01276 PString & password
01277 );
01279 #endif
01280
01287 virtual BOOL OnStartLogicalChannel(
01288 H323Connection & connection,
01289 H323Channel & channel
01290 );
01291
01296 virtual void OnClosedLogicalChannel(
01297 H323Connection & connection,
01298 const H323Channel & channel
01299 );
01300
01301 #ifndef NO_H323_AUDIO_CODECS
01302
01309 virtual BOOL OpenAudioChannel(
01310 H323Connection & connection,
01311 BOOL isEncoding,
01312 unsigned bufferSize,
01313 H323AudioCodec & codec
01314 );
01315 #endif
01316
01317 #ifndef NO_H323_VIDEO
01318
01324 virtual BOOL OpenVideoChannel(
01325 H323Connection & connection,
01326 BOOL isEncoding,
01327 H323VideoCodec & codec
01328 );
01329 #endif // NO_H323_VIDEO
01330
01338 virtual void OnRTPStatistics(
01339 const H323Connection & connection,
01340 const RTP_Session & session
01341 ) const;
01343
01350 virtual void OnUserInputString(
01351 H323Connection & connection,
01352 const PString & value
01353 );
01354
01359 virtual void OnUserInputTone(
01360 H323Connection & connection,
01361 char tone,
01362 unsigned duration,
01363 unsigned logicalChannel,
01364 unsigned rtpTimestamp
01365 );
01366
01370 virtual void OnGatekeeperNATDetect(
01371 PIPSocket::Address publicAddr,
01372 PString & gkIdentifier,
01373 H323TransportAddress & gkRouteAddress
01374 );
01376
01377 #ifdef H323_H248
01378
01387 virtual void OnHTTPServiceControl(
01388 unsigned operation,
01389 unsigned sessionId,
01390 const PString & url
01391 );
01392
01393 virtual void OnCallCreditServiceControl(
01394 const PString & amount,
01395 BOOL mode,
01396 const unsigned & durationLimit
01397 );
01398
01408 virtual void OnCallCreditServiceControl(
01409 const PString & amount,
01410 BOOL mode
01411 );
01412
01416 virtual void OnServiceControlSession(
01417 unsigned type,
01418 unsigned sessionid,
01419 const H323ServiceControlSession & session,
01420 H323Connection * connection
01421 );
01422
01425 virtual H323ServiceControlSession * CreateServiceControlSession(
01426 const H225_ServiceControlDescriptor & contents
01427 );
01429 #endif // H323_H248
01430
01433 #ifdef H323_T120
01434
01444 virtual OpalT120Protocol * CreateT120ProtocolHandler(
01445 const H323Connection & connection
01446 ) const;
01447 #endif
01448
01449 #ifdef H323_T38
01450
01460 virtual OpalT38Protocol * CreateT38ProtocolHandler(
01461 const H323Connection & connection
01462 ) const;
01464 #endif
01465
01466 #if OPAL_H224
01467
01477 virtual OpalH224Handler * CreateH224ProtocolHandler(
01478 H323Connection & connection,
01479 unsigned sessionID
01480 ) const;
01481
01491 virtual OpalH281Handler * CreateH281ProtocolHandler(
01492 OpalH224Handler & h224Handler
01493 ) const;
01494 #endif
01495
01503 virtual BOOL OnConferenceInvite(
01504 BOOL sending,
01505 const H323Connection * connection,
01506 const H323SignalPDU & setupPDU
01507 );
01508
01514 virtual BOOL OnSendCallIndependentSupplementaryService(
01515 const H323Connection * connection,
01516 H323SignalPDU & pdu
01517 );
01518
01519 virtual BOOL OnReceiveCallIndependentSupplementaryService(
01520 const H323Connection * connection,
01521 const H323SignalPDU & pdu
01522 );
01523
01529 virtual BOOL OnNegotiateConferenceCapabilities(
01530 const H323SignalPDU & setupPDU
01531 );
01533
01544 virtual void SetLocalUserName(
01545 const PString & name
01546 );
01547
01552 virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01553
01560 BOOL AddAliasName(
01561 const PString & name
01562 );
01563
01567 BOOL RemoveAliasName(
01568 const PString & name
01569 );
01570
01575 const PStringList & GetAliasNames() const { return localAliasNames; }
01576
01577 #if P_LDAP
01578
01581 const PString & GetDefaultILSServer() const { return ilsServer; }
01582
01585 void SetDefaultILSServer(
01586 const PString & server
01587 ) { ilsServer = server; }
01588
01589 #endif
01590
01593 BOOL IsFastStartDisabled() const
01594 { return disableFastStart; }
01595
01598 void DisableFastStart(
01599 BOOL mode
01600 ) { disableFastStart = mode; }
01601
01604 BOOL IsH245TunnelingDisabled() const
01605 { return disableH245Tunneling; }
01606
01609 void DisableH245Tunneling(
01610 BOOL mode
01611 ) { disableH245Tunneling = mode; }
01612
01615 BOOL IsH245inSetupDisabled() const
01616 { return disableH245inSetup; }
01617
01620 void DisableH245inSetup(
01621 BOOL mode
01622 ) { disableH245inSetup = mode; }
01623
01626 BOOL DetectInBandDTMFDisabled() const
01627 { return disableDetectInBandDTMF; }
01628
01631 void DisableDetectInBandDTMF(
01632 BOOL mode
01633 ) { disableDetectInBandDTMF = mode; }
01634
01637 BOOL CanDisplayAmountString() const
01638 { return canDisplayAmountString; }
01639
01642 void SetCanDisplayAmountString(
01643 BOOL mode
01644 ) { canDisplayAmountString = mode; }
01645
01648 BOOL CanEnforceDurationLimit() const
01649 { return canEnforceDurationLimit; }
01650
01653 void SetCanEnforceDurationLimit(
01654 BOOL mode
01655 ) { canEnforceDurationLimit = mode; }
01656
01657 #ifdef H323_RTP_AGGREGATE
01658
01660 void SetRTPAggregatationSize(
01661 PINDEX size
01662 ) { rtpAggregationSize = size; }
01663
01666 PINDEX GetRTPAggregationSize() const
01667 { return rtpAggregationSize; }
01668
01671 PHandleAggregator * GetRTPAggregator();
01672 #endif
01673
01674 #ifdef H323_SIGNAL_AGGREGATE
01675
01677 void SetSignallingAggregationSize(
01678 PINDEX size
01679 ) { signallingAggregationSize = size; }
01680
01683 PINDEX GetSignallingAggregationSize() const
01684 { return signallingAggregationSize; }
01685
01688 PHandleAggregator * GetSignallingAggregator();
01689 #endif
01690
01691 #ifdef H323_H450
01692
01695 unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01696
01699 void SetCallIntrusionProtectionLevel(
01700 unsigned level
01701 ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01702
01705 virtual void OnReceivedInitiateReturnError();
01706
01707 #endif // H323_H450
01708
01709 #ifdef H323_AUDIO_CODECS
01710 #ifdef P_AUDIO
01711
01719 virtual BOOL SetSoundChannelPlayDevice(const PString & name);
01720 virtual BOOL SetSoundChannelPlayDriver(const PString & name);
01721
01726 const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
01727 const PString & GetSoundChannelPlayDriver() const { return soundChannelPlayDriver; }
01728
01736 virtual BOOL SetSoundChannelRecordDevice(const PString & name);
01737 virtual BOOL SetSoundChannelRecordDriver(const PString & name);
01738
01743 const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
01744 const PString & GetSoundChannelRecordDriver() const { return soundChannelRecordDriver; }
01745
01748 unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
01749
01752 void SetSoundChannelBufferDepth(
01753 unsigned depth
01754 );
01755
01756 #endif // P_AUDIO
01757
01760 H323AudioCodec::SilenceDetectionMode GetSilenceDetectionMode() const
01761 { return defaultSilenceDetection; }
01762
01765 void SetSilenceDetectionMode(
01766 H323AudioCodec::SilenceDetectionMode mode
01767 ) { defaultSilenceDetection = mode; }
01768
01769 #endif // H323_AUDIO_CODECS
01770
01773 H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
01774
01777 void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
01778
01779 #ifdef H323_VIDEO
01780
01783 BOOL CanAutoStartReceiveVideo() const { return autoStartReceiveVideo; }
01784
01787 BOOL CanAutoStartTransmitVideo() const { return autoStartTransmitVideo; }
01788
01789 #endif // H323_VIDEO
01790
01791 #ifdef H323_T38
01792
01795 BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01796
01799 BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01800
01801 #endif // H323_T38
01802
01805 BOOL CanAutoCallForward() const { return autoCallForward; }
01806
01809 const H323ListenerList & GetListeners() const { return listeners; }
01810
01813 const H323Capabilities & GetCapabilities() const { return capabilities; }
01814
01817 enum TerminalTypes {
01818 e_TerminalOnly = 50,
01819 e_TerminalAndMC = 70,
01820 e_GatewayOnly = 60,
01821 e_GatewayAndMC = 80,
01822 e_GatewayAndMCWithDataMP = 90,
01823 e_GatewayAndMCWithAudioMP = 100,
01824 e_GatewayAndMCWithAVMP = 110,
01825 e_GatekeeperOnly = 120,
01826 e_GatekeeperWithDataMP = 130,
01827 e_GatekeeperWithAudioMP = 140,
01828 e_GatekeeperWithAVMP = 150,
01829 e_MCUOnly = 160,
01830 e_MCUWithDataMP = 170,
01831 e_MCUWithAudioMP = 180,
01832 e_MCUWithAVMP = 190
01833 };
01834
01837 TerminalTypes GetTerminalType() const { return terminalType; }
01838
01841 BOOL IsTerminal() const;
01842
01845 BOOL IsGateway() const;
01846
01849 BOOL IsGatekeeper() const;
01850
01853 BOOL IsMCU() const;
01854
01855 #ifdef H323_AUDIO_CODECS
01856
01859 unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01860
01864 unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01865
01868 void SetAudioJitterDelay(
01869 unsigned minDelay,
01870 unsigned maxDelay
01871 );
01872 #endif
01873
01876 unsigned GetInitialBandwidth() const { return initialBandwidth; }
01877
01880 void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01881
01884 virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &);
01885
01888 virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &);
01889
01893 virtual void LoadBaseFeatureSet();
01894
01898 virtual BOOL HandleUnsolicitedInformation(const H323SignalPDU & pdu);
01899
01900 #ifdef H323_H460
01901
01903 H460_FeatureSet & GetFeatureSet() { return features.DeriveNewFeatureSet(); };
01904 #endif
01905
01906 #ifdef P_STUN
01907
01913 PSTUNClient * GetSTUN(
01914 const PIPSocket::Address & address = 0
01915 ) const;
01916
01919 void SetSTUNServer(
01920 const PString & server
01921 );
01922
01926 PNatMethod * GetPreferedNatMethod(
01927 const PIPSocket::Address & address = 0
01928 );
01929
01932 PNatStrategy GetNatMethods();
01933
01934 #endif // P_NONCORE
01935
01936 virtual BOOL OnUnsolicitedInformation(const H323SignalPDU & pdu)
01937 { return FALSE; }
01938
01941 virtual BOOL IsLocalAddress(
01942 const PIPSocket::Address & remoteAddress
01943 ) const;
01944
01947 virtual void TranslateTCPAddress(
01948 PIPSocket::Address & ,
01949 const PIPSocket::Address &
01950 ) { }
01951 void InternalTranslateTCPAddress(
01952 PIPSocket::Address & ,
01953 const PIPSocket::Address &
01954 );
01955
01958 virtual void TranslateTCPPort(
01959 WORD & ,
01960 const PIPSocket::Address &
01961 ) { };
01962
01965 WORD GetTCPPortBase() const { return tcpPorts.base; }
01966
01969 WORD GetTCPPortMax() const { return tcpPorts.max; }
01970
01973 void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
01974
01977 WORD GetNextTCPPort();
01978
01981 WORD GetUDPPortBase() const { return udpPorts.base; }
01982
01985 WORD GetUDPPortMax() const { return udpPorts.max; }
01986
01989 void SetUDPPorts(unsigned udpBase, unsigned udpMax);
01990
01993 WORD GetNextUDPPort();
01994
01997 WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
01998
02001 WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
02002
02005 void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
02006
02009 WORD GetRtpIpPortPair();
02010
02013 BYTE GetRtpIpTypeofService() const { return rtpIpTypeofService; }
02014
02017 void SetRtpIpTypeofService(unsigned tos) { rtpIpTypeofService = (BYTE)tos; }
02018
02021 BYTE GetTcpIpTypeofService() const { return tcpIpTypeofService; }
02022
02025 void SetTcpIpTypeofService(unsigned tos) { tcpIpTypeofService = (BYTE)tos; }
02026
02029 const PTimeInterval & GetSignallingChannelConnectTimeout() const { return signallingChannelConnectTimeout; }
02030
02033 const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
02034
02037 const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
02038
02041 const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
02042
02045 const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
02046
02049 unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
02050
02053 const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
02054
02057 const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
02058
02061 const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
02062
02065 const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
02066
02069 const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
02070
02073 BOOL ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
02074
02077 const PTimeInterval & GetNoMediaTimeout() const;
02078
02081 BOOL SetNoMediaTimeout(PTimeInterval newInterval);
02082
02085 const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
02086
02089 unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
02090
02093 const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
02094
02097 unsigned GetRasRequestRetries() const { return rasRequestRetries; }
02098
02102 const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
02103
02106 const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
02107
02110 void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
02111
02114 BOOL GetSendGRQ() const
02115 { return sendGRQ; }
02116
02119 void SetSendGRQ(BOOL v)
02120 { sendGRQ = v; }
02121
02122 #ifdef H323_H450
02123
02126 const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
02127
02130 const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
02131
02134 const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
02135
02138 const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
02139
02141 const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
02142 const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
02143 const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
02144 const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
02145 const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
02146 const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
02147
02150 H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
02151
02154 unsigned GetNextH450CallIdentityValue() const { return ++nextH450CallIdentity; }
02155
02156 #endif // H323_H450
02157
02160 PINDEX GetCleanerThreadStackSize() const { return cleanerThreadStackSize; }
02161
02164 PINDEX GetListenerThreadStackSize() const { return listenerThreadStackSize; }
02165
02168 PINDEX GetSignallingThreadStackSize() const { return signallingThreadStackSize; }
02169
02172 PINDEX GetControlThreadStackSize() const { return controlThreadStackSize; }
02173
02176 PINDEX GetChannelThreadStackSize() const { return logicalThreadStackSize; }
02177
02180 PINDEX GetRasThreadStackSize() const { return rasThreadStackSize; }
02181
02184 PINDEX GetJitterThreadStackSize() const { return jitterThreadStackSize; }
02185
02188 PThread::Priority GetChannelThreadPriority() const { return channelThreadPriority; }
02189
02190 H323ConnectionDict GetConnections() { return connectionsActive; };
02191
02193
02197 static BYTE defaultT35CountryCode;
02198 static BYTE defaultT35Extension;
02199 static WORD defaultManufacturerCode;
02200
02201 protected:
02202 H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
02203 BOOL InternalRegisterGatekeeper(H323Gatekeeper * gk, BOOL discovered);
02204 H323Connection * FindConnectionWithoutLocks(const PString & token);
02205 virtual H323Connection * InternalMakeCall(
02206 const PString & existingToken,
02207 const PString & callIdentity,
02208 unsigned capabilityLevel,
02209 const PString & remoteParty,
02210 H323Transport * transport,
02211 PString & token,
02212 void * userData
02213 );
02214
02215
02216 PStringList localAliasNames;
02217
02218 #ifdef H323_AUDIO_CODECS
02219 H323AudioCodec::SilenceDetectionMode defaultSilenceDetection;
02220 unsigned minAudioJitterDelay;
02221 unsigned maxAudioJitterDelay;
02222 #ifdef P_AUDIO
02223 PString soundChannelPlayDevice;
02224 PString soundChannelPlayDriver;
02225 PString soundChannelRecordDevice;
02226 PString soundChannelRecordDriver;
02227 unsigned soundChannelBuffers;
02228 #endif // P_AUDIO
02229 #endif // H323_AUDIO_CODECS
02230
02231 #ifdef H323_VIDEO
02232 PString videoChannelPlayDevice;
02233 PString videoChannelRecordDevice;
02234 BOOL autoStartReceiveVideo;
02235 BOOL autoStartTransmitVideo;
02236 #endif // H323_VIDEO
02237
02238 #ifdef H323_T38
02239 BOOL autoStartReceiveFax;
02240 BOOL autoStartTransmitFax;
02241 #endif // H323_T38
02242
02243 BOOL autoCallForward;
02244 BOOL disableFastStart;
02245 BOOL disableH245Tunneling;
02246 BOOL disableH245inSetup;
02247 BOOL disableDetectInBandDTMF;
02248 BOOL canDisplayAmountString;
02249 BOOL canEnforceDurationLimit;
02250
02251 #ifdef H323_H450
02252 unsigned callIntrusionProtectionLevel;
02253 #endif // H323_H450
02254
02255 H323Connection::SendUserInputModes defaultSendUserInputMode;
02256
02257 #ifdef P_LDAP
02258 PString ilsServer;
02259 #endif // P_LDAP
02260
02261
02262 BYTE rtpIpTypeofService;
02263 BYTE tcpIpTypeofService;
02264 PTimeInterval signallingChannelConnectTimeout;
02265 PTimeInterval signallingChannelCallTimeout;
02266 PTimeInterval controlChannelStartTimeout;
02267 PTimeInterval endSessionTimeout;
02268 PTimeInterval masterSlaveDeterminationTimeout;
02269 unsigned masterSlaveDeterminationRetries;
02270 PTimeInterval capabilityExchangeTimeout;
02271 PTimeInterval logicalChannelTimeout;
02272 PTimeInterval requestModeTimeout;
02273 PTimeInterval roundTripDelayTimeout;
02274 PTimeInterval roundTripDelayRate;
02275 PTimeInterval noMediaTimeout;
02276 PTimeInterval gatekeeperRequestTimeout;
02277 unsigned gatekeeperRequestRetries;
02278 PTimeInterval rasRequestTimeout;
02279 unsigned rasRequestRetries;
02280 PTimeInterval registrationTimeToLive;
02281 PString gkAccessTokenOID;
02282 BOOL sendGRQ;
02283
02284 unsigned initialBandwidth;
02285 BOOL clearCallOnRoundTripFail;
02286
02287 struct PortInfo {
02288 void Set(
02289 unsigned base,
02290 unsigned max,
02291 unsigned range,
02292 unsigned dflt
02293 );
02294 WORD GetNext(
02295 unsigned increment
02296 );
02297
02298 PMutex mutex;
02299 WORD base;
02300 WORD max;
02301 WORD current;
02302 } tcpPorts, udpPorts, rtpIpPorts;
02303
02304 #ifdef P_STUN
02305 PSTUNClient * stun;
02306 PNatStrategy natMethods;
02307 #endif
02308
02309 BYTE t35CountryCode;
02310 BYTE t35Extension;
02311 WORD manufacturerCode;
02312
02313 TerminalTypes terminalType;
02314
02315 #ifdef H323_H450
02316
02317
02318
02319 PTimeInterval callTransferT1;
02320
02321
02322 PTimeInterval callTransferT2;
02323
02324
02325 PTimeInterval callTransferT3;
02326
02327
02328 PTimeInterval callTransferT4;
02329
02331 PTimeInterval callIntrusionT1;
02332 PTimeInterval callIntrusionT2;
02333 PTimeInterval callIntrusionT3;
02334 PTimeInterval callIntrusionT4;
02335 PTimeInterval callIntrusionT5;
02336 PTimeInterval callIntrusionT6;
02337
02338 H323CallIdentityDict secondaryConnectionsActive;
02339
02340 mutable PAtomicInteger nextH450CallIdentity;
02342
02343 #endif // H323_H450
02344
02345 PINDEX cleanerThreadStackSize;
02346 PINDEX listenerThreadStackSize;
02347 PINDEX signallingThreadStackSize;
02348 PINDEX controlThreadStackSize;
02349 PINDEX logicalThreadStackSize;
02350 PINDEX rasThreadStackSize;
02351 PINDEX jitterThreadStackSize;
02352
02353 #ifdef H323_RTP_AGGREGATE
02354 PINDEX rtpAggregationSize;
02355 PHandleAggregator * rtpAggregator;
02356 #endif
02357
02358 #ifdef H323_SIGNAL_AGGREGATE
02359 PINDEX signallingAggregationSize;
02360 PHandleAggregator * signallingAggregator;
02361 #endif
02362
02363 PThread::Priority channelThreadPriority;
02364
02365
02366 H323ListenerList listeners;
02367 H323Capabilities capabilities;
02368 H323Gatekeeper * gatekeeper;
02369 PString gatekeeperPassword;
02370
02371 H323ConnectionDict connectionsActive;
02372
02373 PMutex connectionsMutex;
02374 PMutex noMediaMutex;
02375 PStringSet connectionsToBeCleaned;
02376 H323ConnectionsCleaner * connectionsCleaner;
02377 PSyncPoint connectionsAreCleaned;
02378
02379 #ifndef DISABLE_CALLAUTH
02380
02381 PString EPSecurityUserName;
02382 PString EPSecurityPassword;
02383 BOOL isSecureCall;
02384 EPSecurityPolicy CallAuthPolicy;
02385 H235AuthenticatorList EPAuthList;
02386 #endif
02387
02388 #ifdef H323_TRANSNEXUS_OSP
02389 OpalOSP::Provider * ospProvider;
02390 #endif
02391
02392 #ifdef H323_H460
02393 H460_FeatureSet features;
02394 #endif
02395
02396 };
02397
02398
02399 #endif // __OPAL_H323EP_H
02400
02401