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
#ifndef __OPAL_H323PDU_H
00248
#define __OPAL_H323PDU_H
00249
00250
#ifdef P_USE_PRAGMA
00251
#pragma interface
00252
#endif
00253
00254
00255
#include <ptlib/sockets.h>
00256
#include "h323con.h"
00257
#include "transports.h"
00258
#include "q931.h"
00259
#include "h225.h"
00260
#include "h245.h"
00261
#include "h323trans.h"
00262
00263
00264
class H225_RAS;
00265
00266
00267 #define H225_PROTOCOL_VERSION 4
00268 #define H245_PROTOCOL_VERSION 7
00269
00270
00272
00275 class H323SignalPDU :
public H225_H323_UserInformation
00276 {
00277 PCLASSINFO(
H323SignalPDU,
H225_H323_UserInformation);
00278
00279
public:
00284
H323SignalPDU();
00285
00288
H225_Setup_UUIE &
BuildSetup(
00289
const H323Connection & connection,
00290
const H323TransportAddress & destAddr
00291 );
00292
00295
H225_CallProceeding_UUIE &
BuildCallProceeding(
00296
const H323Connection & connection
00297 );
00298
00301
H225_Connect_UUIE &
BuildConnect(
00302
const H323Connection & connection
00303 );
00304
00307
H225_Connect_UUIE & BuildConnect(
00308
const H323Connection & connection,
00309
const PIPSocket::Address & h245Address,
00310 WORD port
00311 );
00312
00315
H225_Alerting_UUIE &
BuildAlerting(
00316
const H323Connection & connection
00317 );
00318
00321
H225_Information_UUIE &
BuildInformation(
00322
const H323Connection & connection
00323 );
00324
00327
H225_ReleaseComplete_UUIE &
BuildReleaseComplete(
00328
const H323Connection & connection
00329 );
00330
00333
H225_Facility_UUIE *
BuildFacility(
00334
const H323Connection & connection,
00335 BOOL empty
00336 );
00337
00340
H225_Progress_UUIE &
BuildProgress(
00341
const H323Connection & connection
00342 );
00343
00346
H225_Status_UUIE &
BuildStatus(
00347
const H323Connection & connection
00348 );
00349
00352
H225_StatusInquiry_UUIE &
BuildStatusInquiry(
00353
const H323Connection & connection
00354 );
00355
00358
H225_SetupAcknowledge_UUIE &
BuildSetupAcknowledge(
00359
const H323Connection & connection
00360 );
00361
00364
H225_Notify_UUIE &
BuildNotify(
00365
const H323Connection & connection
00366 );
00368
00369
00374
void PrintOn(
00375 ostream & strm
00376 )
const;
00377
00380 BOOL
Read(
00381
H323Transport & transport
00382 );
00383
00386 BOOL
Write(
00387
H323Transport & transport
00388 );
00389
00392 const Q931 &
GetQ931()
const {
return q931pdu; }
00393
00396 Q931 &
GetQ931() {
return q931pdu; }
00397
00402
void BuildQ931();
00403
00408 PString GetSourceAliases(
00409
const H323Transport * transport = NULL
00410 )
const;
00411
00416 PString GetDestinationAlias(
00417 BOOL firstAliasOnly = FALSE
00418 )
const;
00419
00424 BOOL GetSourceE164(
00425 PString & number
00426 )
const;
00427
00432 BOOL GetDestinationE164(
00433 PString & number
00434 )
const;
00435
00439
unsigned GetDistinctiveRing() const;
00440
00445
void SetQ931Fields(
00446 const
H323Connection & connection,
00447 BOOL insertPartyNumbers = FALSE,
00448
unsigned plan = 1,
00449
unsigned type = 0,
00450
int presentation = -1,
00451
int screening = -1
00452 );
00453
00454 protected:
00455
00456
00457 Q931 q931pdu;
00458 };
00459
00460
00462
00465 class
H323ControlPDU : public
H245_MultimediaSystemControlMessage
00466 {
00467 PCLASSINFO(
H323ControlPDU, H245_MultimediaSystemControlMessage);
00468
00469
public:
00470
H245_RequestMessage & Build(
H245_RequestMessage ::Choices request);
00471
H245_ResponseMessage & Build(
H245_ResponseMessage ::Choices response);
00472
H245_CommandMessage & Build(
H245_CommandMessage ::Choices command);
00473
H245_IndicationMessage & Build(H245_IndicationMessage::Choices indication);
00474
00475
H245_MasterSlaveDetermination & BuildMasterSlaveDetermination(
00476
unsigned terminalType,
00477
unsigned statusDeterminationNumber
00478 );
00479
H245_MasterSlaveDeterminationAck & BuildMasterSlaveDeterminationAck(
00480 BOOL isMaster
00481 );
00482
H245_MasterSlaveDeterminationReject & BuildMasterSlaveDeterminationReject(
00483
unsigned cause
00484 );
00485
00486
H245_TerminalCapabilitySet & BuildTerminalCapabilitySet(
00487
const H323Connection & connection,
00488
unsigned sequenceNumber,
00489 BOOL empty
00490 );
00491
H245_TerminalCapabilitySetAck & BuildTerminalCapabilitySetAck(
00492
unsigned sequenceNumber
00493 );
00494
H245_TerminalCapabilitySetReject & BuildTerminalCapabilitySetReject(
00495
unsigned sequenceNumber,
00496
unsigned cause
00497 );
00498
00499
H245_OpenLogicalChannel & BuildOpenLogicalChannel(
00500
unsigned forwardLogicalChannelNumber
00501 );
00502
H245_RequestChannelClose & BuildRequestChannelClose(
00503
unsigned channelNumber,
00504
unsigned reason
00505 );
00506
H245_CloseLogicalChannel & BuildCloseLogicalChannel(
00507
unsigned channelNumber
00508 );
00509
H245_OpenLogicalChannelAck & BuildOpenLogicalChannelAck(
00510
unsigned channelNumber
00511 );
00512
H245_OpenLogicalChannelReject & BuildOpenLogicalChannelReject(
00513
unsigned channelNumber,
00514
unsigned cause
00515 );
00516
H245_OpenLogicalChannelConfirm & BuildOpenLogicalChannelConfirm(
00517
unsigned channelNumber
00518 );
00519
H245_CloseLogicalChannelAck & BuildCloseLogicalChannelAck(
00520
unsigned channelNumber
00521 );
00522
H245_RequestChannelCloseAck & BuildRequestChannelCloseAck(
00523
unsigned channelNumber
00524 );
00525
H245_RequestChannelCloseReject & BuildRequestChannelCloseReject(
00526
unsigned channelNumber
00527 );
00528
H245_RequestChannelCloseRelease & BuildRequestChannelCloseRelease(
00529
unsigned channelNumber
00530 );
00531
00532
H245_RequestMode & BuildRequestMode(
00533
unsigned sequenceNumber
00534 );
00535
H245_RequestModeAck & BuildRequestModeAck(
00536
unsigned sequenceNumber,
00537
unsigned response
00538 );
00539
H245_RequestModeReject & BuildRequestModeReject(
00540
unsigned sequenceNumber,
00541
unsigned cause
00542 );
00543
00544
H245_RoundTripDelayRequest & BuildRoundTripDelayRequest(
00545
unsigned sequenceNumber
00546 );
00547
H245_RoundTripDelayResponse & BuildRoundTripDelayResponse(
00548
unsigned sequenceNumber
00549 );
00550
00551
H245_UserInputIndication & BuildUserInputIndication(
00552
const PString & value
00553 );
00554
H245_UserInputIndication & BuildUserInputIndication(
00555
char tone,
00556
unsigned duration,
00557
unsigned logicalChannel,
00558
unsigned rtpTimestamp
00559 );
00560
00561
H245_FunctionNotUnderstood & BuildFunctionNotUnderstood(
00562
const H323ControlPDU & pdu
00563 );
00564
00565
H245_EndSessionCommand & BuildEndSessionCommand(
00566
unsigned reason
00567 );
00568 };
00569
00570
00572
00575 class H323RasPDU :
public H225_RasMessage,
public H323TransactionPDU
00576 {
00577 PCLASSINFO(
H323RasPDU,
H225_RasMessage);
00578
00579
public:
00580
H323RasPDU();
00581
H323RasPDU(
00582
const H235Authenticators & authenticators
00583 );
00584
00585
00586
virtual PObject *
Clone()
const;
00587
00588
00589
virtual PASN_Object & GetPDU();
00590
virtual PASN_Choice & GetChoice();
00591
virtual const PASN_Object & GetPDU()
const;
00592
virtual const PASN_Choice & GetChoice()
const;
00593
virtual unsigned GetSequenceNumber()
const;
00594
virtual unsigned GetRequestInProgressDelay()
const;
00595
#if PTRACING
00596
virtual const char * GetProtocolName()
const;
00597
#endif
00598
virtual H323TransactionPDU * ClonePDU()
const;
00599
virtual void DeletePDU();
00600
00601
00602
H225_GatekeeperRequest & BuildGatekeeperRequest(
unsigned seqNum);
00603
H225_GatekeeperConfirm & BuildGatekeeperConfirm(
unsigned seqNum);
00604
H225_GatekeeperReject & BuildGatekeeperReject(
unsigned seqNum,
unsigned reason = H225_GatekeeperRejectReason::e_undefinedReason);
00605
H225_RegistrationRequest & BuildRegistrationRequest(
unsigned seqNum);
00606
H225_RegistrationConfirm & BuildRegistrationConfirm(
unsigned seqNum);
00607
H225_RegistrationReject & BuildRegistrationReject(
unsigned seqNum,
unsigned reason = H225_RegistrationRejectReason::e_undefinedReason);
00608
H225_UnregistrationRequest & BuildUnregistrationRequest(
unsigned seqNum);
00609
H225_UnregistrationConfirm & BuildUnregistrationConfirm(
unsigned seqNum);
00610
H225_UnregistrationReject & BuildUnregistrationReject(
unsigned seqNum,
unsigned reason = H225_UnregRejectReason::e_undefinedReason);
00611
H225_LocationRequest & BuildLocationRequest(
unsigned seqNum);
00612
H225_LocationConfirm & BuildLocationConfirm(
unsigned seqNum);
00613
H225_LocationReject & BuildLocationReject(
unsigned seqNum,
unsigned reason = H225_LocationRejectReason::e_undefinedReason);
00614
H225_AdmissionRequest & BuildAdmissionRequest(
unsigned seqNum);
00615
H225_AdmissionConfirm & BuildAdmissionConfirm(
unsigned seqNum);
00616
H225_AdmissionReject & BuildAdmissionReject(
unsigned seqNum,
unsigned reason = H225_AdmissionRejectReason::e_undefinedReason);
00617
H225_DisengageRequest & BuildDisengageRequest(
unsigned seqNum);
00618
H225_DisengageConfirm & BuildDisengageConfirm(
unsigned seqNum);
00619
H225_DisengageReject & BuildDisengageReject(
unsigned seqNum,
unsigned reason = H225_DisengageRejectReason::e_securityDenial);
00620
H225_BandwidthRequest & BuildBandwidthRequest(
unsigned seqNum);
00621
H225_BandwidthConfirm & BuildBandwidthConfirm(
unsigned seqNum,
unsigned bandwidth = 0);
00622
H225_BandwidthReject & BuildBandwidthReject(
unsigned seqNum,
unsigned reason = H225_BandRejectReason::e_undefinedReason);
00623
H225_InfoRequest & BuildInfoRequest(
unsigned seqNum,
unsigned callRef = 0,
const OpalGloballyUniqueID *
id = NULL);
00624
H225_InfoRequestResponse & BuildInfoRequestResponse(
unsigned seqNum);
00625
H225_InfoRequestAck & BuildInfoRequestAck(
unsigned seqNum);
00626
H225_InfoRequestNak & BuildInfoRequestNak(
unsigned seqNum,
unsigned reason = H225_InfoRequestNakReason::e_undefinedReason);
00627
H225_ServiceControlIndication& BuildServiceControlIndication(
unsigned seqNum,
const OpalGloballyUniqueID *
id = NULL);
00628
H225_ServiceControlResponse & BuildServiceControlResponse(
unsigned seqNum);
00629
H225_UnknownMessageResponse & BuildUnknownMessageResponse(
unsigned seqNum);
00630
H225_RequestInProgress & BuildRequestInProgress(
unsigned seqNum,
unsigned delay);
00631 };
00632
00633
00635
00636
void H323SetAliasAddresses(
const H323TransportAddressArray & addresses,
H225_ArrayOf_AliasAddress & aliases);
00637
void H323SetAliasAddresses(
const PStringArray & names,
H225_ArrayOf_AliasAddress & aliases,
int tag = -1);
00638
void H323SetAliasAddresses(
const PStringList & names,
H225_ArrayOf_AliasAddress & aliases,
int tag = -1);
00639
void H323SetAliasAddress(
const H323TransportAddress & address,
H225_AliasAddress & alias);
00640
void H323SetAliasAddress(
const PString & name,
H225_AliasAddress & alias,
int tag = -1);
00641 PStringArray
H323GetAliasAddressStrings(
const H225_ArrayOf_AliasAddress & aliases);
00642 PString
H323GetAliasAddressString(
const H225_AliasAddress & alias);
00643 PString
H323GetAliasAddressE164(
const H225_AliasAddress & alias);
00644 PString
H323GetAliasAddressE164(
const H225_ArrayOf_AliasAddress & aliases);
00645
00646 H323Connection::CallEndReason
H323TranslateToCallEndReason(
00647 Q931::CauseValues cause,
00648
const H225_ReleaseCompleteReason & reason
00649 );
00650 Q931::CauseValues
H323TranslateFromCallEndReason(
00651
const H323Connection & connection,
00652
H225_ReleaseCompleteReason & rcReason
00653 );
00654
00655 PString
H323GetApplicationInfo(
const H225_VendorIdentifier & vendor);
00656
00657
00658
#if PTRACING
00659
void H323TraceDumpPDU(
00660
const char * proto,
00661 BOOL writing,
00662
const PBYTEArray & rawData,
00663
const PASN_Object & pdu,
00664
const PASN_Choice & tag1,
00665
unsigned seqNum
00666 );
00667
#else
00668 #define H323TraceDumpPDU(proto, writing, rawData, pdu, tag1, seqNum)
00669
#endif
00670
00671
00672
#endif // __OPAL_H323PDU_H
00673
00674