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
#ifndef __OPAL_H323CON_H
00283
#define __OPAL_H323CON_H
00284
00285
#ifdef P_USE_PRAGMA
00286
#pragma interface
00287
#endif
00288
00289
00290
#include <ptclib/dtmf.h>
00291
#include "h323caps.h"
00292
#include "transports.h"
00293
#include "channels.h"
00294
#include "guid.h"
00295
#include "openh323buildopts.h"
00296
00297
00298
00299
00300
00301
00302
00303
class PPER_Stream;
00304
00305
class H225_EndpointType;
00306
class H225_TransportAddress;
00307
class H225_ArrayOf_PASN_OctetString;
00308
class H225_ProtocolIdentifier;
00309
class H225_AdmissionRequest;
00310
00311
class H245_TerminalCapabilitySet;
00312
class H245_TerminalCapabilitySetReject;
00313
class H245_OpenLogicalChannel;
00314
class H245_OpenLogicalChannelAck;
00315
class H245_TransportAddress;
00316
class H245_UserInputIndication;
00317
class H245_RequestMode;
00318
class H245_RequestModeAck;
00319
class H245_RequestModeReject;
00320
class H245_ModeDescription;
00321
class H245_ArrayOf_ModeDescription;
00322
class H245_SendTerminalCapabilitySet;
00323
class H245_MultiplexCapability;
00324
class H245_FlowControlCommand;
00325
class H245_MiscellaneousCommand;
00326
class H245_MiscellaneousIndication;
00327
class H245_JitterIndication;
00328
00329
class H323SignalPDU;
00330
class H323ControlPDU;
00331
00332
class H235Authenticators;
00333
00334
class H245NegMasterSlaveDetermination;
00335
class H245NegTerminalCapabilitySet;
00336
class H245NegLogicalChannels;
00337
class H245NegRequestMode;
00338
class H245NegRoundTripDelay;
00339
00340
class H450xDispatcher;
00341
class H4502Handler;
00342
class H4504Handler;
00343
class H4506Handler;
00344
class H45011Handler;
00345
00346
class OpalT120Protocol;
00347
class OpalT38Protocol;
00348
class OpalRFC2833;
00349
class OpalRFC2833Info;
00350
00351
00352
00354
00361 class H323Connection :
public PObject
00362 {
00363 PCLASSINFO(
H323Connection, PObject);
00364
00365
public:
00368 enum Options {
00369
FastStartOptionDisable = 0x0001,
00370
FastStartOptionEnable = 0x0002,
00371
FastStartOptionMask = 0x0003,
00372
00373
H245TunnelingOptionDisable = 0x0004,
00374
H245TunnelingOptionEnable = 0x0008,
00375
H245TunnelingOptionMask = 0x000c,
00376
00377
H245inSetupOptionDisable = 0x0010,
00378
H245inSetupOptionEnable = 0x0020,
00379
H245inSetupOptionMask = 0x0030,
00380
00381
DetectInBandDTMFOptionDisable= 0x0040,
00382
DetectInBandDTMFOptionEnable = 0x0080,
00383
DetectInBandDTMFOptionMask = 0x00c0,
00384 };
00385
00388
H323Connection(
00389
H323EndPoint & endpoint,
00390
unsigned callReference,
00391
unsigned options = 0
00392 );
00393
00396
~H323Connection();
00397
00407 BOOL
Lock();
00408
00420
int TryLock();
00421
00427
void Unlock();
00428
00435
virtual void OnSendARQ(
00436
H225_AdmissionRequest & arq
00437 );
00438
00442
virtual void OnEstablished();
00443
00447
virtual void OnCleared();
00448
00455 BOOL
IsConnected()
const {
return connectionState ==
HasExecutedSignalConnect ||
connectionState ==
EstablishedConnection; }
00456
00462 BOOL
IsEstablished()
const {
return connectionState ==
EstablishedConnection; }
00463
00468 enum CallEndReason {
00469
EndedByLocalUser,
00470
EndedByNoAccept,
00471
EndedByAnswerDenied,
00472
EndedByRemoteUser,
00473
EndedByRefusal,
00474
EndedByNoAnswer,
00475
EndedByCallerAbort,
00476
EndedByTransportFail,
00477
EndedByConnectFail,
00478
EndedByGatekeeper,
00479
EndedByNoUser,
00480
EndedByNoBandwidth,
00481
EndedByCapabilityExchange,
00482
EndedByCallForwarded,
00483
EndedBySecurityDenial,
00484
EndedByLocalBusy,
00485
EndedByLocalCongestion,
00486
EndedByRemoteBusy,
00487
EndedByRemoteCongestion,
00488
EndedByUnreachable,
00489
EndedByNoEndPoint,
00490
EndedByHostOffline,
00491
EndedByTemporaryFailure,
00492
EndedByQ931Cause,
00493
EndedByDurationLimit,
00494
EndedByInvalidConferenceID,
00495
NumCallEndReasons
00496 };
00497
#if PTRACING
00498
friend ostream & operator<<(ostream & o, CallEndReason r);
00499
#endif
00500
00509 CallEndReason GetCallEndReason()
const {
return callEndReason; }
00510
00515
virtual void SetCallEndReason(
00516 CallEndReason reason,
00517 PSyncPoint * sync = NULL
00518 );
00519
00525
virtual BOOL ClearCall(
00526 CallEndReason reason = EndedByLocalUser
00527 );
00528
00531
virtual BOOL ClearCallSynchronous(
00532 PSyncPoint * sync,
00533 CallEndReason reason = EndedByLocalUser
00534 );
00535
00544
virtual void CleanUpOnCallEnd();
00546
00547
00552
void AttachSignalChannel(
00553
const PString & token,
00554
H323Transport * channel,
00555 BOOL answeringCall
00556 );
00557
00560 BOOL WriteSignalPDU(
00561
H323SignalPDU & pdu
00562 );
00563
00567
virtual void HandleSignallingChannel();
00568
00572
virtual BOOL HandleSignalPDU(
00573
H323SignalPDU & pdu
00574 );
00575
00579
virtual void HandleTunnelPDU(
00580
H323SignalPDU * txPDU
00581 );
00582
00590
virtual BOOL OnReceivedSignalSetup(
00591
const H323SignalPDU & pdu
00592 );
00593
00600
virtual BOOL OnReceivedSignalSetupAck(
00601
const H323SignalPDU & pdu
00602 );
00603
00610
virtual BOOL OnReceivedSignalInformation(
00611
const H323SignalPDU & pdu
00612 );
00613
00622
virtual BOOL OnReceivedCallProceeding(
00623
const H323SignalPDU & pdu
00624 );
00625
00634
virtual BOOL OnReceivedProgress(
00635
const H323SignalPDU & pdu
00636 );
00637
00644
virtual BOOL OnReceivedAlerting(
00645
const H323SignalPDU & pdu
00646 );
00647
00656
virtual BOOL OnReceivedSignalConnect(
00657
const H323SignalPDU & pdu
00658 );
00659
00668
virtual BOOL OnReceivedFacility(
00669
const H323SignalPDU & pdu
00670 );
00671
00678
virtual BOOL OnReceivedSignalNotify(
00679
const H323SignalPDU & pdu
00680 );
00681
00688
virtual BOOL OnReceivedSignalStatus(
00689
const H323SignalPDU & pdu
00690 );
00691
00698
virtual BOOL OnReceivedStatusEnquiry(
00699
const H323SignalPDU & pdu
00700 );
00701
00706
virtual void OnReceivedReleaseComplete(
00707
const H323SignalPDU & pdu
00708 );
00709
00716
virtual BOOL OnUnknownSignalPDU(
00717
const H323SignalPDU & pdu
00718 );
00719
00731
virtual BOOL OnIncomingCall(
00732
const H323SignalPDU & setupPDU,
00733
H323SignalPDU & alertingPDU
00734 );
00735
00745
virtual BOOL ForwardCall(
00746
const PString & forwardParty
00747 );
00748
00753
void TransferCall(
00754
const PString & remoteParty,
00755
const PString & callIdentity = PString::Empty()
00757 );
00758
00763
void ConsultationTransfer(
00764
const PString & primaryCallToken
00765 );
00766
00773
virtual void HandleConsultationTransfer(
00774
const PString & callIdentity,
00776
H323Connection & incoming
00777 );
00778
00781 BOOL
IsTransferringCall() const;
00782
00785 BOOL IsTransferredCall() const;
00786
00791 virtual
void HandleTransferCall(
00792 const PString & token,
00793 const PString & identity
00794 );
00795
00800
int GetCallTransferInvokeId();
00801
00809 virtual
void HandleCallTransferFailure(
00810 const
int returnError
00811 );
00812
00817
void SetAssociatedCallToken(
00818 const PString & token
00819 );
00820
00825 virtual
void OnConsultationTransferSuccess(
00826
H323Connection & secondaryCall
00827 );
00828
00833
void HoldCall(
00834 BOOL localHold
00835 );
00836
00842
void RetrieveCall();
00843
00850
void SetHoldMedia(
00851 PChannel * audioChannel
00852 );
00853
00856 BOOL IsMediaOnHold() const;
00857
00860 BOOL IsLocalHold() const;
00861
00864 BOOL IsRemoteHold() const;
00865
00868 BOOL IsCallOnHold() const;
00869
00874 virtual
void IntrudeCall(
00875
unsigned capabilityLevel
00876 );
00877
00882 virtual
void HandleIntrudeCall(
00883 const PString & token,
00884 const PString & identity
00885 );
00886
00892 void SetCallIntrusion() {
isCallIntrusion = TRUE; }
00893
00894 BOOL
IsCallIntrusion() {
return isCallIntrusion; }
00895
00898 unsigned GetLocalCallIntrusionProtectionLevel() {
return callIntrusionProtectionLevel; }
00899
00903
virtual BOOL GetRemoteCallIntrusionProtectionLevel(
00904
const PString & callToken,
00905
unsigned callIntrusionProtectionLevel
00906 );
00907
00908
virtual void SetIntrusionImpending();
00909
00910
virtual void SetForcedReleaseAccepted();
00911
00912
virtual void SetIntrusionNotAuthorized();
00913
00920
void SendCallWaitingIndication(
00921
const unsigned nbOfAddWaitingCalls = 0
00922 );
00923
00924 enum AnswerCallResponse {
00925
AnswerCallNow,
00926
AnswerCallDenied,
00927
AnswerCallPending,
00928
AnswerCallDeferred,
00929
AnswerCallAlertWithMedia,
00930
AnswerCallDeferredWithMedia,
00931
AnswerCallDeniedByInvalidCID,
00932
NumAnswerCallResponses
00933 };
00934
#if PTRACING
00935
friend ostream & operator<<(ostream & o, AnswerCallResponse s);
00936
#endif
00937
00964
virtual AnswerCallResponse OnAnswerCall(
00965
const PString & callerName,
00966
const H323SignalPDU & setupPDU,
00967
H323SignalPDU & connectPDU
00968 );
00969
00980
void AnsweringCall(
00981 AnswerCallResponse response
00982 );
00983
00994
virtual CallEndReason SendSignalSetup(
00995
const PString & alias,
00996
const H323TransportAddress & address
00997 );
00998
01010
virtual BOOL OnSendSignalSetup(
01011
H323SignalPDU & setupPDU
01012 );
01013
01022
virtual BOOL OnSendCallProceeding(
01023
H323SignalPDU & callProceedingPDU
01024 );
01025
01037
virtual BOOL OnSendReleaseComplete(
01038
H323SignalPDU & releaseCompletePDU
01039 );
01040
01051
virtual BOOL OnAlerting(
01052
const H323SignalPDU & alertingPDU,
01053
const PString & user
01054 );
01055
01070
virtual BOOL
OnInsufficientDigits();
01071
01084
virtual void SendMoreDigits(
01085
const PString & digits
01086 );
01087
01097
virtual BOOL OnOutgoingCall(
01098
const H323SignalPDU & connectPDU
01099 );
01100
01112
virtual BOOL SendFastStartAcknowledge(
01113
H225_ArrayOf_PASN_OctetString & array
01114 );
01115
01127
virtual BOOL HandleFastStartAcknowledge(
01128
const H225_ArrayOf_PASN_OctetString & array
01129 );
01130
01138
virtual BOOL
StartControlChannel();
01139
01151
virtual BOOL
StartControlChannel(
01152
const H225_TransportAddress & h245Address
01153 );
01155
01162 BOOL WriteControlPDU(
01163
const H323ControlPDU & pdu
01164 );
01165
01168
virtual BOOL
StartControlNegotiations();
01169
01172
virtual void HandleControlChannel();
01173
01180
virtual BOOL HandleControlData(
01181 PPER_Stream & strm
01182 );
01183
01190
virtual BOOL HandleControlPDU(
01191
const H323ControlPDU & pdu
01192 );
01193
01203
virtual BOOL OnUnknownControlPDU(
01204
const H323ControlPDU & pdu
01205 );
01206
01210
virtual BOOL OnH245Request(
01211
const H323ControlPDU & pdu
01212 );
01213
01217
virtual BOOL OnH245Response(
01218
const H323ControlPDU & pdu
01219 );
01220
01224
virtual BOOL OnH245Command(
01225
const H323ControlPDU & pdu
01226 );
01227
01231
virtual BOOL OnH245Indication(
01232
const H323ControlPDU & pdu
01233 );
01234
01237
virtual BOOL OnH245_SendTerminalCapabilitySet(
01238
const H245_SendTerminalCapabilitySet & pdu
01239 );
01240
01245
virtual BOOL OnH245_FlowControlCommand(
01246
const H245_FlowControlCommand & pdu
01247 );
01248
01253
virtual BOOL OnH245_MiscellaneousCommand(
01254
const H245_MiscellaneousCommand & pdu
01255 );
01256
01261
virtual BOOL OnH245_MiscellaneousIndication(
01262
const H245_MiscellaneousIndication & pdu
01263 );
01264
01269
virtual BOOL OnH245_JitterIndication(
01270
const H245_JitterIndication & pdu
01271 );
01272
01275 enum ControlProtocolErrors {
01276
e_MasterSlaveDetermination,
01277
e_CapabilityExchange,
01278
e_LogicalChannel,
01279
e_ModeRequest,
01280
e_RoundTripDelay
01281 };
01282
01294
virtual BOOL OnControlProtocolError(
01295 ControlProtocolErrors errorSource,
01296
const void * errorData = NULL
01297 );
01298
01306
virtual void OnSendCapabilitySet(
01307
H245_TerminalCapabilitySet & pdu
01308 );
01309
01321
virtual BOOL OnReceivedCapabilitySet(
01322
const H323Capabilities & remoteCaps,
01323
const H245_MultiplexCapability * muxCap,
01324
H245_TerminalCapabilitySetReject & reject
01325 );
01326
01329
virtual void SendCapabilitySet(
01330 BOOL empty
01331 );
01332
01341
virtual void OnSetLocalCapabilities();
01342
01345 BOOL
IsH245Master() const;
01346
01349
void StartRoundTripDelay();
01350
01353 PTimeInterval GetRoundTripDelay() const;
01355
01395 virtual
void OnSelectLogicalChannels();
01396
01399 virtual
void SelectDefaultLogicalChannel(
01400
unsigned sessionID
01401 );
01402
01406 virtual
void SelectFastStartChannels(
01407
unsigned sessionID,
01408 BOOL transmitter,
01409 BOOL receiver
01410 );
01411
01426 virtual BOOL OpenLogicalChannel(
01427 const
H323Capability & capability,
01428
unsigned sessionID,
01429
H323Channel::Directions dir
01430 );
01431
01441 virtual BOOL OnOpenLogicalChannel(
01442 const
H245_OpenLogicalChannel & openPDU,
01443
H245_OpenLogicalChannelAck & ackPDU,
01444
unsigned & errorCode
01445 );
01446
01454 virtual BOOL OnConflictingLogicalChannel(
01455
H323Channel & channel
01456 );
01457
01462 virtual
H323Channel * CreateLogicalChannel(
01463 const
H245_OpenLogicalChannel & open,
01464 BOOL startingFast,
01465
unsigned & errorCode
01466 );
01467
01502 virtual
H323Channel * CreateRealTimeLogicalChannel(
01503 const
H323Capability & capability,
01504
H323Channel::Directions dir,
01505
unsigned sessionID,
01506 const
H245_H2250LogicalChannelParameters * param,
01508 RTP_QOS * rtpqos = NULL
01509 );
01510
01521 virtual BOOL OnCreateLogicalChannel(
01522 const
H323Capability & capability,
01523
H323Channel::Directions dir,
01524
unsigned & errorCode
01525 );
01526
01531 virtual BOOL OnStartLogicalChannel(
01532
H323Channel & channel
01533 );
01534
01541 virtual BOOL OpenAudioChannel(
01542 BOOL isEncoding,
01543
unsigned bufferSize,
01544
H323AudioCodec & codec
01545 );
01546
01547 #ifndef NO_H323_VIDEO
01554 virtual BOOL OpenVideoChannel(
01555 BOOL isEncoding,
01556
H323VideoCodec & codec
01557 );
01558 #endif
01559
01562 virtual
void CloseLogicalChannel(
01563
unsigned number,
01564 BOOL fromRemote
01565 );
01566
01569 virtual
void CloseLogicalChannelNumber(
01570 const
H323ChannelNumber & number
01571 );
01572
01575 virtual
void CloseAllLogicalChannels(
01576 BOOL fromRemote
01577 );
01578
01584 virtual
void OnClosedLogicalChannel(
01585 const
H323Channel & channel
01586 );
01587
01596 virtual BOOL OnClosingLogicalChannel(
01597
H323Channel & channel
01598 );
01599
01608 virtual
void OnLogicalChannelFlowControl(
01609
H323Channel * channel,
01610
long bitRateRestriction
01611 );
01612
01621 virtual
void OnLogicalChannelJitter(
01622
H323Channel * channel,
01623 DWORD jitter,
01624
int skippedFrameCount,
01625
int additionalBuffer
01626 );
01627
01630
void SendLogicalChannelMiscCommand(
01631
H323Channel & channel,
01632
unsigned command
01633 );
01634
01638
H323Channel * GetLogicalChannel(
01639
unsigned number,
01640 BOOL fromRemote
01641 ) const;
01642
01648
H323Channel * FindChannel(
01649
unsigned sessionId,
01650 BOOL fromRemote
01651 ) const;
01653
01660
unsigned GetBandwidthUsed() const;
01661
01667 BOOL UseBandwidth(
01668
unsigned bandwidth,
01669 BOOL removing
01670 );
01671
01674 unsigned GetBandwidthAvailable()
const {
return bandwidthAvailable; }
01675
01680 BOOL SetBandwidthAvailable(
01681
unsigned newBandwidth,
01682 BOOL force = FALSE
01683 );
01685
01688 enum SendUserInputModes {
01689
SendUserInputAsQ931,
01690
SendUserInputAsString,
01691
SendUserInputAsTone,
01692
SendUserInputAsInlineRFC2833,
01693
SendUserInputAsSeparateRFC2833,
01694
NumSendUserInputModes
01695 };
01696
#if PTRACING
01697
friend ostream & operator<<(ostream & o, SendUserInputModes m);
01698
#endif
01699
01702
void SetSendUserInputMode(SendUserInputModes mode);
01703
01706 SendUserInputModes GetSendUserInputMode()
const {
return sendUserInputMode; }
01707
01713 SendUserInputModes
GetRealSendUserInputMode() const;
01714
01728 virtual
void SendUserInput(
01729 const PString & value
01730 );
01731
01738 virtual
void OnUserInputString(
01739 const PString & value
01740 );
01741
01766 virtual
void SendUserInputTone(
01767
char tone,
01768
unsigned duration = 0,
01769
unsigned logicalChannel = 0,
01770
unsigned rtpTimestamp = 0
01771 );
01772
01777 virtual
void OnUserInputTone(
01778
char tone,
01779
unsigned duration,
01780
unsigned logicalChannel,
01781
unsigned rtpTimestamp
01782 );
01783
01787 void SendUserInputHookFlash(
01788
int duration = 500
01789 ) {
SendUserInputTone(
'!', duration); }
01790
01797
virtual void SendUserInputIndicationQ931(
01798
const PString & value
01799 );
01800
01807
virtual void SendUserInputIndicationString(
01808
const PString & value
01809 );
01810
01815
virtual void SendUserInputIndicationTone(
01816
char tone,
01817
unsigned duration = 0,
01818
unsigned logicalChannel = 0,
01819
unsigned rtpTimestamp = 0
01820 );
01821
01830
virtual void SendUserInputIndication(
01831
const H245_UserInputIndication & pdu
01832 );
01833
01838
virtual void OnUserInputIndication(
01839
const H245_UserInputIndication & pdu
01840 );
01842
01848
virtual RTP_Session * GetSession(
01849
unsigned sessionID
01850 )
const;
01851
01855
virtual H323_RTP_Session * GetSessionCallbacks(
01856
unsigned sessionID
01857 )
const;
01858
01868
virtual RTP_Session * UseSession(
01869
unsigned sessionID,
01870
const H245_TransportAddress & pdu,
01871 H323Channel::Directions dir,
01872 RTP_QOS * rtpqos = NULL
01873 );
01874
01878
virtual void ReleaseSession(
01879
unsigned sessionID
01880 );
01881
01889
virtual void OnRTPStatistics(
01890
const RTP_Session & session
01891 )
const;
01892
01896
virtual PString GetSessionCodecNames(
01897
unsigned sessionID
01898 )
const;
01899
01902 BOOL
IsBehindNAT()
const
01903
{
return remoteIsNAT; }
01904
01906
01924
virtual BOOL RequestModeChange(
01925
const PString & newModes
01926 );
01927
01935
virtual BOOL RequestModeChange(
01936
const H245_ArrayOf_ModeDescription & newModes
01937 );
01938
01941
virtual BOOL OnRequestModeChange(
01942
const H245_RequestMode & pdu,
01943
H245_RequestModeAck & ack,
01944
H245_RequestModeReject & reject,
01945 PINDEX & selectedMode
01946 );
01947
01954
virtual void OnModeChanged(
01955
const H245_ModeDescription & newMode
01956 );
01957
01962
virtual void OnAcceptModeChange(
01963
const H245_RequestModeAck & pdu
01964 );
01965
01970
virtual void OnRefusedModeChange(
01971
const H245_RequestModeReject * pdu
01972 );
01974
01989
virtual OpalT120Protocol *
CreateT120ProtocolHandler();
01990
02003
virtual OpalT38Protocol *
CreateT38ProtocolHandler();
02004
02007
virtual BOOL RequestModeChangeT38(
02008
const char * capabilityNames =
"T.38\nT38FaxUDP"
02009 );
02010
02020
virtual BOOL GetAdmissionRequestAuthentication(
02021
const H225_AdmissionRequest & arq,
02022 H235Authenticators & authenticators
02023 );
02025
02030 H323EndPoint &
GetEndPoint()
const {
return endpoint; }
02031
02034 BOOL
HadAnsweredCall()
const {
return callAnswered; }
02035
02038 BOOL
IsGatekeeperRouted()
const {
return gatekeeperRouted; }
02039
02043 unsigned GetQ931Cause()
const {
return q931Cause; }
02044
02049 unsigned GetDistinctiveRing()
const {
return distinctiveRing; }
02050
02057 void SetDistinctiveRing(
unsigned pattern) {
distinctiveRing = pattern&7; }
02058
02061 const PString &
GetCallToken()
const {
return callToken; }
02062
02065 unsigned GetCallReference()
const {
return callReference; }
02066
02069 const OpalGloballyUniqueID &
GetCallIdentifier()
const {
return callIdentifier; }
02070
02073 const OpalGloballyUniqueID &
GetConferenceIdentifier()
const {
return conferenceIdentifier; }
02074
02077 const PString &
GetLocalPartyName()
const {
return localPartyName; }
02078
02081
void SetLocalPartyName(
const PString & name);
02082
02085 void SetDisplayName(
const PString & name) {
localDisplayName = name; }
02086
02089 const PString
GetDisplayName()
const {
return localDisplayName; }
02090
02091 const PStringList &
GetLocalAliasNames()
const {
return localAliasNames; }
02092
02099 const PString &
GetRemotePartyName()
const {
return remotePartyName; }
02100
02105 const PString &
GetRemotePartyNumber()
const {
return remotePartyNumber; }
02106
02113 const PString &
GetRemotePartyAddress()
const {
return remotePartyAddress; }
02114
02117
void SetRemotePartyInfo(
02118
const H323SignalPDU & pdu
02119 );
02120
02132 const PString &
GetRemoteApplication()
const {
return remoteApplication; }
02133
02136
void SetRemoteApplication(
02137
const H225_EndpointType & pdu
02138 );
02139
02142 const H323Capabilities &
GetLocalCapabilities()
const {
return localCapabilities; }
02143
02146 const H323Capabilities &
GetRemoteCapabilities()
const {
return remoteCapabilities; }
02147
02150 unsigned GetRemoteMaxAudioDelayJitter()
const {
return remoteMaxAudioDelayJitter; }
02151
02154 const H323Transport *
GetSignallingChannel()
const {
return signallingChannel; }
02155
02158 unsigned GetSignallingVersion()
const {
return h225version; }
02159
02162
const H323Transport &
GetControlChannel() const;
02163
02166 unsigned GetControlVersion()
const {
return h245version; }
02167
02170 PTime
GetSetupUpTime()
const {
return setupTime; }
02171
02174 PTime
GetAlertingTime()
const {
return alertingTime; }
02175
02179 PTime
GetConnectionStartTime()
const {
return connectedTime; }
02180
02183 PTime
GetConnectionEndTime()
const {
return callEndTime; }
02184
02188 unsigned GetMinAudioJitterDelay()
const {
return minAudioJitterDelay; }
02189
02193 unsigned GetMaxAudioJitterDelay()
const {
return maxAudioJitterDelay; }
02194
02197
void SetAudioJitterDelay(
02198
unsigned minDelay,
02199
unsigned maxDelay
02200 );
02201
02204 unsigned GetUUIEsRequested()
const {
return uuiesRequested; }
02205
02208 void SetUUIEsRequested(
unsigned mask) {
uuiesRequested = mask; }
02209
02212 const PString
GetGkAccessTokenOID()
const {
return gkAccessTokenOID; }
02213
02216 void SetGkAccessTokenOID(
const PString & oid) {
gkAccessTokenOID = oid; }
02217
02220 const PBYTEArray &
GetGkAccessTokenData()
const {
return gkAccessTokenData; }
02221
02224 void SetDestExtraCallInfo(
02225
const PString & info
02226 ) {
destExtraCallInfo = info; }
02227
02230 void SetRemotCallWaiting(
const unsigned value) {
remoteCallWaiting = value; }
02231
02237 const int GetRemoteCallWaiting()
const {
return remoteCallWaiting; }
02238
02243
void SetEnforcedDurationLimit(
02244
unsigned seconds
02245 );
02247
02248
02249
protected:
02255
virtual void InternalEstablishedConnectionCheck();
02256 BOOL InternalEndSessionCheck(PPER_Stream & strm);
02257
void SetRemoteVersions(
const H225_ProtocolIdentifier &
id);
02258
void MonitorCallStatus();
02259 PDECLARE_NOTIFIER(
OpalRFC2833Info,
H323Connection, OnUserInputInlineRFC2833);
02260 PDECLARE_NOTIFIER(
H323Codec::FilterInfo,
H323Connection, OnUserInputInBandDTMF);
02261
02262 H323EndPoint &
endpoint;
02263 PSyncPoint *
endSync;
02264
02265 int remoteCallWaiting;
02266 BOOL
callAnswered;
02267 BOOL
gatekeeperRouted;
02268 unsigned distinctiveRing;
02269 PString
callToken;
02270 unsigned callReference;
02271 OpalGloballyUniqueID callIdentifier;
02272 OpalGloballyUniqueID conferenceIdentifier;
02273
02274 PStringList
localAliasNames;
02275 PString
localPartyName;
02276 PString
localDisplayName;
02277 H323Capabilities localCapabilities;
02278 PString
remotePartyName;
02279 PString
remotePartyNumber;
02280 PString
remotePartyAddress;
02281 PString
destExtraCallInfo;
02282 PString
remoteApplication;
02283 H323Capabilities remoteCapabilities;
02284 unsigned remoteMaxAudioDelayJitter;
02285 PTimer
roundTripDelayTimer;
02286 unsigned minAudioJitterDelay;
02287 unsigned maxAudioJitterDelay;
02288 unsigned bandwidthAvailable;
02289 unsigned uuiesRequested;
02290 PString
gkAccessTokenOID;
02291 PBYTEArray
gkAccessTokenData;
02292 BOOL
addAccessTokenToSetup;
02293 SendUserInputModes sendUserInputMode;
02294
02295 H323Transport *
signallingChannel;
02296 H323Transport *
controlChannel;
02297 BOOL
h245Tunneling;
02298 H323SignalPDU *
h245TunnelRxPDU;
02299 H323SignalPDU *
h245TunnelTxPDU;
02300 H323SignalPDU *
alertingPDU;
02301 H323SignalPDU *
connectPDU;
02302
02303 enum ConnectionStates {
02304
NoConnectionActive,
02305
AwaitingGatekeeperAdmission,
02306
AwaitingTransportConnect,
02307
AwaitingSignalConnect,
02308
AwaitingLocalAnswer,
02309
HasExecutedSignalConnect,
02310
EstablishedConnection,
02311
ShuttingDownConnection,
02312
NumConnectionStates
02313 } connectionState;
02314
02315 PTime
setupTime;
02316 PTime
alertingTime;
02317 PTime
connectedTime;
02318 PTime
callEndTime;
02319 CallEndReason callEndReason;
02320 unsigned q931Cause;
02321
02322 unsigned h225version;
02323 unsigned h245version;
02324 BOOL
h245versionSet;
02325 BOOL
doH245inSETUP;
02326 BOOL
lastPDUWasH245inSETUP;
02327 BOOL
detectInBandDTMF;
02328 BOOL
mustSendDRQ;
02329 BOOL
mediaWaitForConnect;
02330 BOOL
transmitterSidePaused;
02331 BOOL
earlyStart;
02332 BOOL
startT120;
02333 PString
t38ModeChangeCapabilities;
02334 PSyncPoint
digitsWaitFlag;
02335 BOOL
endSessionNeeded;
02336 BOOL
endSessionSent;
02337 PSyncPoint
endSessionReceived;
02338 PTimer
enforcedDurationLimit;
02339
02340
02341 PChannel *
holdMediaChannel;
02342 BOOL
isConsultationTransfer;
02343
02345 BOOL
isCallIntrusion;
02346 unsigned callIntrusionProtectionLevel;
02347
02348 RTP_SessionManager rtpSessions;
02349
02350 enum FastStartStates {
02351
FastStartDisabled,
02352
FastStartInitiate,
02353
FastStartResponse,
02354
FastStartAcknowledged,
02355
NumFastStartStates
02356 };
02357 FastStartStates fastStartState;
02358 H323LogicalChannelList
fastStartChannels;
02359
02360
#if PTRACING
02361
static const char *
const ConnectionStatesNames[
NumConnectionStates];
02362
friend ostream & operator<<(ostream & o, ConnectionStates s) {
return o << ConnectionStatesNames[s]; }
02363
static const char *
const FastStartStateNames[NumFastStartStates];
02364
friend ostream & operator<<(ostream & o, FastStartStates s) {
return o << FastStartStateNames[s]; }
02365
#endif
02366
02367
02368
02369
02370 H245NegMasterSlaveDetermination *
masterSlaveDeterminationProcedure;
02371 H245NegTerminalCapabilitySet *
capabilityExchangeProcedure;
02372 H245NegLogicalChannels *
logicalChannels;
02373 H245NegRequestMode *
requestModeProcedure;
02374 H245NegRoundTripDelay *
roundTripDelayProcedure;
02375 H450xDispatcher *
h450dispatcher;
02376 H4502Handler *
h4502handler;
02377 H4504Handler *
h4504handler;
02378 H4506Handler *
h4506handler;
02379 H45011Handler *
h45011handler;
02380 OpalRFC2833 *
rfc2833handler;
02381 OpalT120Protocol *
t120handler;
02382 OpalT38Protocol *
t38handler;
02383
02384
02385
02386
02387 PDTMFDecoder
dtmfDecoder;
02388
02389
02390 BOOL
remoteIsNAT;
02391
02392
private:
02393 PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02394
02395 PMutex outerMutex;
02396 PMutex innerMutex;
02397 };
02398
02399
02400
PLIST(H323ConnectionList,
H323Connection);
02401
PDICTIONARY(H323ConnectionDict, PString,
H323Connection);
02402
PDICTIONARY(H323CallIdentityDict, PString,
H323Connection);
02403
02404
02405
#endif // __OPAL_H323CON_H
02406
02407