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
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352 #ifndef __OPAL_H323EP_H
00353 #define __OPAL_H323EP_H
00354
00355 #include "h323.h"
00356 #include "h323con.h"
00357
00358 class PHandleAggregator;
00359
00360
00361
00362
00363
00364
00365 class H225_EndpointType;
00366 class H225_ArrayOf_SupportedProtocols;
00367 class H225_VendorIdentifier;
00368 class H225_H221NonStandard;
00369 class H225_ServiceControlDescriptor;
00370 class H225_ArrayOf_AliasAddress;
00371
00372 class H323SignalPDU;
00373 class H323ConnectionsCleaner;
00374 class H323ServiceControlSession;
00375
00376 #if H323_H224
00377 class OpalH224Handler;
00378 class OpalH281Handler;
00379 #endif
00380
00381 #ifndef DISABLE_CALLAUTH
00382 #include "h235auth.h"
00383 #endif
00384
00385 #ifdef H323_T120
00386 class OpalT120Protocol;
00387 #endif
00388
00389 #ifdef H323_T38
00390 class OpalT38Protocol;
00391 #endif
00392
00393 #ifdef H323_H224
00394 class OpalH224Handler;
00395 class OpalH281Handler;
00396 #endif
00397
00398 #ifdef P_STUN
00399 #include <ptclib/pnat.h>
00400 class PSTUNClient;
00401 #endif
00402
00403 #ifdef P_USE_PRAGMA
00404 #pragma interface
00405 #endif
00406
00407 #ifdef H323_H460
00408 #include "h460/h4601.h"
00409 #endif
00410
00412
00425 class H323EndPoint : public PObject
00426 {
00427 PCLASSINFO(H323EndPoint, PObject);
00428
00429 public:
00430 enum {
00431 DefaultTcpPort = 1720
00432 };
00433
00438 H323EndPoint();
00439
00442 ~H323EndPoint();
00443
00446 virtual void SetEndpointTypeInfo(
00447 H225_EndpointType & info
00448 ) const;
00449
00452 virtual void SetVendorIdentifierInfo(
00453 H225_VendorIdentifier & info
00454 ) const;
00455
00458 BOOL SetGatewaySupportedProtocol(
00459 H225_ArrayOf_SupportedProtocols & protocols
00460 ) const;
00461
00465 virtual BOOL OnSetGatewayPrefixes(
00466 PStringList & prefixes
00467 ) const;
00468
00471 virtual void SetH221NonStandardInfo(
00472 H225_H221NonStandard & info
00473 ) const;
00475
00476
00487 void AddCapability(
00488 H323Capability * capability
00489 );
00490
00511 PINDEX SetCapability(
00512 PINDEX descriptorNum,
00513 PINDEX simultaneous,
00514 H323Capability * cap
00515 );
00516
00517 #ifdef H323_VIDEO
00518
00523 BOOL SetVideoFrameSize(H323Capability::CapabilityFrameSize frameSize,
00524 int frameUnits = 1
00525 );
00526 #endif
00527
00532 PINDEX AddAllCapabilities(
00533 PINDEX descriptorNum,
00534 PINDEX simultaneous,
00535 const PString & name
00536 );
00537
00540 void AddAllUserInputCapabilities(
00541 PINDEX descriptorNum,
00542 PINDEX simultaneous
00543 );
00544
00545 #ifdef H323_H239
00546
00548 void AddAllExtendedVideoCapabilities(
00549 PINDEX descriptorNum,
00550 PINDEX simultaneous
00551 );
00552 #endif
00553
00556 void RemoveCapabilities(
00557 const PStringArray & codecNames
00558 );
00559
00562 void ReorderCapabilities(
00563 const PStringArray & preferenceOrder
00564 );
00565
00568 H323Capability * FindCapability(
00569 const H245_Capability & cap
00570 ) const;
00571
00574 H323Capability * FindCapability(
00575 const H245_DataType & dataType
00576 ) const;
00577
00580 H323Capability * FindCapability(
00581 H323Capability::MainTypes mainType,
00582 unsigned subType
00583 ) const;
00585
00605 BOOL UseGatekeeper(
00606 const PString & address = PString::Empty(),
00607 const PString & identifier = PString::Empty(),
00608 const PString & localAddress = PString::Empty()
00609 );
00610
00621 BOOL SetGatekeeper(
00622 const PString & address,
00623 H323Transport * transport = NULL
00624 );
00625
00640 BOOL SetGatekeeperZone(
00641 const PString & address,
00642 const PString & identifier,
00643 H323Transport * transport = NULL
00644 );
00645
00655 BOOL LocateGatekeeper(
00656 const PString & identifier,
00657 H323Transport * transport = NULL
00658 );
00659
00668 BOOL DiscoverGatekeeper(
00669 H323Transport * transport = NULL
00670 );
00671
00679 virtual H323Gatekeeper * CreateGatekeeper(
00680 H323Transport * transport
00681 );
00682
00685 H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00686
00689 BOOL IsRegisteredWithGatekeeper() const;
00690
00696 BOOL RemoveGatekeeper(
00697 int reason = -1
00698 );
00699
00702 virtual void SetGatekeeperPassword(
00703 const PString & password
00704 );
00705
00708 virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00709
00714 virtual BOOL GatekeeperCheckIP(const H323TransportAddress & oldAddr,H323TransportAddress & newaddress);
00715
00718 virtual H235Authenticators CreateAuthenticators();
00719
00722 virtual void OnAdmissionRequest(H323Connection & connection);
00723
00726 virtual void OnGatekeeperConfirm();
00727
00730 virtual void OnGatekeeperReject();
00731
00734 virtual void OnRegistrationConfirm(const H323TransportAddress & rasAddress);
00735
00738 virtual void OnRegistrationReject();
00739
00742 virtual void OnUnRegisterRequest();
00744
00761 BOOL StartListener(
00762 H323Listener * listener
00763 );
00764
00776 BOOL StartListener(
00777 const H323TransportAddress & iface
00778 );
00779
00796 BOOL StartListeners(
00797 const H323TransportAddressArray & ifaces
00798 );
00799
00803 BOOL RemoveListener(
00804 H323Listener * listener
00805 );
00806
00809 H323TransportAddressArray GetInterfaceAddresses(
00810 BOOL excludeLocalHost = TRUE,
00811 H323Transport * associatedTransport = NULL
00813 );
00814
00815 #ifndef DISABLE_CALLAUTH
00816
00820 H323Connection * MakeAuthenticatedCall (
00821 const PString & remoteParty,
00822 const PString & UserName,
00823 const PString & Password,
00824 PString & token,
00825 void * userData = NULL
00826 );
00827 #endif
00828
00847 H323Connection * MakeCall(
00848 const PString & remoteParty,
00849 PString & token,
00850 void * userData = NULL
00851 );
00852
00873 H323Connection * MakeCall(
00874 const PString & remoteParty,
00875 H323Transport * transport,
00876 PString & token,
00877 void * userData = NULL
00878 );
00879
00890 H323Connection * MakeCallLocked(
00891 const PString & remoteParty,
00892 PString & token,
00893 void * userData = NULL,
00894 H323Transport * transport = NULL
00895 );
00896
00897 #ifdef H323_H450
00898
00919 virtual H323Connection * SetupTransfer(
00920 const PString & token,
00921 const PString & callIdentity,
00922 const PString & remoteParty,
00923 PString & newToken,
00924 void * userData = NULL
00925 );
00926
00932 void TransferCall(
00933 const PString & token,
00934 const PString & remoteParty,
00935 const PString & callIdentity = PString::Empty()
00937 );
00938
00945 void ConsultationTransfer(
00946 const PString & primaryCallToken,
00947 const PString & secondaryCallToken
00948 );
00949
00953 void HoldCall(
00954 const PString & token,
00955 BOOL localHold
00956 );
00957
00961 H323Connection * IntrudeCall(
00962 const PString & remoteParty,
00963 PString & token,
00964 unsigned capabilityLevel,
00965 void * userData = NULL
00966 );
00967
00968 H323Connection * IntrudeCall(
00969 const PString & remoteParty,
00970 H323Transport * transport,
00971 PString & token,
00972 unsigned capabilityLevel,
00973 void * userData = NULL
00974 );
00975
00976 #endif // H323_H450
00977
00981 BOOL ResolveCallParty(
00982 const PString & _remoteParty,
00983 PStringList & addresses
00984 );
00985
00992 BOOL ParsePartyName(
00993 const PString & party,
00994 PString & alias,
00995 H323TransportAddress & address
00996 );
00997
01002 virtual BOOL ClearCall(
01003 const PString & token,
01004 H323Connection::CallEndReason reason =
01005 H323Connection::EndedByLocalUser
01006 );
01007
01013 virtual void OnCallClearing(H323Connection * connection,
01014 H323Connection::CallEndReason reason
01015 );
01016
01021 virtual BOOL ClearCallSynchronous(
01022 const PString & token,
01023 H323Connection::CallEndReason reason =
01024 H323Connection::EndedByLocalUser
01025 );
01026 virtual BOOL ClearCallSynchronous(
01027 const PString & token,
01028 H323Connection::CallEndReason reason,
01029 PSyncPoint * sync
01030 );
01031
01038 virtual void ClearAllCalls(
01039 H323Connection::CallEndReason reason =
01040 H323Connection::EndedByLocalUser,
01041 BOOL wait = TRUE
01042 );
01043
01046 virtual BOOL HasConnection(
01047 const PString & token
01048 );
01049
01061 H323Connection * FindConnectionWithLock(
01062 const PString & token
01063 );
01064
01067 PStringList GetAllConnections();
01068
01080 virtual BOOL OnIncomingCall(
01081 H323Connection & connection,
01082 const H323SignalPDU & setupPDU,
01083 H323SignalPDU & alertingPDU
01084 );
01085 virtual BOOL OnIncomingCall(
01086 H323Connection & connection,
01087 const H323SignalPDU & setupPDU,
01088 H323SignalPDU & alertingPDU,
01089 H323Connection::CallEndReason & reason
01090 );
01091
01096 virtual BOOL OnCallTransferInitiate(
01097 H323Connection & connection,
01098 const PString & remoteParty
01099 );
01100
01105 virtual BOOL OnCallTransferIdentify(
01106 H323Connection & connection
01107 );
01108
01113 virtual void OnSendARQ(
01114 H323Connection & conn,
01115 H225_AdmissionRequest & arq
01116 );
01117
01121 virtual void OnReceivedACF(
01122 H323Connection & conn,
01123 const H225_AdmissionConfirm & acf
01124 );
01125
01129 virtual void OnReceivedARJ(
01130 H323Connection & conn,
01131 const H225_AdmissionReject & arj
01132 );
01133
01152 virtual H323Connection::AnswerCallResponse OnAnswerCall(
01153 H323Connection & connection,
01154 const PString & callerName,
01155 const H323SignalPDU & setupPDU,
01156 H323SignalPDU & connectPDU
01157 );
01158
01169 virtual BOOL OnAlerting(
01170 H323Connection & connection,
01171 const H323SignalPDU & alertingPDU,
01172 const PString & user
01173 );
01174
01183 virtual BOOL OnConnectionForwarded(
01184 H323Connection & connection,
01185 const PString & forwardParty,
01186 const H323SignalPDU & pdu
01187 );
01188
01197 virtual BOOL ForwardConnection(
01198 H323Connection & connection,
01199 const PString & forwardParty,
01200 const H323SignalPDU & pdu
01201 );
01202
01209 virtual void OnConnectionEstablished(
01210 H323Connection & connection,
01211 const PString & token
01212 );
01213
01216 virtual BOOL IsConnectionEstablished(
01217 const PString & token
01218 );
01219
01226 virtual void OnConnectionCleared(
01227 H323Connection & connection,
01228 const PString & token
01229 );
01230
01235 static PString BuildConnectionToken(
01236 const H323Transport & transport,
01237 unsigned callReference,
01238 BOOL fromRemote
01239 );
01240
01246 virtual H323Connection * OnIncomingConnection(
01247 H323Transport * transport,
01248 H323SignalPDU & setupPDU
01249 );
01250
01257 virtual BOOL OnOutgoingCall(
01258 H323Connection & conn,
01259 const H323SignalPDU & connectPDU
01260 );
01261
01264 virtual H323Connection * CreateConnection(
01265 unsigned callReference,
01266 void * userData,
01267 H323Transport * transport,
01268 H323SignalPDU * setupPDU
01269 );
01270 virtual H323Connection * CreateConnection(
01271 unsigned callReference,
01272 void * userData
01273 );
01274 virtual H323Connection * CreateConnection(
01275 unsigned callReference
01276 );
01277
01284 virtual void CleanUpConnections();
01286
01287 #ifndef DISABLE_CALLAUTH
01288
01296 virtual H235Authenticators CreateEPAuthenticators();
01297
01301 virtual BOOL GetEPCredentials(PString & password,
01302 PString & username
01303 );
01304
01307 virtual void SetEPCredentials(PString password,
01308 PString username
01309 );
01310
01311 enum EPSecurityPolicy
01312 {
01313 SecNone,
01314 SecRequest,
01315 SecRequired
01316 };
01317
01320 virtual void SetEPSecurityPolicy(EPSecurityPolicy policy);
01321
01324 virtual EPSecurityPolicy GetEPSecurityPolicy();
01325
01329 H235AuthenticatorList GetAuthenticatorList();
01330
01340 virtual BOOL OnCallAuthentication(const PString & username,
01341 PString & password
01342 );
01344 #endif
01345
01352 virtual BOOL OnStartLogicalChannel(
01353 H323Connection & connection,
01354 H323Channel & channel
01355 );
01356
01361 virtual void OnClosedLogicalChannel(
01362 H323Connection & connection,
01363 const H323Channel & channel
01364 );
01365
01366 #ifndef NO_H323_AUDIO_CODECS
01367
01374 virtual BOOL OpenAudioChannel(
01375 H323Connection & connection,
01376 BOOL isEncoding,
01377 unsigned bufferSize,
01378 H323AudioCodec & codec
01379 );
01380 #endif
01381
01382 #ifndef NO_H323_VIDEO
01383
01389 virtual BOOL OpenVideoChannel(
01390 H323Connection & connection,
01391 BOOL isEncoding,
01392 H323VideoCodec & codec
01393 );
01394 #endif // NO_H323_VIDEO
01395
01403 virtual void OnRTPStatistics(
01404 const H323Connection & connection,
01405 const RTP_Session & session
01406 ) const;
01407
01414 virtual void OnRTPFinalStatistics(
01415 const H323Connection & connection,
01416 const RTP_Session & session
01417 ) const;
01418
01420
01427 virtual void OnUserInputString(
01428 H323Connection & connection,
01429 const PString & value
01430 );
01431
01436 virtual void OnUserInputTone(
01437 H323Connection & connection,
01438 char tone,
01439 unsigned duration,
01440 unsigned logicalChannel,
01441 unsigned rtpTimestamp
01442 );
01443
01447 virtual void OnGatekeeperNATDetect(
01448 PIPSocket::Address publicAddr,
01449 PString & gkIdentifier,
01450 H323TransportAddress & gkRouteAddress
01451 );
01452
01457 virtual void OnGatekeeperOpenNATDetect(
01458 PString & gkIdentifier,
01459 H323TransportAddress & gkRouteAddress
01460 );
01461
01466 virtual BOOL OnGatekeeperAliases(
01467 const H225_ArrayOf_AliasAddress & aliases
01468 );
01470
01471 #ifdef H323_H248
01472
01480 virtual void OnHTTPServiceControl(
01481 unsigned operation,
01482 unsigned sessionId,
01483 const PString & url
01484 );
01485
01491 virtual void OnCallCreditServiceControl(
01492 const PString & amount,
01493 BOOL mode,
01494 const unsigned & durationLimit
01495 );
01496
01497 #ifdef H323_H350
01498
01504 virtual void OnH350ServiceControl(
01505 const PString & url,
01506 const PString & BaseDN
01507 );
01508 #endif
01509
01519 virtual void OnCallCreditServiceControl(
01520 const PString & amount,
01521 BOOL mode
01522 );
01523
01527 virtual void OnServiceControlSession(
01528 unsigned type,
01529 unsigned sessionid,
01530 const H323ServiceControlSession & session,
01531 H323Connection * connection
01532 );
01533
01536 virtual H323ServiceControlSession * CreateServiceControlSession(
01537 const H225_ServiceControlDescriptor & contents
01538 );
01540 #endif // H323_H248
01541
01544 #ifdef H323_T120
01545
01555 virtual OpalT120Protocol * CreateT120ProtocolHandler(
01556 const H323Connection & connection
01557 ) const;
01558 #endif
01559
01560 #ifdef H323_T38
01561
01571 virtual OpalT38Protocol * CreateT38ProtocolHandler(
01572 const H323Connection & connection
01573 ) const;
01575 #endif
01576
01577 #if H323_H224
01578
01588 virtual OpalH224Handler * CreateH224ProtocolHandler(
01589 H323Connection & connection,
01590 unsigned sessionID
01591 ) const;
01592
01602 virtual OpalH281Handler * CreateH281ProtocolHandler(
01603 OpalH224Handler & h224Handler
01604 ) const;
01605 #endif
01606
01614 virtual BOOL OnConferenceInvite(
01615 BOOL sending,
01616 const H323Connection * connection,
01617 const H323SignalPDU & setupPDU
01618 );
01619
01625 virtual BOOL OnSendCallIndependentSupplementaryService(
01626 const H323Connection * connection,
01627 H323SignalPDU & pdu
01628 );
01629
01630 virtual BOOL OnReceiveCallIndependentSupplementaryService(
01631 const H323Connection * connection,
01632 const H323SignalPDU & pdu
01633 );
01634
01640 virtual BOOL OnNegotiateConferenceCapabilities(
01641 const H323SignalPDU & setupPDU
01642 );
01644
01655 virtual void SetLocalUserName(
01656 const PString & name
01657 );
01658
01663 virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01664
01671 BOOL AddAliasName(
01672 const PString & name
01673 );
01674
01678 BOOL RemoveAliasName(
01679 const PString & name
01680 );
01681
01686 const PStringList & GetAliasNames() const { return localAliasNames; }
01687
01688 #if P_LDAP
01689
01692 const PString & GetDefaultILSServer() const { return ilsServer; }
01693
01696 void SetDefaultILSServer(
01697 const PString & server
01698 ) { ilsServer = server; }
01699
01700 #endif
01701
01704 BOOL IsFastStartDisabled() const
01705 { return disableFastStart; }
01706
01709 void DisableFastStart(
01710 BOOL mode
01711 ) { disableFastStart = mode; }
01712
01715 BOOL IsH245TunnelingDisabled() const
01716 { return disableH245Tunneling; }
01717
01720 void DisableH245Tunneling(
01721 BOOL mode
01722 ) { disableH245Tunneling = mode; }
01723
01726 BOOL IsH245inSetupDisabled() const
01727 { return disableH245inSetup; }
01728
01731 void DisableH245inSetup(
01732 BOOL mode
01733 ) { disableH245inSetup = mode; }
01734
01737 BOOL DetectInBandDTMFDisabled() const
01738 { return disableDetectInBandDTMF; }
01739
01742 void DisableDetectInBandDTMF(
01743 BOOL mode
01744 ) { disableDetectInBandDTMF = mode; }
01745
01748 BOOL CanDisplayAmountString() const
01749 { return canDisplayAmountString; }
01750
01753 void SetCanDisplayAmountString(
01754 BOOL mode
01755 ) { canDisplayAmountString = mode; }
01756
01759 BOOL CanEnforceDurationLimit() const
01760 { return canEnforceDurationLimit; }
01761
01764 void SetCanEnforceDurationLimit(
01765 BOOL mode
01766 ) { canEnforceDurationLimit = mode; }
01767
01768 #ifdef H323_RTP_AGGREGATE
01769
01771 void SetRTPAggregatationSize(
01772 PINDEX size
01773 ) { rtpAggregationSize = size; }
01774
01777 PINDEX GetRTPAggregationSize() const
01778 { return rtpAggregationSize; }
01779
01782 PHandleAggregator * GetRTPAggregator();
01783 #endif
01784
01785 #ifdef H323_SIGNAL_AGGREGATE
01786
01788 void SetSignallingAggregationSize(
01789 PINDEX size
01790 ) { signallingAggregationSize = size; }
01791
01794 PINDEX GetSignallingAggregationSize() const
01795 { return signallingAggregationSize; }
01796
01799 PHandleAggregator * GetSignallingAggregator();
01800 #endif
01801
01802 #ifdef H323_H450
01803
01806 unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01807
01810 void SetCallIntrusionProtectionLevel(
01811 unsigned level
01812 ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01813
01816 virtual void OnReceivedInitiateReturnError();
01817
01818 #endif // H323_H450
01819
01820 #ifdef H323_AUDIO_CODECS
01821 #ifdef P_AUDIO
01822
01830 virtual BOOL SetSoundChannelPlayDevice(const PString & name);
01831 virtual BOOL SetSoundChannelPlayDriver(const PString & name);
01832
01837 const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
01838 const PString & GetSoundChannelPlayDriver() const { return soundChannelPlayDriver; }
01839
01847 virtual BOOL SetSoundChannelRecordDevice(const PString & name);
01848 virtual BOOL SetSoundChannelRecordDriver(const PString & name);
01849
01854 const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
01855 const PString & GetSoundChannelRecordDriver() const { return soundChannelRecordDriver; }
01856
01859 unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
01860
01863 void SetSoundChannelBufferDepth(
01864 unsigned depth
01865 );
01866
01867 #endif // P_AUDIO
01868
01871 H323AudioCodec::SilenceDetectionMode GetSilenceDetectionMode() const
01872 { return defaultSilenceDetection; }
01873
01876 void SetSilenceDetectionMode(
01877 H323AudioCodec::SilenceDetectionMode mode
01878 ) { defaultSilenceDetection = mode; }
01879
01880 #endif // H323_AUDIO_CODECS
01881
01884 H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
01885
01888 void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
01889
01890 #ifdef H323_VIDEO
01891
01894 BOOL CanAutoStartReceiveVideo() const { return autoStartReceiveVideo; }
01895
01898 BOOL CanAutoStartTransmitVideo() const { return autoStartTransmitVideo; }
01899
01900 #endif // H323_VIDEO
01901
01902 #ifdef H323_T38
01903
01906 BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01907
01910 BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01911
01912 #endif // H323_T38
01913
01916 BOOL CanAutoCallForward() const { return autoCallForward; }
01917
01920 const H323ListenerList & GetListeners() const { return listeners; }
01921
01924 const H323Capabilities & GetCapabilities() const { return capabilities; }
01925
01928 enum TerminalTypes {
01929 e_TerminalOnly = 50,
01930 e_TerminalAndMC = 70,
01931 e_GatewayOnly = 60,
01932 e_GatewayAndMC = 80,
01933 e_GatewayAndMCWithDataMP = 90,
01934 e_GatewayAndMCWithAudioMP = 100,
01935 e_GatewayAndMCWithAVMP = 110,
01936 e_GatekeeperOnly = 120,
01937 e_GatekeeperWithDataMP = 130,
01938 e_GatekeeperWithAudioMP = 140,
01939 e_GatekeeperWithAVMP = 150,
01940 e_MCUOnly = 160,
01941 e_MCUWithDataMP = 170,
01942 e_MCUWithAudioMP = 180,
01943 e_MCUWithAVMP = 190
01944 };
01945
01948 TerminalTypes GetTerminalType() const { return terminalType; }
01949
01952 BOOL IsTerminal() const;
01953
01956 BOOL IsGateway() const;
01957
01960 BOOL IsGatekeeper() const;
01961
01964 BOOL IsMCU() const;
01965
01966 #ifdef H323_AUDIO_CODECS
01967
01970 unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01971
01975 unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01976
01979 void SetAudioJitterDelay(
01980 unsigned minDelay,
01981 unsigned maxDelay
01982 );
01983 #endif
01984
01987 unsigned GetInitialBandwidth() const { return initialBandwidth; }
01988
01991 void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01992
01995 virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &);
01996
01999 virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &);
02000
02004 virtual void LoadBaseFeatureSet();
02005
02009 virtual BOOL HandleUnsolicitedInformation(const H323SignalPDU & pdu);
02010
02011 #ifdef H323_H460
02012
02014 H460_FeatureSet & GetFeatureSet() { return features.DeriveNewFeatureSet(); };
02015
02018 BOOL FeatureSetDisabled() { return disableH460; }
02019
02022 void FeatureSetDisable() { disableH460 = TRUE; }
02023
02024 #endif
02025
02026 #ifdef H323_AEC
02027 BOOL AECEnabled() { return enableAEC; }
02028
02029 void SetAECEnabled(BOOL enabled) { enableAEC = enabled; }
02030 #endif
02031
02032 #ifdef P_STUN
02033
02039 PSTUNClient * GetSTUN(
02040 const PIPSocket::Address & address = 0
02041 ) const;
02042
02045 void SetSTUNServer(
02046 const PString & server
02047 );
02048
02051 virtual BOOL STUNNatType(int type) { return FALSE; };
02052
02056 PNatMethod * GetPreferedNatMethod(
02057 const PIPSocket::Address & address = 0
02058 );
02059
02062 PNatStrategy GetNatMethods();
02063
02064 #endif // P_NONCORE
02065
02066 virtual BOOL OnUnsolicitedInformation(const H323SignalPDU & pdu)
02067 { return FALSE; }
02068
02071 virtual BOOL IsLocalAddress(
02072 const PIPSocket::Address & remoteAddress
02073 ) const;
02074
02077 virtual void TranslateTCPAddress(
02078 PIPSocket::Address & ,
02079 const PIPSocket::Address &
02080 ) { }
02081 void InternalTranslateTCPAddress(
02082 PIPSocket::Address & ,
02083 const PIPSocket::Address & ,
02084 const H323Connection * conn = NULL
02085 );
02086
02089 virtual void TranslateTCPPort(
02090 WORD & ,
02091 const PIPSocket::Address &
02092 ) { };
02093
02096 WORD GetTCPPortBase() const { return tcpPorts.base; }
02097
02100 WORD GetTCPPortMax() const { return tcpPorts.max; }
02101
02104 void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
02105
02108 WORD GetNextTCPPort();
02109
02112 WORD GetUDPPortBase() const { return udpPorts.base; }
02113
02116 WORD GetUDPPortMax() const { return udpPorts.max; }
02117
02120 void SetUDPPorts(unsigned udpBase, unsigned udpMax);
02121
02124 WORD GetNextUDPPort();
02125
02128 WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
02129
02132 WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
02133
02136 void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
02137
02140 WORD GetRtpIpPortPair();
02141
02144 BYTE GetRtpIpTypeofService() const { return rtpIpTypeofService; }
02145
02148 void SetRtpIpTypeofService(unsigned tos) { rtpIpTypeofService = (BYTE)tos; }
02149
02152 BYTE GetTcpIpTypeofService() const { return tcpIpTypeofService; }
02153
02156 void SetTcpIpTypeofService(unsigned tos) { tcpIpTypeofService = (BYTE)tos; }
02157
02160 const PTimeInterval & GetSignallingChannelConnectTimeout() const { return signallingChannelConnectTimeout; }
02161
02164 const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
02165
02168 const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
02169
02172 const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
02173
02176 const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
02177
02180 unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
02181
02184 const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
02185
02188 const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
02189
02192 const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
02193
02196 const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
02197
02200 const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
02201
02204 BOOL ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
02205
02208 const PTimeInterval & GetNoMediaTimeout() const;
02209
02212 BOOL SetNoMediaTimeout(PTimeInterval newInterval);
02213
02216 const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
02217
02220 unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
02221
02224 const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
02225
02228 unsigned GetRasRequestRetries() const { return rasRequestRetries; }
02229
02233 const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
02234
02237 const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
02238
02241 void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
02242
02245 BOOL GetSendGRQ() const
02246 { return sendGRQ; }
02247
02250 void SetSendGRQ(BOOL v)
02251 { sendGRQ = v; }
02252
02253 #ifdef H323_H450
02254
02257 const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
02258
02261 const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
02262
02265 const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
02266
02269 const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
02270
02272 const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
02273 const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
02274 const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
02275 const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
02276 const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
02277 const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
02278
02281 H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
02282
02285 unsigned GetNextH450CallIdentityValue() const { return ++nextH450CallIdentity; }
02286
02287 #endif // H323_H450
02288
02291 PINDEX GetCleanerThreadStackSize() const { return cleanerThreadStackSize; }
02292
02295 PINDEX GetListenerThreadStackSize() const { return listenerThreadStackSize; }
02296
02299 PINDEX GetSignallingThreadStackSize() const { return signallingThreadStackSize; }
02300
02303 PINDEX GetControlThreadStackSize() const { return controlThreadStackSize; }
02304
02307 PINDEX GetChannelThreadStackSize() const { return logicalThreadStackSize; }
02308
02311 PINDEX GetRasThreadStackSize() const { return rasThreadStackSize; }
02312
02315 PINDEX GetJitterThreadStackSize() const { return jitterThreadStackSize; }
02316
02319 PThread::Priority GetChannelThreadPriority() const { return channelThreadPriority; }
02320
02321 H323ConnectionDict GetConnections() { return connectionsActive; };
02322
02324
02328 static BYTE defaultT35CountryCode;
02329 static BYTE defaultT35Extension;
02330 static WORD defaultManufacturerCode;
02331
02332 protected:
02333 H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
02334 BOOL InternalRegisterGatekeeper(H323Gatekeeper * gk, BOOL discovered);
02335 H323Connection * FindConnectionWithoutLocks(const PString & token);
02336 virtual H323Connection * InternalMakeCall(
02337 const PString & existingToken,
02338 const PString & callIdentity,
02339 unsigned capabilityLevel,
02340 const PString & remoteParty,
02341 H323Transport * transport,
02342 PString & token,
02343 void * userData
02344 );
02345
02346
02347 PStringList localAliasNames;
02348
02349 #ifdef H323_AUDIO_CODECS
02350 H323AudioCodec::SilenceDetectionMode defaultSilenceDetection;
02351 unsigned minAudioJitterDelay;
02352 unsigned maxAudioJitterDelay;
02353 #ifdef P_AUDIO
02354 PString soundChannelPlayDevice;
02355 PString soundChannelPlayDriver;
02356 PString soundChannelRecordDevice;
02357 PString soundChannelRecordDriver;
02358 unsigned soundChannelBuffers;
02359 #endif // P_AUDIO
02360 #endif // H323_AUDIO_CODECS
02361
02362 #ifdef H323_VIDEO
02363 PString videoChannelPlayDevice;
02364 PString videoChannelRecordDevice;
02365 BOOL autoStartReceiveVideo;
02366 BOOL autoStartTransmitVideo;
02367 #endif // H323_VIDEO
02368
02369 #ifdef H323_T38
02370 BOOL autoStartReceiveFax;
02371 BOOL autoStartTransmitFax;
02372 #endif // H323_T38
02373
02374 BOOL autoCallForward;
02375 BOOL disableFastStart;
02376 BOOL disableH245Tunneling;
02377 BOOL disableH245inSetup;
02378 BOOL disableDetectInBandDTMF;
02379 BOOL canDisplayAmountString;
02380 BOOL canEnforceDurationLimit;
02381
02382 #ifdef H323_H450
02383 unsigned callIntrusionProtectionLevel;
02384 #endif // H323_H450
02385
02386 H323Connection::SendUserInputModes defaultSendUserInputMode;
02387
02388 #ifdef P_LDAP
02389 PString ilsServer;
02390 #endif // P_LDAP
02391
02392
02393 BYTE rtpIpTypeofService;
02394 BYTE tcpIpTypeofService;
02395 PTimeInterval signallingChannelConnectTimeout;
02396 PTimeInterval signallingChannelCallTimeout;
02397 PTimeInterval controlChannelStartTimeout;
02398 PTimeInterval endSessionTimeout;
02399 PTimeInterval masterSlaveDeterminationTimeout;
02400 unsigned masterSlaveDeterminationRetries;
02401 PTimeInterval capabilityExchangeTimeout;
02402 PTimeInterval logicalChannelTimeout;
02403 PTimeInterval requestModeTimeout;
02404 PTimeInterval roundTripDelayTimeout;
02405 PTimeInterval roundTripDelayRate;
02406 PTimeInterval noMediaTimeout;
02407 PTimeInterval gatekeeperRequestTimeout;
02408 unsigned gatekeeperRequestRetries;
02409 PTimeInterval rasRequestTimeout;
02410 unsigned rasRequestRetries;
02411 PTimeInterval registrationTimeToLive;
02412 PString gkAccessTokenOID;
02413 BOOL sendGRQ;
02414
02415 unsigned initialBandwidth;
02416 BOOL clearCallOnRoundTripFail;
02417
02418 struct PortInfo {
02419 void Set(
02420 unsigned base,
02421 unsigned max,
02422 unsigned range,
02423 unsigned dflt
02424 );
02425 WORD GetNext(
02426 unsigned increment
02427 );
02428
02429 PMutex mutex;
02430 WORD base;
02431 WORD max;
02432 WORD current;
02433 } tcpPorts, udpPorts, rtpIpPorts;
02434
02435 #ifdef P_STUN
02436 PSTUNClient * stun;
02437 BOOL disableSTUNTranslate;
02438 PNatStrategy natMethods;
02439 #endif
02440
02441 BYTE t35CountryCode;
02442 BYTE t35Extension;
02443 WORD manufacturerCode;
02444
02445 TerminalTypes terminalType;
02446
02447 #ifdef H323_H450
02448
02449
02450
02451 PTimeInterval callTransferT1;
02452
02453
02454 PTimeInterval callTransferT2;
02455
02456
02457 PTimeInterval callTransferT3;
02458
02459
02460 PTimeInterval callTransferT4;
02461
02463 PTimeInterval callIntrusionT1;
02464 PTimeInterval callIntrusionT2;
02465 PTimeInterval callIntrusionT3;
02466 PTimeInterval callIntrusionT4;
02467 PTimeInterval callIntrusionT5;
02468 PTimeInterval callIntrusionT6;
02469
02470 H323CallIdentityDict secondaryConnectionsActive;
02471
02472 mutable PAtomicInteger nextH450CallIdentity;
02474
02475 #endif // H323_H450
02476
02477 PINDEX cleanerThreadStackSize;
02478 PINDEX listenerThreadStackSize;
02479 PINDEX signallingThreadStackSize;
02480 PINDEX controlThreadStackSize;
02481 PINDEX logicalThreadStackSize;
02482 PINDEX rasThreadStackSize;
02483 PINDEX jitterThreadStackSize;
02484
02485 #ifdef H323_RTP_AGGREGATE
02486 PINDEX rtpAggregationSize;
02487 PHandleAggregator * rtpAggregator;
02488 #endif
02489
02490 #ifdef H323_SIGNAL_AGGREGATE
02491 PINDEX signallingAggregationSize;
02492 PHandleAggregator * signallingAggregator;
02493 #endif
02494
02495 PThread::Priority channelThreadPriority;
02496
02497
02498 H323ListenerList listeners;
02499 H323Capabilities capabilities;
02500 H323Gatekeeper * gatekeeper;
02501 PString gatekeeperPassword;
02502
02503 H323ConnectionDict connectionsActive;
02504
02505 PMutex connectionsMutex;
02506 PMutex noMediaMutex;
02507 PStringSet connectionsToBeCleaned;
02508 H323ConnectionsCleaner * connectionsCleaner;
02509 PSyncPoint connectionsAreCleaned;
02510
02511 #ifndef DISABLE_CALLAUTH
02512
02513 PString EPSecurityUserName;
02514 PString EPSecurityPassword;
02515 BOOL isSecureCall;
02516 EPSecurityPolicy CallAuthPolicy;
02517 H235AuthenticatorList EPAuthList;
02518 #endif
02519
02520 #ifdef H323_H460
02521 H460_FeatureSet features;
02522 BOOL disableH460;
02523 #endif
02524
02525 #ifdef H323_AEC
02526 BOOL enableAEC;
02527 #endif
02528 };
02529
02530
02531 #endif // __OPAL_H323EP_H
02532
02533