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 #ifndef __OPAL_H323CON_H
00329 #define __OPAL_H323CON_H
00330
00331 #ifdef P_USE_PRAGMA
00332 #pragma interface
00333 #endif
00334
00335 #ifdef P_DTMF
00336 #include <ptclib/dtmf.h>
00337 #endif
00338
00339 #include "h323caps.h"
00340 #include "transports.h"
00341 #include "channels.h"
00342 #include "guid.h"
00343 #include "openh323buildopts.h"
00344
00345 #ifdef H323_TRANSNEXUS_OSP
00346 #include "opalosp.h"
00347
00348
00349
00350
00351
00352
00353 #endif
00354
00355
00356
00357
00358
00359
00360 class PPER_Stream;
00361
00362 class H225_EndpointType;
00363 class H225_TransportAddress;
00364 class H225_ArrayOf_PASN_OctetString;
00365 class H225_ProtocolIdentifier;
00366 class H225_AdmissionRequest;
00367 class H225_FeatureSet;
00368 class H225_Setup_UUIE;
00369
00370 class H245_TerminalCapabilitySet;
00371 class H245_TerminalCapabilitySetReject;
00372 class H245_OpenLogicalChannel;
00373 class H245_OpenLogicalChannelAck;
00374 class H245_TransportAddress;
00375 class H245_UserInputIndication;
00376 class H245_RequestMode;
00377 class H245_RequestModeAck;
00378 class H245_RequestModeReject;
00379 class H245_ModeDescription;
00380 class H245_ArrayOf_ModeDescription;
00381 class H245_SendTerminalCapabilitySet;
00382 class H245_MultiplexCapability;
00383 class H245_FlowControlCommand;
00384 class H245_MiscellaneousCommand;
00385 class H245_MiscellaneousIndication;
00386 class H245_JitterIndication;
00387
00388 class H323SignalPDU;
00389 class H323ControlPDU;
00390
00391 class H235Authenticators;
00392
00393 class H245NegMasterSlaveDetermination;
00394 class H245NegTerminalCapabilitySet;
00395 class H245NegLogicalChannels;
00396 class H245NegRequestMode;
00397 class H245NegRoundTripDelay;
00398
00399 #ifdef H323_H450
00400
00401 class H450xDispatcher;
00402 class H4502Handler;
00403 class H4504Handler;
00404 class H4506Handler;
00405 class H45011Handler;
00406
00407 #endif
00408
00409 #ifdef H323_T120
00410 class OpalT120Protocol;
00411 #endif
00412
00413 #ifdef H323_T38
00414 class OpalT38Protocol;
00415 #endif
00416
00417 class OpalRFC2833;
00418 class OpalRFC2833Info;
00419
00420
00421
00423
00430 class H323Connection : public PObject
00431 {
00432 PCLASSINFO(H323Connection, PObject);
00433
00434 public:
00437 enum Options {
00438 FastStartOptionDisable = 0x0001,
00439 FastStartOptionEnable = 0x0002,
00440 FastStartOptionMask = 0x0003,
00441
00442 H245TunnelingOptionDisable = 0x0004,
00443 H245TunnelingOptionEnable = 0x0008,
00444 H245TunnelingOptionMask = 0x000c,
00445
00446 H245inSetupOptionDisable = 0x0010,
00447 H245inSetupOptionEnable = 0x0020,
00448 H245inSetupOptionMask = 0x0030,
00449
00450 DetectInBandDTMFOptionDisable= 0x0040,
00451 DetectInBandDTMFOptionEnable = 0x0080,
00452 DetectInBandDTMFOptionMask = 0x00c0,
00453 };
00454
00457 H323Connection(
00458 H323EndPoint & endpoint,
00459 unsigned callReference,
00460 unsigned options = 0
00461 );
00462
00465 ~H323Connection();
00466
00476 BOOL Lock();
00477
00489 int TryLock();
00490
00496 void Unlock();
00497
00504 virtual void OnSendARQ(
00505 H225_AdmissionRequest & arq
00506 );
00507
00511 virtual void OnEstablished();
00512
00516 virtual void OnCleared();
00517
00524 BOOL IsConnected() const { return connectionState == HasExecutedSignalConnect || connectionState == EstablishedConnection; }
00525
00531 BOOL IsEstablished() const { return connectionState == EstablishedConnection; }
00532
00537 enum CallEndReason {
00538 EndedByLocalUser,
00539 EndedByNoAccept,
00540 EndedByAnswerDenied,
00541 EndedByRemoteUser,
00542 EndedByRefusal,
00543 EndedByNoAnswer,
00544 EndedByCallerAbort,
00545 EndedByTransportFail,
00546 EndedByConnectFail,
00547 EndedByGatekeeper,
00548 EndedByNoUser,
00549 EndedByNoBandwidth,
00550 EndedByCapabilityExchange,
00551 EndedByCallForwarded,
00552 EndedBySecurityDenial,
00553 EndedByLocalBusy,
00554 EndedByLocalCongestion,
00555 EndedByRemoteBusy,
00556 EndedByRemoteCongestion,
00557 EndedByUnreachable,
00558 EndedByNoEndPoint,
00559 EndedByHostOffline,
00560 EndedByTemporaryFailure,
00561 EndedByQ931Cause,
00562 EndedByDurationLimit,
00563 EndedByInvalidConferenceID,
00564 EndedByOSPRefusal,
00565 EndedByInvalidNumberFormat,
00566 EndedByUnspecifiedProtocolError,
00567 NumCallEndReasons
00568 };
00569 #if PTRACING
00570 friend ostream & operator<<(ostream & o, CallEndReason r);
00571 #endif
00572
00581 CallEndReason GetCallEndReason() const { return callEndReason; }
00582
00587 virtual void SetCallEndReason(
00588 CallEndReason reason,
00589 PSyncPoint * sync = NULL
00590 );
00591
00597 virtual BOOL ClearCall(
00598 CallEndReason reason = EndedByLocalUser
00599 );
00600
00603 virtual BOOL ClearCallSynchronous(
00604 PSyncPoint * sync,
00605 CallEndReason reason = EndedByLocalUser
00606 );
00607
00616 virtual void CleanUpOnCallEnd();
00618
00619
00624 virtual void AttachSignalChannel(
00625 const PString & token,
00626 H323Transport * channel,
00627 BOOL answeringCall
00628 );
00629
00632 BOOL WriteSignalPDU(
00633 H323SignalPDU & pdu
00634 );
00635
00639 virtual void HandleSignallingChannel();
00640
00644 virtual BOOL HandleSignalPDU(
00645 H323SignalPDU & pdu
00646 );
00647
00651 virtual void HandleTunnelPDU(
00652 H323SignalPDU * txPDU
00653 );
00654
00662 virtual BOOL OnReceivedSignalSetup(
00663 const H323SignalPDU & pdu
00664 );
00665
00672 virtual BOOL OnReceivedSignalSetupAck(
00673 const H323SignalPDU & pdu
00674 );
00675
00682 virtual BOOL OnReceivedSignalInformation(
00683 const H323SignalPDU & pdu
00684 );
00685
00694 virtual BOOL OnReceivedCallProceeding(
00695 const H323SignalPDU & pdu
00696 );
00697
00706 virtual BOOL OnReceivedProgress(
00707 const H323SignalPDU & pdu
00708 );
00709
00716 virtual BOOL OnReceivedAlerting(
00717 const H323SignalPDU & pdu
00718 );
00719
00728 virtual BOOL OnReceivedSignalConnect(
00729 const H323SignalPDU & pdu
00730 );
00731
00740 virtual BOOL OnReceivedFacility(
00741 const H323SignalPDU & pdu
00742 );
00743
00750 virtual BOOL OnReceivedSignalNotify(
00751 const H323SignalPDU & pdu
00752 );
00753
00760 virtual BOOL OnReceivedSignalStatus(
00761 const H323SignalPDU & pdu
00762 );
00763
00770 virtual BOOL OnReceivedStatusEnquiry(
00771 const H323SignalPDU & pdu
00772 );
00773
00778 virtual void OnReceivedReleaseComplete(
00779 const H323SignalPDU & pdu
00780 );
00781
00788 virtual BOOL OnUnknownSignalPDU(
00789 const H323SignalPDU & pdu
00790 );
00791
00803 virtual BOOL OnIncomingCall(
00804 const H323SignalPDU & setupPDU,
00805 H323SignalPDU & alertingPDU
00806 );
00807 virtual BOOL OnIncomingCall(
00808 const H323SignalPDU & setupPDU,
00809 H323SignalPDU & alertingPDU,
00810 CallEndReason & reason
00811 );
00812
00822 virtual BOOL ForwardCall(
00823 const PString & forwardParty
00824 );
00825
00826 #ifdef H323_H450
00827
00832 void TransferCall(
00833 const PString & remoteParty,
00834 const PString & callIdentity = PString::Empty()
00836 );
00837
00842 void ConsultationTransfer(
00843 const PString & primaryCallToken
00844 );
00845
00852 virtual void HandleConsultationTransfer(
00853 const PString & callIdentity,
00855 H323Connection & incoming
00856 );
00857
00860 BOOL IsTransferringCall() const;
00861
00864 BOOL IsTransferredCall() const;
00865
00870 virtual void HandleTransferCall(
00871 const PString & token,
00872 const PString & identity
00873 );
00874
00879 int GetCallTransferInvokeId();
00880
00888 virtual void HandleCallTransferFailure(
00889 const int returnError
00890 );
00891
00896 void SetAssociatedCallToken(
00897 const PString & token
00898 );
00899
00904 virtual void OnConsultationTransferSuccess(
00905 H323Connection & secondaryCall
00906 );
00907
00912 void HoldCall(
00913 BOOL localHold
00914 );
00915
00921 void RetrieveCall();
00922
00929 void SetHoldMedia(
00930 PChannel * audioChannel
00931 );
00932
00935 BOOL IsMediaOnHold() const;
00936
00939 BOOL IsLocalHold() const;
00940
00943 BOOL IsRemoteHold() const;
00944
00947 BOOL IsCallOnHold() const;
00948
00953 virtual void IntrudeCall(
00954 unsigned capabilityLevel
00955 );
00956
00961 virtual void HandleIntrudeCall(
00962 const PString & token,
00963 const PString & identity
00964 );
00965
00971 void SetCallIntrusion() { isCallIntrusion = TRUE; }
00972
00973 BOOL IsCallIntrusion() { return isCallIntrusion; }
00974
00977 unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00978
00982 virtual BOOL GetRemoteCallIntrusionProtectionLevel(
00983 const PString & callToken,
00984 unsigned callIntrusionProtectionLevel
00985 );
00986
00987 virtual void SetIntrusionImpending();
00988
00989 virtual void SetForcedReleaseAccepted();
00990
00991 virtual void SetIntrusionNotAuthorized();
00992
00999 void SendCallWaitingIndication(
01000 const unsigned nbOfAddWaitingCalls = 0
01001 );
01002
01003 #endif // H323_H450
01004
01005 enum AnswerCallResponse {
01006 AnswerCallNow,
01007 AnswerCallDenied,
01008 AnswerCallPending,
01009 AnswerCallDeferred,
01010 AnswerCallAlertWithMedia,
01011 AnswerCallDeferredWithMedia,
01012 AnswerCallDeniedByInvalidCID,
01013 NumAnswerCallResponses
01014 };
01015 #if PTRACING
01016 friend ostream & operator<<(ostream & o, AnswerCallResponse s);
01017 #endif
01018
01045 virtual AnswerCallResponse OnAnswerCall(
01046 const PString & callerName,
01047 const H323SignalPDU & setupPDU,
01048 H323SignalPDU & connectPDU
01049 );
01050
01061 void AnsweringCall(
01062 AnswerCallResponse response
01063 );
01064
01075 virtual CallEndReason SendSignalSetup(
01076 const PString & alias,
01077 const H323TransportAddress & address
01078 );
01079
01091 virtual BOOL OnSendSignalSetup(
01092 H323SignalPDU & setupPDU
01093 );
01094
01103 virtual BOOL OnSendCallProceeding(
01104 H323SignalPDU & callProceedingPDU
01105 );
01106
01118 virtual BOOL OnSendReleaseComplete(
01119 H323SignalPDU & releaseCompletePDU
01120 );
01121
01132 virtual BOOL OnAlerting(
01133 const H323SignalPDU & alertingPDU,
01134 const PString & user
01135 );
01136
01151 virtual BOOL OnInsufficientDigits();
01152
01165 virtual void SendMoreDigits(
01166 const PString & digits
01167 );
01168
01178 virtual BOOL OnOutgoingCall(
01179 const H323SignalPDU & connectPDU
01180 );
01181
01193 virtual BOOL SendFastStartAcknowledge(
01194 H225_ArrayOf_PASN_OctetString & array
01195 );
01196
01208 virtual BOOL HandleFastStartAcknowledge(
01209 const H225_ArrayOf_PASN_OctetString & array
01210 );
01211
01219 virtual BOOL StartControlChannel();
01220
01232 virtual BOOL StartControlChannel(
01233 const H225_TransportAddress & h245Address
01234 );
01236
01243 BOOL WriteControlPDU(
01244 const H323ControlPDU & pdu
01245 );
01246
01249 virtual BOOL StartControlNegotiations(
01250 BOOL renegotiate = FALSE
01251 );
01252
01255 virtual void HandleControlChannel();
01256
01263 virtual BOOL HandleControlData(
01264 PPER_Stream & strm
01265 );
01266
01273 virtual BOOL HandleControlPDU(
01274 const H323ControlPDU & pdu
01275 );
01276
01286 virtual BOOL OnUnknownControlPDU(
01287 const H323ControlPDU & pdu
01288 );
01289
01293 virtual BOOL OnH245Request(
01294 const H323ControlPDU & pdu
01295 );
01296
01300 virtual BOOL OnH245Response(
01301 const H323ControlPDU & pdu
01302 );
01303
01307 virtual BOOL OnH245Command(
01308 const H323ControlPDU & pdu
01309 );
01310
01314 virtual BOOL OnH245Indication(
01315 const H323ControlPDU & pdu
01316 );
01317
01320 virtual BOOL OnH245_SendTerminalCapabilitySet(
01321 const H245_SendTerminalCapabilitySet & pdu
01322 );
01323
01328 virtual BOOL OnH245_FlowControlCommand(
01329 const H245_FlowControlCommand & pdu
01330 );
01331
01336 virtual BOOL OnH245_MiscellaneousCommand(
01337 const H245_MiscellaneousCommand & pdu
01338 );
01339
01344 virtual BOOL OnH245_MiscellaneousIndication(
01345 const H245_MiscellaneousIndication & pdu
01346 );
01347
01352 virtual BOOL OnH245_JitterIndication(
01353 const H245_JitterIndication & pdu
01354 );
01355
01358 enum ControlProtocolErrors {
01359 e_MasterSlaveDetermination,
01360 e_CapabilityExchange,
01361 e_LogicalChannel,
01362 e_ModeRequest,
01363 e_RoundTripDelay
01364 };
01365
01377 virtual BOOL OnControlProtocolError(
01378 ControlProtocolErrors errorSource,
01379 const void * errorData = NULL
01380 );
01381
01389 virtual void OnSendCapabilitySet(
01390 H245_TerminalCapabilitySet & pdu
01391 );
01392
01404 virtual BOOL OnReceivedCapabilitySet(
01405 const H323Capabilities & remoteCaps,
01406 const H245_MultiplexCapability * muxCap,
01407 H245_TerminalCapabilitySetReject & reject
01408 );
01409
01412 virtual void SendCapabilitySet(
01413 BOOL empty
01414 );
01415
01424 virtual void OnSetLocalCapabilities();
01425
01428 BOOL IsH245Master() const;
01429
01432 void StartRoundTripDelay();
01433
01436 PTimeInterval GetRoundTripDelay() const;
01438
01478 virtual void OnSelectLogicalChannels();
01479
01482 virtual void SelectDefaultLogicalChannel(
01483 unsigned sessionID
01484 );
01485
01489 virtual void SelectFastStartChannels(
01490 unsigned sessionID,
01491 BOOL transmitter,
01492 BOOL receiver
01493 );
01494
01509 virtual BOOL OpenLogicalChannel(
01510 const H323Capability & capability,
01511 unsigned sessionID,
01512 H323Channel::Directions dir
01513 );
01514
01524 virtual BOOL OnOpenLogicalChannel(
01525 const H245_OpenLogicalChannel & openPDU,
01526 H245_OpenLogicalChannelAck & ackPDU,
01527 unsigned & errorCode
01528 );
01529
01537 virtual BOOL OnConflictingLogicalChannel(
01538 H323Channel & channel
01539 );
01540
01545 virtual H323Channel * CreateLogicalChannel(
01546 const H245_OpenLogicalChannel & open,
01547 BOOL startingFast,
01548 unsigned & errorCode
01549 );
01550
01586 virtual H323Channel * CreateRealTimeLogicalChannel(
01587 const H323Capability & capability,
01588 H323Channel::Directions dir,
01589 unsigned sessionID,
01590 const H245_H2250LogicalChannelParameters * param,
01592 RTP_QOS * rtpqos = NULL
01593 );
01594
01605 virtual BOOL OnCreateLogicalChannel(
01606 const H323Capability & capability,
01607 H323Channel::Directions dir,
01608 unsigned & errorCode
01609 );
01610
01615 virtual BOOL OnStartLogicalChannel(
01616 H323Channel & channel
01617 );
01618
01619 #ifndef NO_H323_AUDIO_CODECS
01620
01626 virtual BOOL OpenAudioChannel(
01627 BOOL isEncoding,
01628 unsigned bufferSize,
01629 H323AudioCodec & codec
01630 );
01631 #endif
01632
01633 #ifndef NO_H323_VIDEO
01634
01640 virtual BOOL OpenVideoChannel(
01641 BOOL isEncoding,
01642 H323VideoCodec & codec
01643 );
01644 #endif // NO_H323_VIDEO
01645
01648 virtual void CloseLogicalChannel(
01649 unsigned number,
01650 BOOL fromRemote
01651 );
01652
01655 virtual void CloseLogicalChannelNumber(
01656 const H323ChannelNumber & number
01657 );
01658
01661 virtual void CloseAllLogicalChannels(
01662 BOOL fromRemote
01663 );
01664
01670 virtual void OnClosedLogicalChannel(
01671 const H323Channel & channel
01672 );
01673
01682 virtual BOOL OnClosingLogicalChannel(
01683 H323Channel & channel
01684 );
01685
01694 virtual void OnLogicalChannelFlowControl(
01695 H323Channel * channel,
01696 long bitRateRestriction
01697 );
01698
01707 virtual void OnLogicalChannelJitter(
01708 H323Channel * channel,
01709 DWORD jitter,
01710 int skippedFrameCount,
01711 int additionalBuffer
01712 );
01713
01716 void SendLogicalChannelMiscCommand(
01717 H323Channel & channel,
01718 unsigned command
01719 );
01720
01724 H323Channel * GetLogicalChannel(
01725 unsigned number,
01726 BOOL fromRemote
01727 ) const;
01728
01734 H323Channel * FindChannel(
01735 unsigned sessionId,
01736 BOOL fromRemote
01737 ) const;
01739
01746 unsigned GetBandwidthUsed() const;
01747
01753 BOOL UseBandwidth(
01754 unsigned bandwidth,
01755 BOOL removing
01756 );
01757
01760 unsigned GetBandwidthAvailable() const { return bandwidthAvailable; }
01761
01766 BOOL SetBandwidthAvailable(
01767 unsigned newBandwidth,
01768 BOOL force = FALSE
01769 );
01771
01774 enum SendUserInputModes {
01775 SendUserInputAsQ931,
01776 SendUserInputAsString,
01777 SendUserInputAsTone,
01778 SendUserInputAsInlineRFC2833,
01779 SendUserInputAsSeparateRFC2833,
01780 NumSendUserInputModes
01781 };
01782 #if PTRACING
01783 friend ostream & operator<<(ostream & o, SendUserInputModes m);
01784 #endif
01785
01788 void SetSendUserInputMode(SendUserInputModes mode);
01789
01792 SendUserInputModes GetSendUserInputMode() const { return sendUserInputMode; }
01793
01799 SendUserInputModes GetRealSendUserInputMode() const;
01800
01814 virtual void SendUserInput(
01815 const PString & value
01816 );
01817
01824 virtual void OnUserInputString(
01825 const PString & value
01826 );
01827
01852 virtual void SendUserInputTone(
01853 char tone,
01854 unsigned duration = 0,
01855 unsigned logicalChannel = 0,
01856 unsigned rtpTimestamp = 0
01857 );
01858
01863 virtual void OnUserInputTone(
01864 char tone,
01865 unsigned duration,
01866 unsigned logicalChannel,
01867 unsigned rtpTimestamp
01868 );
01869
01873 void SendUserInputHookFlash(
01874 int duration = 500
01875 ) { SendUserInputTone('!', duration); }
01876
01883 virtual void SendUserInputIndicationQ931(
01884 const PString & value
01885 );
01886
01893 virtual void SendUserInputIndicationString(
01894 const PString & value
01895 );
01896
01901 virtual void SendUserInputIndicationTone(
01902 char tone,
01903 unsigned duration = 0,
01904 unsigned logicalChannel = 0,
01905 unsigned rtpTimestamp = 0
01906 );
01907
01916 virtual void SendUserInputIndication(
01917 const H245_UserInputIndication & pdu
01918 );
01919
01924 virtual void OnUserInputIndication(
01925 const H245_UserInputIndication & pdu
01926 );
01928
01934 virtual RTP_Session * GetSession(
01935 unsigned sessionID
01936 ) const;
01937
01941 virtual H323_RTP_Session * GetSessionCallbacks(
01942 unsigned sessionID
01943 ) const;
01944
01954 virtual RTP_Session * UseSession(
01955 unsigned sessionID,
01956 const H245_TransportAddress & pdu,
01957 H323Channel::Directions dir,
01958 RTP_QOS * rtpqos = NULL
01959 );
01960
01964 virtual void ReleaseSession(
01965 unsigned sessionID
01966 );
01967
01975 virtual void OnRTPStatistics(
01976 const RTP_Session & session
01977 ) const;
01978
01982 virtual PString GetSessionCodecNames(
01983 unsigned sessionID
01984 ) const;
01985
01988 BOOL IsBehindNAT() const
01989 { return remoteIsNAT; }
01990
01992
02010 virtual BOOL RequestModeChange(
02011 const PString & newModes
02012 );
02013
02021 virtual BOOL RequestModeChange(
02022 const H245_ArrayOf_ModeDescription & newModes
02023 );
02024
02027 virtual BOOL OnRequestModeChange(
02028 const H245_RequestMode & pdu,
02029 H245_RequestModeAck & ack,
02030 H245_RequestModeReject & reject,
02031 PINDEX & selectedMode
02032 );
02033
02040 virtual void OnModeChanged(
02041 const H245_ModeDescription & newMode
02042 );
02043
02048 virtual void OnAcceptModeChange(
02049 const H245_RequestModeAck & pdu
02050 );
02051
02056 virtual void OnRefusedModeChange(
02057 const H245_RequestModeReject * pdu
02058 );
02060
02061 #ifdef H323_T120
02062
02076 virtual OpalT120Protocol * CreateT120ProtocolHandler();
02077 #endif
02078
02079 #ifdef H323_T38
02080
02092 virtual OpalT38Protocol * CreateT38ProtocolHandler();
02093
02096 virtual BOOL RequestModeChangeT38(
02097 const char * capabilityNames = "T.38\nT38FaxUDP"
02098 );
02099 #endif
02100
02110 virtual BOOL GetAdmissionRequestAuthentication(
02111 const H225_AdmissionRequest & arq,
02112 H235Authenticators & authenticators
02113 );
02115
02120 H323EndPoint & GetEndPoint() const { return endpoint; }
02121
02124 BOOL HadAnsweredCall() const { return callAnswered; }
02125
02128 BOOL IsGatekeeperRouted() const { return gatekeeperRouted; }
02129
02133 unsigned GetQ931Cause() const { return q931Cause; }
02134
02138 void SetQ931Cause(unsigned v) { q931Cause = v; }
02139
02144 unsigned GetDistinctiveRing() const { return distinctiveRing; }
02145
02152 void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
02153
02156 const PString & GetCallToken() const { return callToken; }
02157
02160 unsigned GetCallReference() const { return callReference; }
02161
02164 const OpalGloballyUniqueID & GetCallIdentifier() const { return callIdentifier; }
02165
02168 const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
02169
02172 const PString & GetLocalPartyName() const { return localPartyName; }
02173
02176 void SetLocalPartyName(const PString & name);
02177
02180 void SetDisplayName(const PString & name) { localDisplayName = name; }
02181
02184 const PString GetDisplayName() const { return localDisplayName; }
02185
02186 const PStringList & GetLocalAliasNames() const { return localAliasNames; }
02187
02194 const PString & GetRemotePartyName() const { return remotePartyName; }
02195
02200 const PString & GetRemotePartyNumber() const { return remotePartyNumber; }
02201
02208 const PString & GetRemotePartyAddress() const { return remotePartyAddress; }
02209
02212 void SetRemotePartyInfo(
02213 const H323SignalPDU & pdu
02214 );
02215
02227 const PString & GetRemoteApplication() const { return remoteApplication; }
02228
02231 void SetRemoteApplication(
02232 const H225_EndpointType & pdu
02233 );
02234
02237 const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
02238
02241 const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
02242
02245 unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
02246
02249 const H323Transport * GetSignallingChannel() const { return signallingChannel; }
02250
02253 unsigned GetSignallingVersion() const { return h225version; }
02254
02257 const H323Transport & GetControlChannel() const;
02258
02261 unsigned GetControlVersion() const { return h245version; }
02262
02265 PTime GetSetupUpTime() const { return setupTime; }
02266
02269 PTime GetAlertingTime() const { return alertingTime; }
02270
02274 PTime GetConnectionStartTime() const { return connectedTime; }
02275
02278 PTime GetConnectionEndTime() const { return callEndTime; }
02279
02282 PTime GetReverseMediaOpenTime() const { return reverseMediaOpenTime; }
02283
02287 unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
02288
02292 unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
02293
02296 void SetAudioJitterDelay(
02297 unsigned minDelay,
02298 unsigned maxDelay
02299 );
02300
02303 unsigned GetUUIEsRequested() const { return uuiesRequested; }
02304
02307 void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
02308
02311 const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
02312
02315 void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
02316
02319 const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
02320
02323 void SetDestExtraCallInfo(
02324 const PString & info
02325 ) { destExtraCallInfo = info; }
02326
02329 void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
02330
02336 const int GetRemoteCallWaiting() const { return remoteCallWaiting; }
02337
02342 void SetEnforcedDurationLimit(
02343 unsigned seconds
02344 );
02346
02347 virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02348
02349 virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02350
02351 enum ReleaseSequence {
02352 ReleaseSequenceUnknown,
02353 ReleaseSequence_Local,
02354 ReleaseSequence_Remote
02355 };
02356
02357 ReleaseSequence GetReleaseSequence() const
02358 { return releaseSequence; }
02359
02360 protected:
02366 virtual void InternalEstablishedConnectionCheck();
02367 BOOL DecodeFastStartCaps(const H225_ArrayOf_PASN_OctetString & fastStartCaps);
02368 BOOL InternalEndSessionCheck(PPER_Stream & strm);
02369 void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02370 void MonitorCallStatus();
02371 PDECLARE_NOTIFIER(OpalRFC2833Info, H323Connection, OnUserInputInlineRFC2833);
02372 PDECLARE_NOTIFIER(H323Codec::FilterInfo, H323Connection, OnUserInputInBandDTMF);
02373
02374 H323EndPoint & endpoint;
02375 PSyncPoint * endSync;
02376
02377 int remoteCallWaiting;
02378 BOOL callAnswered;
02379 BOOL gatekeeperRouted;
02380 unsigned distinctiveRing;
02381 PString callToken;
02382 unsigned callReference;
02383 OpalGloballyUniqueID callIdentifier;
02384 OpalGloballyUniqueID conferenceIdentifier;
02385
02386 PStringList localAliasNames;
02387 PString localPartyName;
02388 PString localDisplayName;
02389 H323Capabilities localCapabilities;
02390 PString remotePartyName;
02391 PString remotePartyNumber;
02392 PString remotePartyAddress;
02393 PString destExtraCallInfo;
02394 PString remoteApplication;
02395 H323Capabilities remoteCapabilities;
02396 unsigned remoteMaxAudioDelayJitter;
02397 PTimer roundTripDelayTimer;
02398 unsigned minAudioJitterDelay;
02399 unsigned maxAudioJitterDelay;
02400 unsigned bandwidthAvailable;
02401 unsigned uuiesRequested;
02402 PString gkAccessTokenOID;
02403 PBYTEArray gkAccessTokenData;
02404 BOOL addAccessTokenToSetup;
02405 SendUserInputModes sendUserInputMode;
02406
02407 H323Transport * signallingChannel;
02408 H323Transport * controlChannel;
02409 BOOL h245Tunneling;
02410 H323SignalPDU * h245TunnelRxPDU;
02411 H323SignalPDU * h245TunnelTxPDU;
02412 H323SignalPDU * alertingPDU;
02413 H323SignalPDU * connectPDU;
02414
02415 enum ConnectionStates {
02416 NoConnectionActive,
02417 AwaitingGatekeeperAdmission,
02418 AwaitingTransportConnect,
02419 AwaitingSignalConnect,
02420 AwaitingLocalAnswer,
02421 HasExecutedSignalConnect,
02422 EstablishedConnection,
02423 ShuttingDownConnection,
02424 NumConnectionStates
02425 } connectionState;
02426
02427 PTime setupTime;
02428 PTime alertingTime;
02429 PTime connectedTime;
02430 PTime callEndTime;
02431 PTime reverseMediaOpenTime;
02432 CallEndReason callEndReason;
02433 unsigned q931Cause;
02434 ReleaseSequence releaseSequence;
02435
02436 unsigned h225version;
02437 unsigned h245version;
02438 BOOL h245versionSet;
02439 BOOL doH245inSETUP;
02440 BOOL lastPDUWasH245inSETUP;
02441 BOOL detectInBandDTMF;
02442 BOOL mustSendDRQ;
02443 BOOL mediaWaitForConnect;
02444 BOOL transmitterSidePaused;
02445 BOOL earlyStart;
02446
02447 #ifdef H323_T120
02448 BOOL startT120;
02449 #endif
02450
02451 #ifdef H323_T38
02452 PString t38ModeChangeCapabilities;
02453 #endif
02454
02455 PSyncPoint digitsWaitFlag;
02456 BOOL endSessionNeeded;
02457 BOOL endSessionSent;
02458 PSyncPoint endSessionReceived;
02459 PTimer enforcedDurationLimit;
02460
02461 #ifdef H323_H450
02462
02463 PChannel * holdMediaChannel;
02464 BOOL isConsultationTransfer;
02465
02467 BOOL isCallIntrusion;
02468 unsigned callIntrusionProtectionLevel;
02469 #endif
02470
02471 RTP_SessionManager rtpSessions;
02472
02473 enum FastStartStates {
02474 FastStartDisabled,
02475 FastStartInitiate,
02476 FastStartResponse,
02477 FastStartAcknowledged,
02478 NumFastStartStates
02479 };
02480 FastStartStates fastStartState;
02481 H323LogicalChannelList fastStartChannels;
02482
02483 #if PTRACING
02484 static const char * const ConnectionStatesNames[NumConnectionStates];
02485 friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << ConnectionStatesNames[s]; }
02486 static const char * const FastStartStateNames[NumFastStartStates];
02487 friend ostream & operator<<(ostream & o, FastStartStates s) { return o << FastStartStateNames[s]; }
02488 #endif
02489
02490
02491
02492
02493 H245NegMasterSlaveDetermination * masterSlaveDeterminationProcedure;
02494 H245NegTerminalCapabilitySet * capabilityExchangeProcedure;
02495 H245NegLogicalChannels * logicalChannels;
02496 H245NegRequestMode * requestModeProcedure;
02497 H245NegRoundTripDelay * roundTripDelayProcedure;
02498
02499 #ifdef H323_H450
02500 H450xDispatcher * h450dispatcher;
02501 H4502Handler * h4502handler;
02502 H4504Handler * h4504handler;
02503 H4506Handler * h4506handler;
02504 H45011Handler * h45011handler;
02505 #endif
02506
02507 OpalRFC2833 * rfc2833handler;
02508
02509 #ifdef H323_T120
02510 OpalT120Protocol * t120handler;
02511 #endif
02512
02513 #ifdef H323_T38
02514 OpalT38Protocol * t38handler;
02515 #endif
02516
02517 #ifdef P_DTMF
02518
02519
02520 PDTMFDecoder dtmfDecoder;
02521 #endif
02522
02523
02524 BOOL remoteIsNAT;
02525
02526 #ifdef H323_TRANSNEXUS_OSP
02527 public:
02528 OpalOSP::Transaction * GetOSPTransaction() const
02529 { return ospTransaction; }
02530
02531 void SetOSPTransaction(OpalOSP::Transaction * tran)
02532 { ospTransaction = tran; }
02533
02534 protected:
02535 OpalOSP::Transaction * ospTransaction;
02536 virtual void CleanUpOSP();
02537 BOOL AuthoriseOSPTransaction(OpalOSP::Transaction & transaction, OpalOSP::Transaction::DestinationInfo & destInfo);
02538 #endif
02539
02540 private:
02541 PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02542
02543 PTimedMutex outerMutex;
02544 PMutex innerMutex;
02545 };
02546
02547
02548 PLIST(H323ConnectionList, H323Connection);
02549 PDICTIONARY(H323ConnectionDict, PString, H323Connection);
02550 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02551
02552
02553 #endif // __OPAL_H323CON_H
02554
02555