📄 h323.h
字号:
/**Get the local name/alias. */ const PString & GetLocalPartyName() const { return localPartyName; } /**Set the local name/alias from information in the PDU. */ void SetLocalPartyName(const PString & name) { localPartyName = name; } /**Get the remote party name. This returns a string indicating the remote parties names and aliases. This can be a complicated string containing all the aliases and the remote host name. For example: "Fred Nurk (fred, 5551234) [fred.nurk.com]" */ const PString & GetRemotePartyName() const { return remotePartyName; } /**Get the remote party number, if there was one one. If the remote party has indicated an e164 number as one of its aliases or as a field in the Q.931 PDU, then this function will return it. */ const PString & GetRemotePartyNumber() const { return remotePartyNumber; } /**Get the remote party address. This will return the "best guess" at an address to use in a H323EndPoint::MakeCall() function to call the remote party back again. Note that due to the presence of gatekeepers/proxies etc this may not always be accurate. */ const PString & GetRemotePartyAddress() const { return remotePartyAddress; } /**Set the name/alias of remote end from information in the PDU. */ void SetRemotePartyInfo( const H323SignalPDU & pdu /// PDU from which to extract party info. ); /**Get the remote application name and version. This information is obtained from the sourceInfo field of the H.225 Setup PDU or the destinationInfo of the call proceeding or alerting PDU's. The general format of the string will be information extracted from the VendorIdentifier field of the EndpointType. In partcular: productId\tversionId\tt35CountryCode:t35Extension:manufacturerCode */ const PString & GetRemoteApplication() const { return remoteApplication; } /**Set the name/alias of remote end from information in the PDU. */ void SetRemoteApplication( const H225_EndpointType & pdu /// PDU from which to extract application info. ); /**Get the remotes capability table for this connection. */ const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; } /**Get the remotes capability table for this connection. */ const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; } /**Get the maximum audio jitter delay. */ unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; } /**Get the signalling channel being used. */ const H323Transport * GetSignallingChannel() const { return signallingChannel; } /**Get the control channel being used (may return signalling channel). */ const H323Transport & GetControlChannel() const; /**Get the time at which the connection was established */ PTime GetConnectionStartTime() const { return connectionStartTime; } //@} protected: H323EndPoint & endpoint; PMutex inUseFlag; PTime connectionStartTime; BOOL callAnswered; unsigned distinctiveRing; PString callToken; unsigned callReference; H323GloballyUniqueID callIdentifier; H323GloballyUniqueID conferenceIdentifier; PString localPartyName; H323Capabilities localCapabilities; // Capabilities local system supports PString remotePartyName; PString remotePartyNumber; PString remotePartyAddress; PString remoteApplication; H323Capabilities remoteCapabilities; // Capabilities remote system supports unsigned remoteMaxAudioDelayJitter; PTimer roundTripDelayTimer; unsigned bandwidthAvailable; H323Transport * signallingChannel; H323Transport * controlChannel; BOOL h245Tunneling; H323SignalPDU * h245TunnelPDU; enum ConnectionStates { NoConnectionActive, AwaitingGatekeeperAdmission, AwaitingTransportConnect, AwaitingSignalConnect, HasExecutedSignalConnect, EstablishedConnection, ShuttingDownConnection, NumConnectionStates } connectionState; CallEndReason callEndReason; AnswerCallResponse answerResponse; PSyncPoint answerWaitFlag; RTP_SessionManager rtpSessions; enum FastStartStates { FastStartDisabled, FastStartInitiate, FastStartResponse, FastStartAcknowledged, NumFastStartStates }; FastStartStates fastStartState; H323LogicalChannelList fastStartChannels;#if PTRACING static const char * const CallEndReasonNames[NumCallEndReasons]; friend ostream & operator<<(ostream & o, CallEndReason r) { return o << CallEndReasonNames[r]; } static const char * const ConnectionStatesNames[NumConnectionStates]; friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << ConnectionStatesNames[s]; } static const char * const FastStartStateNames[NumFastStartStates]; friend ostream & operator<<(ostream & o, FastStartStates s) { return o << FastStartStateNames[s]; } static const char * const AnswerCallResponseNames[NumAnswerCallResponses]; friend ostream & operator<<(ostream & o, AnswerCallResponse s) { return o << AnswerCallResponseNames[s]; }#endif // The following pointers are to protocol procedures, they are pointers to // hide their complexity from the H323Connection classes users. H245NegMasterSlaveDetermination * masterSlaveDeterminationProcedure; H245NegTerminalCapabilitySet * capabilityExchangeProcedure; H245NegLogicalChannels * logicalChannels; H245NegRequestMode * requestModeProcedure; H245NegRoundTripDelay * roundTripDelayProcedure;};PLIST(H323ConnectionList, H323Connection);PDICTIONARY(H323ConnectionDict, PString, H323Connection);/**This class manages the H323 endpoint. An endpoint may have zero or more listeners to create incoming connections or zero or more outgoing conenctions initiated via the MakeCall() function. Once a conection exists it is managed by this class instance. The main thing this class embodies is the capabilities of the application, that is the codecs and protocols it is capable of. An application may create a descendent off this class and overide the CreateConnection() function, if they require a descendent of H323Connection to be created. This would be quite likely in most applications. */class H323EndPoint : public PObject{ PCLASSINFO(H323EndPoint, PObject); public: /**@name Construction */ //@{ /**Create a new endpoint. */ H323EndPoint(); /**Destroy endpoint. */ ~H323EndPoint(); /**Set the endpoint information in H225 PDU's. */ virtual void SetEndpointTypeInfo( H225_EndpointType & info ) const; /**Set the vendor information in H225 PDU's. */ virtual void SetVendorIdentifierInfo( H225_VendorIdentifier & info ) const; /**Set the H221NonStandard information in H225 PDU's. */ virtual void SetH221NonStandardInfo( H225_H221NonStandard & info ) const; //@} /**@name Capabilities */ //@{ /**Add a codec to the capabilities table. This will assure that the assignedCapabilityNumber field in the codec is unique for all codecs installed on this endpoint. If the specific instnace of the capability is already in the table, it is not added again. Ther can be multiple instances of the same capability class however. */ void AddCapability( H323Capability * capability /// New codec specification ); /**Set the capability descriptor lists. This is three tier set of codecs. The top most level is a list of particular capabilities. Each of these consists of a list of alternatives that can operate simultaneously. The lowest level is a list of codecs that cannot operate together. See H323 section 6.2.8.1 and H245 section 7.2 for details. If descriptorNum is P_MAX_INDEX, the the next available index in the array of descriptors is used. Similarly if simultaneous is P_MAX_INDEX the the next available SimultaneousCapabilitySet is used. The return value is the index used for the new entry. Note if both are P_MAX_INDEX then the return value is the descriptor index as the simultaneous index must be zero. Note that the capability specified here is automatically added to the capability table using the AddCapability() function. A specific instance of a capability is only ever added once, so multiple SetCapability() calls with the same H323Capability pointer will only add that capability once. */ PINDEX SetCapability( PINDEX descriptorNum, /// The member of the capabilityDescriptor to add PINDEX simultaneous, /// The member of the SimultaneousCapabilitySet to add H323Capability * cap /// New capability specification ); /**Find a capability that has been registered. */ H323Capability * FindCapability( const H245_Capability & cap /// H245 capability table entry ) const; /**Find a capability that has been registered. */ H323Capability * FindCapability( const H245_DataType & dataType /// H245 data type of codec ) const; /**Find a capability that has been registered. */ H323Capability * FindCapability( H323Capability::MainTypes mainType, /// Main type of codec unsigned subType /// Subtype of codec ) const; //@} /**@name Gatekeeper management */ //@{ /**Select and register with an explicit gatekeeper. This will use the specified transport and a string giving a transport dependent address to locate a specific gatekeeper. The endpoint will register with that gatekeeper and, if successful, set it as the current gatekeeper used by this endpoint. Note the transport being passed in will be deleted by this function or the H323Gatekeeper object it becomes associated with. Also if transport is NULL then a H323TransportUDP is created. */ BOOL SetGatekeeper( const PString & address, /// Address of gatekeeper to add. H323Transport * transport = NULL /// Transport over which to talk to gatekeeper. ); /**Discover and select gatekeeper. This function will use the automatic gatekeeper discovery methods to locate a gatekeeper on a particular transport. The OnReceiveGatekeeperConfirmPDU() function is called for each gatekeeper suitable. oneOnly parameter determines if the endpoint is to register with only the first gatekeeper discovered, or all of the them. Each one that is successfully registered is added to the gatekeeper list used by this endpoint. Note the transport being passed in will be deleted becomes owned by the endpoint and will be deleted by it. Also if transport is NULL then a H323TransportUDP is created. */ BOOL DiscoverGatekeeper( H323Transport * transport = NULL /// Transport over which to talk to gatekeeper. ); /**Create a gatekeeper. This allows the application writer to have the gatekeeper as a descendent of the H323Gatekeeper in order to add functionality to the base capabilities in the library. The default creates an instance of the H323Gatekeeper class. */ virtual H323Gatekeeper * CreateGatekeeper( H323Transport * transport /// Transport over which gatekeepers communicates. ); /**Get the gatekeeper we are registered with. */ H323Gatekeeper * GetGatekeeper() const { return gatekeeper; } /**Unregister and delete the gatekeeper we are registered with. */ BOOL RemoveGatekeeper( int reason = -1 /// Reason for gatekeeper removal ); //@} /**@name Connection management */ //@{ /**Add a listener to the endoint. This allows for the automatic creating of incoming call connections. An application should use OnConnectionEstablished() to monitor when calls have arrived and been successfully negotiated. */ BOOL StartListener( H323Listener * listener /// Transport dependent listener. ); /**Make a call to a remote party. An appropriate transport is determined from the remoteParty parameter. The general form for this parameter is [alias@][transport$]host[:port] where the default alias is the same as the host, the default transport is "ip" and the default port is 1720. This function returns almost immediately with the call occurring in a new
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -