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 #ifndef __OPAL_H323PDU_H
00295 #define __OPAL_H323PDU_H
00296
00297 #ifdef P_USE_PRAGMA
00298 #pragma interface
00299 #endif
00300
00301
00302 #include <ptlib/sockets.h>
00303 #include <h323/h323con.h>
00304 #include <h323/transaddr.h>
00305 #include <h323/q931.h>
00306 #include <h323/h235auth.h>
00307 #include <h323/h323trans.h>
00308 #include <asn/h225.h>
00309 #include <asn/h245.h>
00310
00311
00312 class H323Connection;
00313 class H323TransportAddress;
00314 class H225_RAS;
00315 class OpalGloballyUniqueID;
00316
00317
00318 #define H225_PROTOCOL_VERSION 4
00319 #define H245_PROTOCOL_VERSION 11
00320
00321
00323
00326 class H323SignalPDU : public H225_H323_UserInformation
00327 {
00328 PCLASSINFO(H323SignalPDU, H225_H323_UserInformation);
00329
00330 public:
00335 H323SignalPDU();
00336
00339 H225_Setup_UUIE & BuildSetup(
00340 const H323Connection & connection,
00341 const H323TransportAddress & destAddr
00342 );
00343
00346 H225_CallProceeding_UUIE & BuildCallProceeding(
00347 const H323Connection & connection
00348 );
00349
00352 H225_Connect_UUIE & BuildConnect(
00353 const H323Connection & connection
00354 );
00355
00358 H225_Connect_UUIE & BuildConnect(
00359 const H323Connection & connection,
00360 const PIPSocket::Address & h245Address,
00361 WORD port
00362 );
00363
00366 H225_Alerting_UUIE & BuildAlerting(
00367 const H323Connection & connection
00368 );
00369
00372 H225_Information_UUIE & BuildInformation(
00373 const H323Connection & connection
00374 );
00375
00378 H225_ReleaseComplete_UUIE & BuildReleaseComplete(
00379 const H323Connection & connection
00380 );
00381
00384 H225_Facility_UUIE * BuildFacility(
00385 const H323Connection & connection,
00386 BOOL empty
00387 );
00388
00391 H225_Progress_UUIE & BuildProgress(
00392 const H323Connection & connection
00393 );
00394
00397 H225_Status_UUIE & BuildStatus(
00398 const H323Connection & connection
00399 );
00400
00403 H225_StatusInquiry_UUIE & BuildStatusInquiry(
00404 const H323Connection & connection
00405 );
00406
00409 H225_SetupAcknowledge_UUIE & BuildSetupAcknowledge(
00410 const H323Connection & connection
00411 );
00412
00415 H225_Notify_UUIE & BuildNotify(
00416 const H323Connection & connection
00417 );
00419
00420
00425 void PrintOn(
00426 ostream & strm
00427 ) const;
00428
00431 BOOL Read(
00432 H323Transport & transport
00433 );
00434
00437 BOOL Write(
00438 H323Transport & transport
00439 );
00440
00443 const Q931 & GetQ931() const { return q931pdu; }
00444
00447 Q931 & GetQ931() { return q931pdu; }
00448
00451 void SetQ931(const Q931 & _q931pdu) { q931pdu = _q931pdu; }
00452
00457 void BuildQ931();
00458
00463 PString GetSourceAliases(
00464 const H323Transport * transport = NULL
00465 ) const;
00466
00471 PString GetDestinationAlias(
00472 BOOL firstAliasOnly = FALSE
00473 ) const;
00474
00479 BOOL GetSourceE164(
00480 PString & number
00481 ) const;
00482
00487 BOOL GetDestinationE164(
00488 PString & number
00489 ) const;
00490
00494 unsigned GetDistinctiveRing() const;
00495
00500 void SetQ931Fields(
00501 const H323Connection & connection,
00502 BOOL insertPartyNumbers = FALSE,
00503 unsigned plan = 1,
00504 unsigned type = 0,
00505 int presentation = -1,
00506 int screening = -1
00507 );
00508
00509 protected:
00510
00511
00512 Q931 q931pdu;
00513 };
00514
00515
00517
00520 class H323ControlPDU : public H245_MultimediaSystemControlMessage
00521 {
00522 PCLASSINFO(H323ControlPDU, H245_MultimediaSystemControlMessage);
00523
00524 public:
00525 H245_RequestMessage & Build(H245_RequestMessage ::Choices request);
00526 H245_ResponseMessage & Build(H245_ResponseMessage ::Choices response);
00527 H245_CommandMessage & Build(H245_CommandMessage ::Choices command);
00528 H245_IndicationMessage & Build(H245_IndicationMessage::Choices indication);
00529
00530 H245_MasterSlaveDetermination & BuildMasterSlaveDetermination(
00531 unsigned terminalType,
00532 unsigned statusDeterminationNumber
00533 );
00534 H245_MasterSlaveDeterminationAck & BuildMasterSlaveDeterminationAck(
00535 BOOL isMaster
00536 );
00537 H245_MasterSlaveDeterminationReject & BuildMasterSlaveDeterminationReject(
00538 unsigned cause
00539 );
00540
00541 H245_TerminalCapabilitySet & BuildTerminalCapabilitySet(
00542 const H323Connection & connection,
00543 unsigned sequenceNumber,
00544 BOOL empty
00545 );
00546 H245_TerminalCapabilitySetAck & BuildTerminalCapabilitySetAck(
00547 unsigned sequenceNumber
00548 );
00549 H245_TerminalCapabilitySetReject & BuildTerminalCapabilitySetReject(
00550 unsigned sequenceNumber,
00551 unsigned cause
00552 );
00553
00554 H245_OpenLogicalChannel & BuildOpenLogicalChannel(
00555 unsigned forwardLogicalChannelNumber
00556 );
00557 H245_RequestChannelClose & BuildRequestChannelClose(
00558 unsigned channelNumber,
00559 unsigned reason
00560 );
00561 H245_CloseLogicalChannel & BuildCloseLogicalChannel(
00562 unsigned channelNumber
00563 );
00564 H245_OpenLogicalChannelAck & BuildOpenLogicalChannelAck(
00565 unsigned channelNumber
00566 );
00567 H245_OpenLogicalChannelReject & BuildOpenLogicalChannelReject(
00568 unsigned channelNumber,
00569 unsigned cause
00570 );
00571 H245_OpenLogicalChannelConfirm & BuildOpenLogicalChannelConfirm(
00572 unsigned channelNumber
00573 );
00574 H245_CloseLogicalChannelAck & BuildCloseLogicalChannelAck(
00575 unsigned channelNumber
00576 );
00577 H245_RequestChannelCloseAck & BuildRequestChannelCloseAck(
00578 unsigned channelNumber
00579 );
00580 H245_RequestChannelCloseReject & BuildRequestChannelCloseReject(
00581 unsigned channelNumber
00582 );
00583 H245_RequestChannelCloseRelease & BuildRequestChannelCloseRelease(
00584 unsigned channelNumber
00585 );
00586
00587 H245_RequestMode & BuildRequestMode(
00588 unsigned sequenceNumber
00589 );
00590 H245_RequestModeAck & BuildRequestModeAck(
00591 unsigned sequenceNumber,
00592 unsigned response
00593 );
00594 H245_RequestModeReject & BuildRequestModeReject(
00595 unsigned sequenceNumber,
00596 unsigned cause
00597 );
00598
00599 H245_RoundTripDelayRequest & BuildRoundTripDelayRequest(
00600 unsigned sequenceNumber
00601 );
00602 H245_RoundTripDelayResponse & BuildRoundTripDelayResponse(
00603 unsigned sequenceNumber
00604 );
00605
00606 H245_UserInputIndication & BuildUserInputIndication(
00607 const PString & value
00608 );
00609 H245_UserInputIndication & BuildUserInputIndication(
00610 char tone,
00611 unsigned duration,
00612 unsigned logicalChannel,
00613 unsigned rtpTimestamp
00614 );
00615
00616 H245_MiscellaneousCommand & BuildMiscellaneousCommand(
00617 unsigned channelNumber,
00618 unsigned type
00619 );
00620
00621 H245_FunctionNotUnderstood & BuildFunctionNotUnderstood(
00622 const H323ControlPDU & pdu
00623 );
00624
00625 H245_EndSessionCommand & BuildEndSessionCommand(
00626 unsigned reason
00627 );
00628 };
00629
00630
00632
00635 class H323RasPDU : public H225_RasMessage, public H323TransactionPDU
00636 {
00637 PCLASSINFO(H323RasPDU, H225_RasMessage);
00638
00639 public:
00640 H323RasPDU();
00641 H323RasPDU(
00642 const H235Authenticators & authenticators
00643 );
00644
00645
00646 virtual PObject * Clone() const;
00647
00648
00649 virtual PASN_Object & GetPDU();
00650 virtual PASN_Choice & GetChoice();
00651 virtual const PASN_Object & GetPDU() const;
00652 virtual const PASN_Choice & GetChoice() const;
00653 virtual unsigned GetSequenceNumber() const;
00654 virtual unsigned GetRequestInProgressDelay() const;
00655 #if PTRACING
00656 virtual const char * GetProtocolName() const;
00657 #endif
00658 virtual H323TransactionPDU * ClonePDU() const;
00659 virtual void DeletePDU();
00660
00661
00662 H225_GatekeeperRequest & BuildGatekeeperRequest(unsigned seqNum);
00663 H225_GatekeeperConfirm & BuildGatekeeperConfirm(unsigned seqNum);
00664 H225_GatekeeperReject & BuildGatekeeperReject(unsigned seqNum, unsigned reason = H225_GatekeeperRejectReason::e_undefinedReason);
00665 H225_RegistrationRequest & BuildRegistrationRequest(unsigned seqNum);
00666 H225_RegistrationConfirm & BuildRegistrationConfirm(unsigned seqNum);
00667 H225_RegistrationReject & BuildRegistrationReject(unsigned seqNum, unsigned reason = H225_RegistrationRejectReason::e_undefinedReason);
00668 H225_UnregistrationRequest & BuildUnregistrationRequest(unsigned seqNum);
00669 H225_UnregistrationConfirm & BuildUnregistrationConfirm(unsigned seqNum);
00670 H225_UnregistrationReject & BuildUnregistrationReject(unsigned seqNum, unsigned reason = H225_UnregRejectReason::e_undefinedReason);
00671 H225_LocationRequest & BuildLocationRequest(unsigned seqNum);
00672 H225_LocationConfirm & BuildLocationConfirm(unsigned seqNum);
00673 H225_LocationReject & BuildLocationReject(unsigned seqNum, unsigned reason = H225_LocationRejectReason::e_undefinedReason);
00674 H225_AdmissionRequest & BuildAdmissionRequest(unsigned seqNum);
00675 H225_AdmissionConfirm & BuildAdmissionConfirm(unsigned seqNum);
00676 H225_AdmissionReject & BuildAdmissionReject(unsigned seqNum, unsigned reason = H225_AdmissionRejectReason::e_undefinedReason);
00677 H225_DisengageRequest & BuildDisengageRequest(unsigned seqNum);
00678 H225_DisengageConfirm & BuildDisengageConfirm(unsigned seqNum);
00679 H225_DisengageReject & BuildDisengageReject(unsigned seqNum, unsigned reason = H225_DisengageRejectReason::e_securityDenial);
00680 H225_BandwidthRequest & BuildBandwidthRequest(unsigned seqNum);
00681 H225_BandwidthConfirm & BuildBandwidthConfirm(unsigned seqNum, unsigned bandwidth = 0);
00682 H225_BandwidthReject & BuildBandwidthReject(unsigned seqNum, unsigned reason = H225_BandRejectReason::e_undefinedReason);
00683 H225_InfoRequest & BuildInfoRequest(unsigned seqNum, unsigned callRef = 0, const OpalGloballyUniqueID * id = NULL);
00684 H225_InfoRequestResponse & BuildInfoRequestResponse(unsigned seqNum);
00685 H225_InfoRequestAck & BuildInfoRequestAck(unsigned seqNum);
00686 H225_InfoRequestNak & BuildInfoRequestNak(unsigned seqNum, unsigned reason = H225_InfoRequestNakReason::e_undefinedReason);
00687 H225_ServiceControlIndication& BuildServiceControlIndication(unsigned seqNum, const OpalGloballyUniqueID * id = NULL);
00688 H225_ServiceControlResponse & BuildServiceControlResponse(unsigned seqNum);
00689 H225_UnknownMessageResponse & BuildUnknownMessageResponse(unsigned seqNum);
00690 H225_RequestInProgress & BuildRequestInProgress(unsigned seqNum, unsigned delay);
00691 };
00692
00693
00695
00696 void H323SetAliasAddresses(const H323TransportAddressArray & addresses, H225_ArrayOf_AliasAddress & aliases);
00697 void H323SetAliasAddresses(const PStringArray & names, H225_ArrayOf_AliasAddress & aliases, int tag = -1);
00698 void H323SetAliasAddresses(const PStringList & names, H225_ArrayOf_AliasAddress & aliases, int tag = -1);
00699 void H323SetAliasAddress(const H323TransportAddress & address, H225_AliasAddress & alias);
00700 void H323SetAliasAddress(const PString & name, H225_AliasAddress & alias, int tag = -1);
00701 PStringArray H323GetAliasAddressStrings(const H225_ArrayOf_AliasAddress & aliases);
00702 PString H323GetAliasAddressString(const H225_AliasAddress & alias);
00703 PString H323GetAliasAddressE164(const H225_AliasAddress & alias);
00704 PString H323GetAliasAddressE164(const H225_ArrayOf_AliasAddress & aliases);
00705
00706 H323Connection::CallEndReason H323TranslateToCallEndReason(
00707 Q931::CauseValues cause,
00708 const H225_ReleaseCompleteReason & reason
00709 );
00710 Q931::CauseValues H323TranslateFromCallEndReason(
00711 const H323Connection & connection,
00712 H225_ReleaseCompleteReason & rcReason
00713 );
00714
00715 PString H323GetApplicationInfo(const H225_VendorIdentifier & vendor);
00716
00717
00718 #if PTRACING
00719 void H323TraceDumpPDU(
00720 const char * proto,
00721 BOOL writing,
00722 const PBYTEArray & rawData,
00723 const PASN_Object & pdu,
00724 const PASN_Choice & tag1,
00725 unsigned seqNum
00726 );
00727 #else
00728 #define H323TraceDumpPDU(proto, writing, rawData, pdu, tag1, seqNum)
00729 #endif
00730
00731
00732 #endif // __OPAL_H323PDU_H
00733
00734