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 #ifndef __OPAL_H323CON_H
00297 #define __OPAL_H323CON_H
00298
00299 #ifdef P_USE_PRAGMA
00300 #pragma interface
00301 #endif
00302
00303
00304 #include <ptclib/dtmf.h>
00305 #include "h323caps.h"
00306 #include "transports.h"
00307 #include "channels.h"
00308 #include "guid.h"
00309 #include "openh323buildopts.h"
00310
00311
00312
00313
00314
00315
00316
00317 class PPER_Stream;
00318
00319 class H225_EndpointType;
00320 class H225_TransportAddress;
00321 class H225_ArrayOf_PASN_OctetString;
00322 class H225_ProtocolIdentifier;
00323 class H225_AdmissionRequest;
00324 class H225_FeatureSet;
00325
00326 class H245_TerminalCapabilitySet;
00327 class H245_TerminalCapabilitySetReject;
00328 class H245_OpenLogicalChannel;
00329 class H245_OpenLogicalChannelAck;
00330 class H245_TransportAddress;
00331 class H245_UserInputIndication;
00332 class H245_RequestMode;
00333 class H245_RequestModeAck;
00334 class H245_RequestModeReject;
00335 class H245_ModeDescription;
00336 class H245_ArrayOf_ModeDescription;
00337 class H245_SendTerminalCapabilitySet;
00338 class H245_MultiplexCapability;
00339 class H245_FlowControlCommand;
00340 class H245_MiscellaneousCommand;
00341 class H245_MiscellaneousIndication;
00342 class H245_JitterIndication;
00343
00344 class H323SignalPDU;
00345 class H323ControlPDU;
00346
00347 class H235Authenticators;
00348
00349 class H245NegMasterSlaveDetermination;
00350 class H245NegTerminalCapabilitySet;
00351 class H245NegLogicalChannels;
00352 class H245NegRequestMode;
00353 class H245NegRoundTripDelay;
00354
00355 class H450xDispatcher;
00356 class H4502Handler;
00357 class H4504Handler;
00358 class H4506Handler;
00359 class H45011Handler;
00360
00361 class OpalT120Protocol;
00362 class OpalT38Protocol;
00363 class OpalRFC2833;
00364 class OpalRFC2833Info;
00365
00366
00367
00369
00376 class H323Connection : public PObject
00377 {
00378 PCLASSINFO(H323Connection, PObject);
00379
00380 public:
00383 enum Options {
00384 FastStartOptionDisable = 0x0001,
00385 FastStartOptionEnable = 0x0002,
00386 FastStartOptionMask = 0x0003,
00387
00388 H245TunnelingOptionDisable = 0x0004,
00389 H245TunnelingOptionEnable = 0x0008,
00390 H245TunnelingOptionMask = 0x000c,
00391
00392 H245inSetupOptionDisable = 0x0010,
00393 H245inSetupOptionEnable = 0x0020,
00394 H245inSetupOptionMask = 0x0030,
00395
00396 DetectInBandDTMFOptionDisable= 0x0040,
00397 DetectInBandDTMFOptionEnable = 0x0080,
00398 DetectInBandDTMFOptionMask = 0x00c0,
00399 };
00400
00403 H323Connection(
00404 H323EndPoint & endpoint,
00405 unsigned callReference,
00406 unsigned options = 0
00407 );
00408
00411 ~H323Connection();
00412
00422 BOOL Lock();
00423
00435 int TryLock();
00436
00442 void Unlock();
00443
00450 virtual void OnSendARQ(
00451 H225_AdmissionRequest & arq
00452 );
00453
00457 virtual void OnEstablished();
00458
00462 virtual void OnCleared();
00463
00470 BOOL IsConnected() const { return connectionState == HasExecutedSignalConnect || connectionState == EstablishedConnection; }
00471
00477 BOOL IsEstablished() const { return connectionState == EstablishedConnection; }
00478
00483 enum CallEndReason {
00484 EndedByLocalUser,
00485 EndedByNoAccept,
00486 EndedByAnswerDenied,
00487 EndedByRemoteUser,
00488 EndedByRefusal,
00489 EndedByNoAnswer,
00490 EndedByCallerAbort,
00491 EndedByTransportFail,
00492 EndedByConnectFail,
00493 EndedByGatekeeper,
00494 EndedByNoUser,
00495 EndedByNoBandwidth,
00496 EndedByCapabilityExchange,
00497 EndedByCallForwarded,
00498 EndedBySecurityDenial,
00499 EndedByLocalBusy,
00500 EndedByLocalCongestion,
00501 EndedByRemoteBusy,
00502 EndedByRemoteCongestion,
00503 EndedByUnreachable,
00504 EndedByNoEndPoint,
00505 EndedByHostOffline,
00506 EndedByTemporaryFailure,
00507 EndedByQ931Cause,
00508 EndedByDurationLimit,
00509 EndedByInvalidConferenceID,
00510 NumCallEndReasons
00511 };
00512 #if PTRACING
00513 friend ostream & operator<<(ostream & o, CallEndReason r);
00514 #endif
00515
00524 CallEndReason GetCallEndReason() const { return callEndReason; }
00525
00530 virtual void SetCallEndReason(
00531 CallEndReason reason,
00532 PSyncPoint * sync = NULL
00533 );
00534
00540 virtual BOOL ClearCall(
00541 CallEndReason reason = EndedByLocalUser
00542 );
00543
00546 virtual BOOL ClearCallSynchronous(
00547 PSyncPoint * sync,
00548 CallEndReason reason = EndedByLocalUser
00549 );
00550
00559 virtual void CleanUpOnCallEnd();
00561
00562
00567 void AttachSignalChannel(
00568 const PString & token,
00569 H323Transport * channel,
00570 BOOL answeringCall
00571 );
00572
00575 BOOL WriteSignalPDU(
00576 H323SignalPDU & pdu
00577 );
00578
00582 virtual void HandleSignallingChannel();
00583
00587 virtual BOOL HandleSignalPDU(
00588 H323SignalPDU & pdu
00589 );
00590
00594 virtual void HandleTunnelPDU(
00595 H323SignalPDU * txPDU
00596 );
00597
00605 virtual BOOL OnReceivedSignalSetup(
00606 const H323SignalPDU & pdu
00607 );
00608
00615 virtual BOOL OnReceivedSignalSetupAck(
00616 const H323SignalPDU & pdu
00617 );
00618
00625 virtual BOOL OnReceivedSignalInformation(
00626 const H323SignalPDU & pdu
00627 );
00628
00637 virtual BOOL OnReceivedCallProceeding(
00638 const H323SignalPDU & pdu
00639 );
00640
00649 virtual BOOL OnReceivedProgress(
00650 const H323SignalPDU & pdu
00651 );
00652
00659 virtual BOOL OnReceivedAlerting(
00660 const H323SignalPDU & pdu
00661 );
00662
00671 virtual BOOL OnReceivedSignalConnect(
00672 const H323SignalPDU & pdu
00673 );
00674
00683 virtual BOOL OnReceivedFacility(
00684 const H323SignalPDU & pdu
00685 );
00686
00693 virtual BOOL OnReceivedSignalNotify(
00694 const H323SignalPDU & pdu
00695 );
00696
00703 virtual BOOL OnReceivedSignalStatus(
00704 const H323SignalPDU & pdu
00705 );
00706
00713 virtual BOOL OnReceivedStatusEnquiry(
00714 const H323SignalPDU & pdu
00715 );
00716
00721 virtual void OnReceivedReleaseComplete(
00722 const H323SignalPDU & pdu
00723 );
00724
00731 virtual BOOL OnUnknownSignalPDU(
00732 const H323SignalPDU & pdu
00733 );
00734
00746 virtual BOOL OnIncomingCall(
00747 const H323SignalPDU & setupPDU,
00748 H323SignalPDU & alertingPDU
00749 );
00750
00760 virtual BOOL ForwardCall(
00761 const PString & forwardParty
00762 );
00763
00768 void TransferCall(
00769 const PString & remoteParty,
00770 const PString & callIdentity = PString::Empty()
00772 );
00773
00778 void ConsultationTransfer(
00779 const PString & primaryCallToken
00780 );
00781
00788 virtual void HandleConsultationTransfer(
00789 const PString & callIdentity,
00791 H323Connection & incoming
00792 );
00793
00796 BOOL IsTransferringCall() const;
00797
00800 BOOL IsTransferredCall() const;
00801
00806 virtual void HandleTransferCall(
00807 const PString & token,
00808 const PString & identity
00809 );
00810
00815 int GetCallTransferInvokeId();
00816
00824 virtual void HandleCallTransferFailure(
00825 const int returnError
00826 );
00827
00832 void SetAssociatedCallToken(
00833 const PString & token
00834 );
00835
00840 virtual void OnConsultationTransferSuccess(
00841 H323Connection & secondaryCall
00842 );
00843
00848 void HoldCall(
00849 BOOL localHold
00850 );
00851
00857 void RetrieveCall();
00858
00865 void SetHoldMedia(
00866 PChannel * audioChannel
00867 );
00868
00871 BOOL IsMediaOnHold() const;
00872
00875 BOOL IsLocalHold() const;
00876
00879 BOOL IsRemoteHold() const;
00880
00883 BOOL IsCallOnHold() const;
00884
00889 virtual void IntrudeCall(
00890 unsigned capabilityLevel
00891 );
00892
00897 virtual void HandleIntrudeCall(
00898 const PString & token,
00899 const PString & identity
00900 );
00901
00907 void SetCallIntrusion() { isCallIntrusion = TRUE; }
00908
00909 BOOL IsCallIntrusion() { return isCallIntrusion; }
00910
00913 unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
00914
00918 virtual BOOL GetRemoteCallIntrusionProtectionLevel(
00919 const PString & callToken,
00920 unsigned callIntrusionProtectionLevel
00921 );
00922
00923 virtual void SetIntrusionImpending();
00924
00925 virtual void SetForcedReleaseAccepted();
00926
00927 virtual void SetIntrusionNotAuthorized();
00928
00935 void SendCallWaitingIndication(
00936 const unsigned nbOfAddWaitingCalls = 0
00937 );
00938
00939 enum AnswerCallResponse {
00940 AnswerCallNow,
00941 AnswerCallDenied,
00942 AnswerCallPending,
00943 AnswerCallDeferred,
00944 AnswerCallAlertWithMedia,
00945 AnswerCallDeferredWithMedia,
00946 AnswerCallDeniedByInvalidCID,
00947 NumAnswerCallResponses
00948 };
00949 #if PTRACING
00950 friend ostream & operator<<(ostream & o, AnswerCallResponse s);
00951 #endif
00952
00979 virtual AnswerCallResponse OnAnswerCall(
00980 const PString & callerName,
00981 const H323SignalPDU & setupPDU,
00982 H323SignalPDU & connectPDU
00983 );
00984
00995 void AnsweringCall(
00996 AnswerCallResponse response
00997 );
00998
01009 virtual CallEndReason SendSignalSetup(
01010 const PString & alias,
01011 const H323TransportAddress & address
01012 );
01013
01025 virtual BOOL OnSendSignalSetup(
01026 H323SignalPDU & setupPDU
01027 );
01028
01037 virtual BOOL OnSendCallProceeding(
01038 H323SignalPDU & callProceedingPDU
01039 );
01040
01052 virtual BOOL OnSendReleaseComplete(
01053 H323SignalPDU & releaseCompletePDU
01054 );
01055
01066 virtual BOOL OnAlerting(
01067 const H323SignalPDU & alertingPDU,
01068 const PString & user
01069 );
01070
01085 virtual BOOL OnInsufficientDigits();
01086
01099 virtual void SendMoreDigits(
01100 const PString & digits
01101 );
01102
01112 virtual BOOL OnOutgoingCall(
01113 const H323SignalPDU & connectPDU
01114 );
01115
01127 virtual BOOL SendFastStartAcknowledge(
01128 H225_ArrayOf_PASN_OctetString & array
01129 );
01130
01142 virtual BOOL HandleFastStartAcknowledge(
01143 const H225_ArrayOf_PASN_OctetString & array
01144 );
01145
01153 virtual BOOL StartControlChannel();
01154
01166 virtual BOOL StartControlChannel(
01167 const H225_TransportAddress & h245Address
01168 );
01170
01177 BOOL WriteControlPDU(
01178 const H323ControlPDU & pdu
01179 );
01180
01183 virtual BOOL StartControlNegotiations(
01184 BOOL renegotiate = FALSE
01185 );
01186
01189 virtual void HandleControlChannel();
01190
01197 virtual BOOL HandleControlData(
01198 PPER_Stream & strm
01199 );
01200
01207 virtual BOOL HandleControlPDU(
01208 const H323ControlPDU & pdu
01209 );
01210
01220 virtual BOOL OnUnknownControlPDU(
01221 const H323ControlPDU & pdu
01222 );
01223
01227 virtual BOOL OnH245Request(
01228 const H323ControlPDU & pdu
01229 );
01230
01234 virtual BOOL OnH245Response(
01235 const H323ControlPDU & pdu
01236 );
01237
01241 virtual BOOL OnH245Command(
01242 const H323ControlPDU & pdu
01243 );
01244
01248 virtual BOOL OnH245Indication(
01249 const H323ControlPDU & pdu
01250 );
01251
01254 virtual BOOL OnH245_SendTerminalCapabilitySet(
01255 const H245_SendTerminalCapabilitySet & pdu
01256 );
01257
01262 virtual BOOL OnH245_FlowControlCommand(
01263 const H245_FlowControlCommand & pdu
01264 );
01265
01270 virtual BOOL OnH245_MiscellaneousCommand(
01271 const H245_MiscellaneousCommand & pdu
01272 );
01273
01278 virtual BOOL OnH245_MiscellaneousIndication(
01279 const H245_MiscellaneousIndication & pdu
01280 );
01281
01286 virtual BOOL OnH245_JitterIndication(
01287 const H245_JitterIndication & pdu
01288 );
01289
01292 enum ControlProtocolErrors {
01293 e_MasterSlaveDetermination,
01294 e_CapabilityExchange,
01295 e_LogicalChannel,
01296 e_ModeRequest,
01297 e_RoundTripDelay
01298 };
01299
01311 virtual BOOL OnControlProtocolError(
01312 ControlProtocolErrors errorSource,
01313 const void * errorData = NULL
01314 );
01315
01323 virtual void OnSendCapabilitySet(
01324 H245_TerminalCapabilitySet & pdu
01325 );
01326
01338 virtual BOOL OnReceivedCapabilitySet(
01339 const H323Capabilities & remoteCaps,
01340 const H245_MultiplexCapability * muxCap,
01341 H245_TerminalCapabilitySetReject & reject
01342 );
01343
01346 virtual void SendCapabilitySet(
01347 BOOL empty
01348 );
01349
01358 virtual void OnSetLocalCapabilities();
01359
01362 BOOL IsH245Master() const;
01363
01366 void StartRoundTripDelay();
01367
01370 PTimeInterval GetRoundTripDelay() const;
01372
01412 virtual void OnSelectLogicalChannels();
01413
01416 virtual void SelectDefaultLogicalChannel(
01417 unsigned sessionID
01418 );
01419
01423 virtual void SelectFastStartChannels(
01424 unsigned sessionID,
01425 BOOL transmitter,
01426 BOOL receiver
01427 );
01428
01443 virtual BOOL OpenLogicalChannel(
01444 const H323Capability & capability,
01445 unsigned sessionID,
01446 H323Channel::Directions dir
01447 );
01448
01458 virtual BOOL OnOpenLogicalChannel(
01459 const H245_OpenLogicalChannel & openPDU,
01460 H245_OpenLogicalChannelAck & ackPDU,
01461 unsigned & errorCode
01462 );
01463
01471 virtual BOOL OnConflictingLogicalChannel(
01472 H323Channel & channel
01473 );
01474
01479 virtual H323Channel * CreateLogicalChannel(
01480 const H245_OpenLogicalChannel & open,
01481 BOOL startingFast,
01482 unsigned & errorCode
01483 );
01484
01520 virtual H323Channel * CreateRealTimeLogicalChannel(
01521 const H323Capability & capability,
01522 H323Channel::Directions dir,
01523 unsigned sessionID,
01524 const H245_H2250LogicalChannelParameters * param,
01526 RTP_QOS * rtpqos = NULL
01527 );
01528
01539 virtual BOOL OnCreateLogicalChannel(
01540 const H323Capability & capability,
01541 H323Channel::Directions dir,
01542 unsigned & errorCode
01543 );
01544
01549 virtual BOOL OnStartLogicalChannel(
01550 H323Channel & channel
01551 );
01552
01559 virtual BOOL OpenAudioChannel(
01560 BOOL isEncoding,
01561 unsigned bufferSize,
01562 H323AudioCodec & codec
01563 );
01564
01565 #ifndef NO_H323_VIDEO
01566
01572 virtual BOOL OpenVideoChannel(
01573 BOOL isEncoding,
01574 H323VideoCodec & codec
01575 );
01576 #endif // NO_H323_VIDEO
01577
01580 virtual void CloseLogicalChannel(
01581 unsigned number,
01582 BOOL fromRemote
01583 );
01584
01587 virtual void CloseLogicalChannelNumber(
01588 const H323ChannelNumber & number
01589 );
01590
01593 virtual void CloseAllLogicalChannels(
01594 BOOL fromRemote
01595 );
01596
01602 virtual void OnClosedLogicalChannel(
01603 const H323Channel & channel
01604 );
01605
01614 virtual BOOL OnClosingLogicalChannel(
01615 H323Channel & channel
01616 );
01617
01626 virtual void OnLogicalChannelFlowControl(
01627 H323Channel * channel,
01628 long bitRateRestriction
01629 );
01630
01639 virtual void OnLogicalChannelJitter(
01640 H323Channel * channel,
01641 DWORD jitter,
01642 int skippedFrameCount,
01643 int additionalBuffer
01644 );
01645
01648 void SendLogicalChannelMiscCommand(
01649 H323Channel & channel,
01650 unsigned command
01651 );
01652
01656 H323Channel * GetLogicalChannel(
01657 unsigned number,
01658 BOOL fromRemote
01659 ) const;
01660
01666 H323Channel * FindChannel(
01667 unsigned sessionId,
01668 BOOL fromRemote
01669 ) const;
01671
01678 unsigned GetBandwidthUsed() const;
01679
01685 BOOL UseBandwidth(
01686 unsigned bandwidth,
01687 BOOL removing
01688 );
01689
01692 unsigned GetBandwidthAvailable() const { return bandwidthAvailable; }
01693
01698 BOOL SetBandwidthAvailable(
01699 unsigned newBandwidth,
01700 BOOL force = FALSE
01701 );
01703
01706 enum SendUserInputModes {
01707 SendUserInputAsQ931,
01708 SendUserInputAsString,
01709 SendUserInputAsTone,
01710 SendUserInputAsInlineRFC2833,
01711 SendUserInputAsSeparateRFC2833,
01712 NumSendUserInputModes
01713 };
01714 #if PTRACING
01715 friend ostream & operator<<(ostream & o, SendUserInputModes m);
01716 #endif
01717
01720 void SetSendUserInputMode(SendUserInputModes mode);
01721
01724 SendUserInputModes GetSendUserInputMode() const { return sendUserInputMode; }
01725
01731 SendUserInputModes GetRealSendUserInputMode() const;
01732
01746 virtual void SendUserInput(
01747 const PString & value
01748 );
01749
01756 virtual void OnUserInputString(
01757 const PString & value
01758 );
01759
01784 virtual void SendUserInputTone(
01785 char tone,
01786 unsigned duration = 0,
01787 unsigned logicalChannel = 0,
01788 unsigned rtpTimestamp = 0
01789 );
01790
01795 virtual void OnUserInputTone(
01796 char tone,
01797 unsigned duration,
01798 unsigned logicalChannel,
01799 unsigned rtpTimestamp
01800 );
01801
01805 void SendUserInputHookFlash(
01806 int duration = 500
01807 ) { SendUserInputTone('!', duration); }
01808
01815 virtual void SendUserInputIndicationQ931(
01816 const PString & value
01817 );
01818
01825 virtual void SendUserInputIndicationString(
01826 const PString & value
01827 );
01828
01833 virtual void SendUserInputIndicationTone(
01834 char tone,
01835 unsigned duration = 0,
01836 unsigned logicalChannel = 0,
01837 unsigned rtpTimestamp = 0
01838 );
01839
01848 virtual void SendUserInputIndication(
01849 const H245_UserInputIndication & pdu
01850 );
01851
01856 virtual void OnUserInputIndication(
01857 const H245_UserInputIndication & pdu
01858 );
01860
01866 virtual RTP_Session * GetSession(
01867 unsigned sessionID
01868 ) const;
01869
01873 virtual H323_RTP_Session * GetSessionCallbacks(
01874 unsigned sessionID
01875 ) const;
01876
01886 virtual RTP_Session * UseSession(
01887 unsigned sessionID,
01888 const H245_TransportAddress & pdu,
01889 H323Channel::Directions dir,
01890 RTP_QOS * rtpqos = NULL
01891 );
01892
01896 virtual void ReleaseSession(
01897 unsigned sessionID
01898 );
01899
01907 virtual void OnRTPStatistics(
01908 const RTP_Session & session
01909 ) const;
01910
01914 virtual PString GetSessionCodecNames(
01915 unsigned sessionID
01916 ) const;
01917
01920 BOOL IsBehindNAT() const
01921 { return remoteIsNAT; }
01922
01924
01942 virtual BOOL RequestModeChange(
01943 const PString & newModes
01944 );
01945
01953 virtual BOOL RequestModeChange(
01954 const H245_ArrayOf_ModeDescription & newModes
01955 );
01956
01959 virtual BOOL OnRequestModeChange(
01960 const H245_RequestMode & pdu,
01961 H245_RequestModeAck & ack,
01962 H245_RequestModeReject & reject,
01963 PINDEX & selectedMode
01964 );
01965
01972 virtual void OnModeChanged(
01973 const H245_ModeDescription & newMode
01974 );
01975
01980 virtual void OnAcceptModeChange(
01981 const H245_RequestModeAck & pdu
01982 );
01983
01988 virtual void OnRefusedModeChange(
01989 const H245_RequestModeReject * pdu
01990 );
01992
02007 virtual OpalT120Protocol * CreateT120ProtocolHandler();
02008
02021 virtual OpalT38Protocol * CreateT38ProtocolHandler();
02022
02025 virtual BOOL RequestModeChangeT38(
02026 const char * capabilityNames = "T.38\nT38FaxUDP"
02027 );
02028
02038 virtual BOOL GetAdmissionRequestAuthentication(
02039 const H225_AdmissionRequest & arq,
02040 H235Authenticators & authenticators
02041 );
02043
02048 H323EndPoint & GetEndPoint() const { return endpoint; }
02049
02052 BOOL HadAnsweredCall() const { return callAnswered; }
02053
02056 BOOL IsGatekeeperRouted() const { return gatekeeperRouted; }
02057
02061 unsigned GetQ931Cause() const { return q931Cause; }
02062
02067 unsigned GetDistinctiveRing() const { return distinctiveRing; }
02068
02075 void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
02076
02079 const PString & GetCallToken() const { return callToken; }
02080
02083 unsigned GetCallReference() const { return callReference; }
02084
02087 const OpalGloballyUniqueID & GetCallIdentifier() const { return callIdentifier; }
02088
02091 const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
02092
02095 const PString & GetLocalPartyName() const { return localPartyName; }
02096
02099 void SetLocalPartyName(const PString & name);
02100
02103 void SetDisplayName(const PString & name) { localDisplayName = name; }
02104
02107 const PString GetDisplayName() const { return localDisplayName; }
02108
02109 const PStringList & GetLocalAliasNames() const { return localAliasNames; }
02110
02117 const PString & GetRemotePartyName() const { return remotePartyName; }
02118
02123 const PString & GetRemotePartyNumber() const { return remotePartyNumber; }
02124
02131 const PString & GetRemotePartyAddress() const { return remotePartyAddress; }
02132
02135 void SetRemotePartyInfo(
02136 const H323SignalPDU & pdu
02137 );
02138
02150 const PString & GetRemoteApplication() const { return remoteApplication; }
02151
02154 void SetRemoteApplication(
02155 const H225_EndpointType & pdu
02156 );
02157
02160 const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
02161
02164 const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
02165
02168 unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
02169
02172 const H323Transport * GetSignallingChannel() const { return signallingChannel; }
02173
02176 unsigned GetSignallingVersion() const { return h225version; }
02177
02180 const H323Transport & GetControlChannel() const;
02181
02184 unsigned GetControlVersion() const { return h245version; }
02185
02188 PTime GetSetupUpTime() const { return setupTime; }
02189
02192 PTime GetAlertingTime() const { return alertingTime; }
02193
02197 PTime GetConnectionStartTime() const { return connectedTime; }
02198
02201 PTime GetConnectionEndTime() const { return callEndTime; }
02202
02206 unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
02207
02211 unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
02212
02215 void SetAudioJitterDelay(
02216 unsigned minDelay,
02217 unsigned maxDelay
02218 );
02219
02222 unsigned GetUUIEsRequested() const { return uuiesRequested; }
02223
02226 void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
02227
02230 const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
02231
02234 void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
02235
02238 const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
02239
02242 void SetDestExtraCallInfo(
02243 const PString & info
02244 ) { destExtraCallInfo = info; }
02245
02248 void SetRemotCallWaiting(const unsigned value) { remoteCallWaiting = value; }
02249
02255 const int GetRemoteCallWaiting() const { return remoteCallWaiting; }
02256
02261 void SetEnforcedDurationLimit(
02262 unsigned seconds
02263 );
02265
02266 virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02267
02268 virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02269
02270 protected:
02276 virtual void InternalEstablishedConnectionCheck();
02277 BOOL InternalEndSessionCheck(PPER_Stream & strm);
02278 void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02279 void MonitorCallStatus();
02280 PDECLARE_NOTIFIER(OpalRFC2833Info, H323Connection, OnUserInputInlineRFC2833);
02281 PDECLARE_NOTIFIER(H323Codec::FilterInfo, H323Connection, OnUserInputInBandDTMF);
02282
02283 H323EndPoint & endpoint;
02284 PSyncPoint * endSync;
02285
02286 int remoteCallWaiting;
02287 BOOL callAnswered;
02288 BOOL gatekeeperRouted;
02289 unsigned distinctiveRing;
02290 PString callToken;
02291 unsigned callReference;
02292 OpalGloballyUniqueID callIdentifier;
02293 OpalGloballyUniqueID conferenceIdentifier;
02294
02295 PStringList localAliasNames;
02296 PString localPartyName;
02297 PString localDisplayName;
02298 H323Capabilities localCapabilities;
02299 PString remotePartyName;
02300 PString remotePartyNumber;
02301 PString remotePartyAddress;
02302 PString destExtraCallInfo;
02303 PString remoteApplication;
02304 H323Capabilities remoteCapabilities;
02305 unsigned remoteMaxAudioDelayJitter;
02306 PTimer roundTripDelayTimer;
02307 unsigned minAudioJitterDelay;
02308 unsigned maxAudioJitterDelay;
02309 unsigned bandwidthAvailable;
02310 unsigned uuiesRequested;
02311 PString gkAccessTokenOID;
02312 PBYTEArray gkAccessTokenData;
02313 BOOL addAccessTokenToSetup;
02314 SendUserInputModes sendUserInputMode;
02315
02316 H323Transport * signallingChannel;
02317 H323Transport * controlChannel;
02318 BOOL h245Tunneling;
02319 H323SignalPDU * h245TunnelRxPDU;
02320 H323SignalPDU * h245TunnelTxPDU;
02321 H323SignalPDU * alertingPDU;
02322 H323SignalPDU * connectPDU;
02323
02324 enum ConnectionStates {
02325 NoConnectionActive,
02326 AwaitingGatekeeperAdmission,
02327 AwaitingTransportConnect,
02328 AwaitingSignalConnect,
02329 AwaitingLocalAnswer,
02330 HasExecutedSignalConnect,
02331 EstablishedConnection,
02332 ShuttingDownConnection,
02333 NumConnectionStates
02334 } connectionState;
02335
02336 PTime setupTime;
02337 PTime alertingTime;
02338 PTime connectedTime;
02339 PTime callEndTime;
02340 CallEndReason callEndReason;
02341 unsigned q931Cause;
02342
02343 unsigned h225version;
02344 unsigned h245version;
02345 BOOL h245versionSet;
02346 BOOL doH245inSETUP;
02347 BOOL lastPDUWasH245inSETUP;
02348 BOOL detectInBandDTMF;
02349 BOOL mustSendDRQ;
02350 BOOL mediaWaitForConnect;
02351 BOOL transmitterSidePaused;
02352 BOOL earlyStart;
02353 BOOL startT120;
02354 PString t38ModeChangeCapabilities;
02355 PSyncPoint digitsWaitFlag;
02356 BOOL endSessionNeeded;
02357 BOOL endSessionSent;
02358 PSyncPoint endSessionReceived;
02359 PTimer enforcedDurationLimit;
02360
02361
02362 PChannel * holdMediaChannel;
02363 BOOL isConsultationTransfer;
02364
02366 BOOL isCallIntrusion;
02367 unsigned callIntrusionProtectionLevel;
02368
02369 RTP_SessionManager rtpSessions;
02370
02371 enum FastStartStates {
02372 FastStartDisabled,
02373 FastStartInitiate,
02374 FastStartResponse,
02375 FastStartAcknowledged,
02376 NumFastStartStates
02377 };
02378 FastStartStates fastStartState;
02379 H323LogicalChannelList fastStartChannels;
02380
02381 #if PTRACING
02382 static const char * const ConnectionStatesNames[NumConnectionStates];
02383 friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << ConnectionStatesNames[s]; }
02384 static const char * const FastStartStateNames[NumFastStartStates];
02385 friend ostream & operator<<(ostream & o, FastStartStates s) { return o << FastStartStateNames[s]; }
02386 #endif
02387
02388
02389
02390
02391 H245NegMasterSlaveDetermination * masterSlaveDeterminationProcedure;
02392 H245NegTerminalCapabilitySet * capabilityExchangeProcedure;
02393 H245NegLogicalChannels * logicalChannels;
02394 H245NegRequestMode * requestModeProcedure;
02395 H245NegRoundTripDelay * roundTripDelayProcedure;
02396 H450xDispatcher * h450dispatcher;
02397 H4502Handler * h4502handler;
02398 H4504Handler * h4504handler;
02399 H4506Handler * h4506handler;
02400 H45011Handler * h45011handler;
02401 OpalRFC2833 * rfc2833handler;
02402 OpalT120Protocol * t120handler;
02403 OpalT38Protocol * t38handler;
02404
02405
02406
02407
02408 PDTMFDecoder dtmfDecoder;
02409
02410
02411 BOOL remoteIsNAT;
02412
02413 private:
02414 PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02415
02416 PMutex outerMutex;
02417 PMutex innerMutex;
02418 };
02419
02420
02421 PLIST(H323ConnectionList, H323Connection);
02422 PDICTIONARY(H323ConnectionDict, PString, H323Connection);
02423 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02424
02425
02426 #endif // __OPAL_H323CON_H
02427
02428