Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

h323ep.h

Go to the documentation of this file.
00001 /*
00002  * h323ep.h
00003  *
00004  * H.323 protocol handler
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 1998-2001 Equivalence Pty. Ltd.
00009  *
00010  * The contents of this file are subject to the Mozilla Public License
00011  * Version 1.0 (the "License"); you may not use this file except in
00012  * compliance with the License. You may obtain a copy of the License at
00013  * http://www.mozilla.org/MPL/
00014  *
00015  * Software distributed under the License is distributed on an "AS IS"
00016  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00017  * the License for the specific language governing rights and limitations
00018  * under the License.
00019  *
00020  * The Original Code is Open H323 Library.
00021  *
00022  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
00023  *
00024  * Portions of this code were written with the assisance of funding from
00025  * Vovida Networks, Inc. http://www.vovida.com.
00026  *
00027  * Contributor(s): ______________________________________.
00028  *
00029  * $Log: h323ep.h,v $
00030  * Revision 1.66  2004/11/25 07:38:58  csoutheren
00031  * Ensured that external TCP address translation is performed when using STUN to handle UDP
00032  *
00033  * Revision 1.65  2004/09/03 01:06:09  csoutheren
00034  * Added initial hooks for H.460 GEF
00035  * Thanks to Simon Horne and ISVO (Asia) Pte Ltd. for this contribution
00036  *
00037  * Revision 1.64  2004/07/27 05:28:45  csoutheren
00038  * Added ability to set priority of channel threads
00039  *
00040  * Revision 1.63  2004/07/27 01:15:16  csoutheren
00041  * Added virtual to InternalMakeCall
00042  *
00043  * Revision 1.62  2004/07/19 13:19:55  csoutheren
00044  * Fixed typo in secondaryConnectionsActive
00045  *
00046  * Revision 1.61  2004/07/11 11:36:25  rjongbloed
00047  * Added virtual to CleanUpConnections, thanks Eize Slange
00048  *
00049  * Revision 1.60  2004/06/15 03:30:00  csoutheren
00050  * Added OnSendARQ to allow access to the ARQ message before sent by connection
00051  *
00052  * Revision 1.59  2004/06/04 07:05:10  csoutheren
00053  * Fixed obvious typos
00054  *
00055  * Revision 1.58  2004/06/01 05:48:02  csoutheren
00056  * Changed capability table to use abstract factory routines rather than internal linked list
00057  *
00058  * Revision 1.57  2004/05/17 12:14:24  csoutheren
00059  * Added support for different SETUP PDU types
00060  *
00061  * Revision 1.56  2003/12/29 04:58:55  csoutheren
00062  * Added callbacks on H323EndPoint when gatekeeper discovery succeeds or fails
00063  *
00064  * Revision 1.55  2003/12/28 02:52:15  csoutheren
00065  * Added virtual to a few functions
00066  *
00067  * Revision 1.54  2003/12/28 02:38:14  csoutheren
00068  * Added H323EndPoint::OnOutgoingCall
00069  *
00070  * Revision 1.53  2003/12/28 00:07:10  csoutheren
00071  * Added callbacks on H323EndPoint when gatekeeper registration succeeds or fails
00072  *
00073  * Revision 1.52  2003/04/24 01:49:33  dereks
00074  * Add ability to set no media timeout interval
00075  *
00076  * Revision 1.51  2003/04/10 09:39:48  robertj
00077  * Added associated transport to new GetInterfaceAddresses() function so
00078  *   interfaces can be ordered according to active transport links. Improves
00079  *   interoperability.
00080  *
00081  * Revision 1.50  2003/04/10 01:05:11  craigs
00082  * Added functions to access to lists of interfaces
00083  *
00084  * Revision 1.49  2003/04/07 13:09:25  robertj
00085  * Added ILS support to callto URL parsing in MakeCall(), ie can now call hosts
00086  *   registered with an ILS directory.
00087  *
00088  * Revision 1.48  2003/02/13 00:11:31  robertj
00089  * Added missing virtual for controlling call transfer, thanks Andrey Pinaev
00090  *
00091  * Revision 1.47  2003/02/09 00:48:06  robertj
00092  * Added function to return if registered with gatekeeper.
00093  *
00094  * Revision 1.46  2003/02/04 07:06:41  robertj
00095  * Added STUN support.
00096  *
00097  * Revision 1.45  2003/01/26 05:57:58  robertj
00098  * Changed ParsePartyName so will accept addresses of the form
00099  *   alias@gk:address which will do an LRQ call to "address" using "alias"
00100  *   to determine the IP address to connect to.
00101  *
00102  * Revision 1.44  2003/01/23 02:36:30  robertj
00103  * Increased (and made configurable) timeout for H.245 channel TCP connection.
00104  *
00105  * Revision 1.43  2002/11/28 01:19:55  craigs
00106  * Added virtual to several functions
00107  *
00108  * Revision 1.42  2002/11/27 06:54:52  robertj
00109  * Added Service Control Session management as per Annex K/H.323 via RAS
00110  *   only at this stage.
00111  * Added H.248 ASN and very primitive infrastructure for linking into the
00112  *   Service Control Session management system.
00113  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00114  * Added Call Credit Service Control to display account balances.
00115  *
00116  * Revision 1.41  2002/11/15 05:17:22  robertj
00117  * Added facility redirect support without changing the call token for access
00118  *   to the call. If it gets redirected a new H323Connection object is
00119  *   created but it looks like the same thing to an application.
00120  *
00121  * Revision 1.40  2002/11/10 08:10:43  robertj
00122  * Moved constants for "well known" ports to better place (OPAL change).
00123  *
00124  * Revision 1.39  2002/10/31 00:32:15  robertj
00125  * Enhanced jitter buffer system so operates dynamically between minimum and
00126  *   maximum values. Altered API to assure app writers note the change!
00127  *
00128  * Revision 1.38  2002/10/23 06:06:10  robertj
00129  * Added function to be smarter in using a gatekeeper for use by endpoint.
00130  *
00131  * Revision 1.37  2002/10/21 06:07:44  robertj
00132  * Added function to set gatekeeper access token OID.
00133  *
00134  * Revision 1.36  2002/09/16 01:14:15  robertj
00135  * Added #define so can select if #pragma interface/implementation is used on
00136  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00137  *
00138  * Revision 1.35  2002/09/10 06:32:25  robertj
00139  * Added function to get gatekeeper password.
00140  *
00141  * Revision 1.34  2002/09/03 06:19:36  robertj
00142  * Normalised the multi-include header prevention ifdef/define symbol.
00143  *
00144  * Revision 1.33  2002/07/19 03:39:19  robertj
00145  * Bullet proofed setting of RTP IP port base, can't be zero!
00146  *
00147  * Revision 1.32  2002/07/18 01:50:10  robertj
00148  * Changed port secltion code to force apps to use function interface.
00149  *
00150  * Revision 1.31  2002/06/22 05:48:38  robertj
00151  * Added partial implementation for H.450.11 Call Intrusion
00152  *
00153  * Revision 1.30  2002/06/13 06:15:19  robertj
00154  * Allowed TransferCall() to be used on H323Connection as well as H323EndPoint.
00155  *
00156  * Revision 1.29  2002/06/12 03:55:21  robertj
00157  * Added function to add/remove multiple listeners in one go comparing against
00158  *   what is already running so does not interrupt unchanged listeners.
00159  *
00160  * Revision 1.28  2002/05/29 06:40:29  robertj
00161  * Changed sending of endSession/ReleaseComplete PDU's to occur immediately
00162  *   on call clearance and not wait for background thread to do it.
00163  * Stricter compliance by waiting for reply endSession before closing down.
00164  *
00165  * Revision 1.27  2002/05/28 06:15:09  robertj
00166  * Split UDP (for RAS) from RTP port bases.
00167  * Added current port variable so cycles around the port range specified which
00168  *   fixes some wierd problems on some platforms, thanks Federico Pinna
00169  *
00170  * Revision 1.26  2002/05/17 03:38:05  robertj
00171  * Fixed problems with H.235 authentication on RAS for server and client.
00172  *
00173  * Revision 1.25  2002/05/16 00:03:05  robertj
00174  * Added function to get the tokens for all active calls.
00175  * Improved documentation for use of T.38 and T.120 functions.
00176  *
00177  * Revision 1.24  2002/05/15 08:59:18  rogerh
00178  * Update comments
00179  *
00180  * Revision 1.23  2002/05/03 05:38:15  robertj
00181  * Added Q.931 Keypad IE mechanism for user indications (DTMF).
00182  *
00183  * Revision 1.22  2002/05/02 07:56:24  robertj
00184  * Added automatic clearing of call if no media (RTP data) is transferred in a
00185  *   configurable (default 5 minutes) amount of time.
00186  *
00187  * Revision 1.21  2002/04/18 01:41:07  robertj
00188  * Fixed bad variable name for disabling DTMF detection, very confusing.
00189  *
00190  * Revision 1.20  2002/04/17 00:49:56  robertj
00191  * Added ability to disable the in band DTMF detection.
00192  *
00193  * Revision 1.19  2002/04/10 06:48:47  robertj
00194  * Added functions to set port member variables.
00195  *
00196  * Revision 1.18  2002/03/14 03:49:38  dereks
00197  * Fix minor documentation error.
00198  *
00199  * Revision 1.17  2002/02/04 07:17:52  robertj
00200  * Added H.450.2 Consultation Transfer, thanks Norwood Systems.
00201  *
00202  * Revision 1.16  2002/01/24 06:29:02  robertj
00203  * Added option to disable H.245 negotiation in SETUP pdu, this required
00204  *   API change so have a bit mask instead of a series of booleans.
00205  *
00206  * Revision 1.15  2002/01/17 07:04:58  robertj
00207  * Added support for RFC2833 embedded DTMF in the RTP stream.
00208  *
00209  * Revision 1.14  2002/01/13 23:59:43  robertj
00210  * Added CallTransfer timeouts to endpoint, hanks Ben Madsen of Norwood Systems.
00211  *
00212  * Revision 1.13  2002/01/08 04:45:35  robertj
00213  * Added MakeCallLocked() so can start a call with the H323Connection instance
00214  *   initally locked so can do things to it before the call really starts.
00215  *
00216  * Revision 1.12  2001/12/22 03:20:44  robertj
00217  * Added create protocol function to H323Connection.
00218  *
00219  * Revision 1.11  2001/12/13 10:55:30  robertj
00220  * Added gatekeeper access token OID specification for auto inclusion of
00221  *   access tokens frm ACF to SETUP pdu.
00222  *
00223  * Revision 1.10  2001/11/09 05:39:54  craigs
00224  * Added initial T.38 support thanks to Adam Lazur
00225  *
00226  * Revision 1.9  2001/11/01 00:27:33  robertj
00227  * Added default Fast Start disabled and H.245 tunneling disable flags
00228  *   to the endpoint instance.
00229  *
00230  * Revision 1.8  2001/09/11 01:24:36  robertj
00231  * Added conditional compilation to remove video and/or audio codecs.
00232  *
00233  * Revision 1.7  2001/09/11 00:21:21  robertj
00234  * Fixed missing stack sizes in endpoint for cleaner thread and jitter thread.
00235  *
00236  * Revision 1.6  2001/08/24 14:03:26  rogerh
00237  * Fix some spelling mistakes
00238  *
00239  * Revision 1.5  2001/08/16 07:49:16  robertj
00240  * Changed the H.450 support to be more extensible. Protocol handlers
00241  *   are now in separate classes instead of all in H323Connection.
00242  *
00243  * Revision 1.4  2001/08/10 11:03:49  robertj
00244  * Major changes to H.235 support in RAS to support server.
00245  *
00246  * Revision 1.3  2001/08/08 23:54:11  robertj
00247  * Fixed problem with setting gk password before have a gk variable.
00248  *
00249  * Revision 1.2  2001/08/06 03:15:17  robertj
00250  * Improved access to H.235 secure RAS functionality.
00251  *
00252  * Revision 1.1  2001/08/06 03:08:11  robertj
00253  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00254  *
00255  */
00256 
00257 #ifndef __OPAL_H323EP_H
00258 #define __OPAL_H323EP_H
00259 
00260 
00261 #include "h323con.h"
00262 #include "h235auth.h"
00263 
00264 
00265 /* The following classes have forward references to avoid including the VERY
00266    large header files for H225 and H245. If an application requires access
00267    to the protocol classes they can include them, but for simple usage their
00268    inclusion can be avoided.
00269  */
00270 class H225_EndpointType;
00271 class H225_VendorIdentifier;
00272 class H225_H221NonStandard;
00273 class H225_ServiceControlDescriptor;
00274 
00275 class H323SignalPDU;
00276 class H323ConnectionsCleaner;
00277 class H323ServiceControlSession;
00278 
00279 class OpalT120Protocol;
00280 class OpalT38Protocol;
00281 
00282 class PSTUNClient;
00283 
00284 
00285 #ifdef P_USE_PRAGMA
00286 #pragma interface
00287 #endif
00288 
00289 
00291 
00304 class H323EndPoint : public PObject
00305 {
00306   PCLASSINFO(H323EndPoint, PObject);
00307 
00308   public:
00309     enum {
00310       DefaultTcpPort = 1720
00311     };
00312 
00317     H323EndPoint();
00318 
00321     ~H323EndPoint();
00322 
00325     virtual void SetEndpointTypeInfo(
00326       H225_EndpointType & info
00327     ) const;
00328 
00331     virtual void SetVendorIdentifierInfo(
00332       H225_VendorIdentifier & info
00333     ) const;
00334 
00337     virtual void SetH221NonStandardInfo(
00338       H225_H221NonStandard & info
00339     ) const;
00341 
00342 
00353     void AddCapability(
00354       H323Capability * capability   
00355     );
00356 
00377     PINDEX SetCapability(
00378       PINDEX descriptorNum, 
00379       PINDEX simultaneous,  
00380       H323Capability * cap  
00381     );
00382 
00387     PINDEX AddAllCapabilities(
00388       PINDEX descriptorNum, 
00389       PINDEX simultaneous,  
00390       const PString & name  
00391     );
00392 
00395     void AddAllUserInputCapabilities(
00396       PINDEX descriptorNum, 
00397       PINDEX simultaneous   
00398     );
00399 
00402     void RemoveCapabilities(
00403       const PStringArray & codecNames
00404     );
00405 
00408     void ReorderCapabilities(
00409       const PStringArray & preferenceOrder
00410     );
00411 
00414     H323Capability * FindCapability(
00415       const H245_Capability & cap  
00416     ) const;
00417 
00420     H323Capability * FindCapability(
00421       const H245_DataType & dataType  
00422     ) const;
00423 
00426     H323Capability * FindCapability(
00427       H323Capability::MainTypes mainType,   
00428       unsigned subType                      
00429     ) const;
00431 
00451     BOOL UseGatekeeper(
00452       const PString & address = PString::Empty(),     
00453       const PString & identifier = PString::Empty(),  
00454       const PString & localAddress = PString::Empty() 
00455     );
00456 
00467     BOOL SetGatekeeper(
00468       const PString & address,          
00469       H323Transport * transport = NULL  
00470     );
00471 
00486     BOOL SetGatekeeperZone(
00487       const PString & address,          
00488       const PString & identifier,       
00489       H323Transport * transport = NULL  
00490     );
00491 
00501     BOOL LocateGatekeeper(
00502       const PString & identifier,       
00503       H323Transport * transport = NULL  
00504     );
00505 
00514     BOOL DiscoverGatekeeper(
00515       H323Transport * transport = NULL  
00516     );
00517 
00525     virtual H323Gatekeeper * CreateGatekeeper(
00526       H323Transport * transport  
00527     );
00528 
00531     H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00532 
00535     BOOL IsRegisteredWithGatekeeper() const;
00536 
00542     BOOL RemoveGatekeeper(
00543       int reason = -1    
00544     );
00545 
00548     virtual void SetGatekeeperPassword(
00549       const PString & password
00550     );
00551 
00554     virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00555 
00558     virtual H235Authenticators CreateAuthenticators();
00559 
00562     virtual void  OnGatekeeperConfirm();
00563 
00566     virtual void  OnGatekeeperReject();
00567 
00570     virtual void OnRegistrationConfirm();
00571 
00574     virtual void  OnRegistrationReject();
00576 
00593     BOOL StartListener(
00594       H323Listener * listener 
00595     );
00596 
00608     BOOL StartListener(
00609       const H323TransportAddress & iface 
00610     );
00611 
00628     BOOL StartListeners(
00629       const H323TransportAddressArray & ifaces 
00630     );
00631 
00635     BOOL RemoveListener(
00636       H323Listener * listener 
00637     );
00638 
00641     H323TransportAddressArray GetInterfaceAddresses(
00642       BOOL excludeLocalHost = TRUE,       
00643       H323Transport * associatedTransport = NULL
00645     );
00646 
00665     H323Connection * MakeCall(
00666       const PString & remoteParty,  
00667       PString & token,              
00668       void * userData = NULL        
00669     );
00670 
00691     H323Connection * MakeCall(
00692       const PString & remoteParty,  
00693       H323Transport * transport,    
00694       PString & token,              
00695       void * userData = NULL        
00696     );
00697 
00708     H323Connection * MakeCallLocked(
00709       const PString & remoteParty,     
00710       PString & token,                 
00711       void * userData = NULL,          
00712       H323Transport * transport = NULL 
00713     );
00714 
00736     virtual H323Connection * SetupTransfer(
00737       const PString & token,        
00738       const PString & callIdentity, 
00739       const PString & remoteParty,  
00740       PString & newToken,           
00741       void * userData = NULL        
00742     );
00743 
00749     void TransferCall(
00750       const PString & token,        
00751       const PString & remoteParty,  
00752       const PString & callIdentity = PString::Empty()
00754     );
00755 
00762     void ConsultationTransfer(
00763       const PString & primaryCallToken,   
00764       const PString & secondaryCallToken  
00765     );
00766 
00770     void HoldCall(
00771       const PString & token,        
00772       BOOL localHold   
00773     );
00774 
00778     H323Connection * IntrudeCall(
00779       const PString & remoteParty,  
00780       PString & token,              
00781       unsigned capabilityLevel,     
00782       void * userData = NULL        
00783     );
00784 
00785     H323Connection * IntrudeCall(
00786       const PString & remoteParty,  
00787       H323Transport * transport,    
00788       PString & token,              
00789       unsigned capabilityLevel,     
00790       void * userData = NULL        
00791     );
00792 
00799     BOOL ParsePartyName(
00800       const PString & party,          
00801       PString & alias,                
00802       H323TransportAddress & address  
00803     );
00804 
00809     virtual BOOL ClearCall(
00810       const PString & token,  
00811       H323Connection::CallEndReason reason =
00812                   H323Connection::EndedByLocalUser 
00813     );
00814 
00819     virtual BOOL ClearCallSynchronous(
00820       const PString & token,            
00821       H323Connection::CallEndReason reason =
00822                         H323Connection::EndedByLocalUser 
00823     );
00824     virtual BOOL ClearCallSynchronous(
00825       const PString & token,                
00826       H323Connection::CallEndReason reason, 
00827       PSyncPoint * sync
00828     );
00829 
00836     virtual void ClearAllCalls(
00837       H323Connection::CallEndReason reason =
00838                   H323Connection::EndedByLocalUser, 
00839       BOOL wait = TRUE   
00840     );
00841 
00844     virtual BOOL HasConnection(
00845       const PString & token   
00846     );
00847 
00859     H323Connection * FindConnectionWithLock(
00860       const PString & token     
00861     );
00862 
00865     PStringList GetAllConnections();
00866 
00878     virtual BOOL OnIncomingCall(
00879       H323Connection & connection,    
00880       const H323SignalPDU & setupPDU,   
00881       H323SignalPDU & alertingPDU       
00882     );
00883 
00888     virtual BOOL OnCallTransferInitiate(
00889       H323Connection & connection,    
00890       const PString & remoteParty     
00891     );
00892 
00897     virtual BOOL OnCallTransferIdentify(
00898       H323Connection & connection    
00899     );
00900 
00905     virtual void OnSendARQ(
00906       H323Connection & conn,
00907       H225_AdmissionRequest & arq
00908     );
00909 
00928     virtual H323Connection::AnswerCallResponse OnAnswerCall(
00929       H323Connection & connection,    
00930       const PString & callerName,       
00931       const H323SignalPDU & setupPDU,   
00932       H323SignalPDU & connectPDU        
00933     );
00934 
00945     virtual BOOL OnAlerting(
00946       H323Connection & connection,    
00947       const H323SignalPDU & alertingPDU,  
00948       const PString & user                
00949     );
00950 
00959     virtual BOOL OnConnectionForwarded(
00960       H323Connection & connection,    
00961       const PString & forwardParty,   
00962       const H323SignalPDU & pdu       
00963     );
00964 
00973     virtual BOOL ForwardConnection(
00974       H323Connection & connection,    
00975       const PString & forwardParty,   
00976       const H323SignalPDU & pdu       
00977     );
00978 
00985     virtual void OnConnectionEstablished(
00986       H323Connection & connection,    
00987       const PString & token           
00988     );
00989 
00992     virtual BOOL IsConnectionEstablished(
00993       const PString & token   
00994     );
00995 
01002     virtual void OnConnectionCleared(
01003       H323Connection & connection,    
01004       const PString & token           
01005     );
01006 
01011     static PString BuildConnectionToken(
01012       const H323Transport & transport,  
01013       unsigned callReference,           
01014       BOOL fromRemote                   
01015     );
01016 
01022     virtual H323Connection * OnIncomingConnection(
01023       H323Transport * transport,  
01024       H323SignalPDU & setupPDU    
01025     );
01026 
01033     virtual BOOL OnOutgoingCall(
01034         H323Connection & conn, 
01035         const H323SignalPDU & connectPDU
01036     );
01037 
01040     virtual H323Connection * CreateConnection(
01041       unsigned callReference,     
01042       void * userData,            
01043       H323Transport * transport,  
01044       H323SignalPDU * setupPDU    
01045     );
01046     virtual H323Connection * CreateConnection(
01047       unsigned callReference,   
01048       void * userData           
01049     );
01050     virtual H323Connection * CreateConnection(
01051       unsigned callReference    
01052     );
01053 
01060     virtual void CleanUpConnections();
01062 
01063 
01070     virtual BOOL OnStartLogicalChannel(
01071       H323Connection & connection,    
01072       H323Channel & channel           
01073     );
01074 
01079     virtual void OnClosedLogicalChannel(
01080       H323Connection & connection,    
01081       const H323Channel & channel     
01082     );
01083 
01091     virtual BOOL OpenAudioChannel(
01092       H323Connection & connection,  
01093       BOOL isEncoding,              
01094       unsigned bufferSize,          
01095       H323AudioCodec & codec        
01096     );
01097 
01098 #ifndef NO_H323_VIDEO
01099 
01105     virtual BOOL OpenVideoChannel(
01106       H323Connection & connection,  
01107       BOOL isEncoding,              
01108       H323VideoCodec & codec        
01109     );
01110 #endif // NO_H323_VIDEO
01111 
01119     virtual void OnRTPStatistics(
01120       const H323Connection & connection,  
01121       const RTP_Session & session         
01122     ) const;
01124 
01131     virtual void OnUserInputString(
01132       H323Connection & connection,  
01133       const PString & value         
01134     );
01135 
01140     virtual void OnUserInputTone(
01141       H323Connection & connection,  
01142       char tone,                    
01143       unsigned duration,            
01144       unsigned logicalChannel,      
01145       unsigned rtpTimestamp         
01146     );
01148 
01158     virtual void OnHTTPServiceControl(
01159       unsigned operation,  
01160       unsigned sessionId,  
01161       const PString & url  
01162     );
01163 
01173     virtual void OnCallCreditServiceControl(
01174       const PString & amount,  
01175       BOOL mode          
01176     );
01177 
01181     virtual void OnServiceControlSession(
01182       unsigned type,
01183       unsigned sessionid,
01184       const H323ServiceControlSession & session,
01185       H323Connection * connection
01186     );
01187 
01190     virtual H323ServiceControlSession * CreateServiceControlSession(
01191       const H225_ServiceControlDescriptor & contents
01192     );
01194 
01207     virtual OpalT120Protocol * CreateT120ProtocolHandler(
01208       const H323Connection & connection  
01209     ) const;
01210 
01221     virtual OpalT38Protocol * CreateT38ProtocolHandler(
01222       const H323Connection & connection  
01223     ) const;
01225 
01233     virtual BOOL OnConferenceInvite(
01234       const H323SignalPDU & setupPDU
01235     );
01236 
01242     virtual BOOL OnCallIndependentSupplementaryService(
01243       const H323SignalPDU & setupPDU
01244     );
01245 
01251     virtual BOOL OnNegotiateConferenceCapabilities(
01252       const H323SignalPDU & setupPDU
01253     );
01255 
01266     virtual void SetLocalUserName(
01267       const PString & name  
01268     );
01269 
01274     virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01275 
01282     BOOL AddAliasName(
01283       const PString & name  
01284     );
01285 
01289     BOOL RemoveAliasName(
01290       const PString & name  
01291     );
01292 
01297     const PStringList & GetAliasNames() const { return localAliasNames; }
01298 
01301     const PString & GetDefaultILSServer() const { return ilsServer; }
01302 
01305     void SetDefaultILSServer(
01306       const PString & server
01307       ) { ilsServer = server; }
01308 
01311     BOOL IsFastStartDisabled() const
01312       { return disableFastStart; }
01313 
01316     void DisableFastStart(
01317       BOOL mode 
01318     ) { disableFastStart = mode; } 
01319 
01322     BOOL IsH245TunnelingDisabled() const
01323       { return disableH245Tunneling; }
01324 
01327     void DisableH245Tunneling(
01328       BOOL mode 
01329     ) { disableH245Tunneling = mode; } 
01330 
01333     BOOL IsH245inSetupDisabled() const
01334       { return disableH245inSetup; }
01335 
01338     void DisableH245inSetup(
01339       BOOL mode 
01340     ) { disableH245inSetup = mode; } 
01341 
01344     BOOL DetectInBandDTMFDisabled() const
01345       { return disableDetectInBandDTMF; }
01346 
01349     void DisableDetectInBandDTMF(
01350       BOOL mode 
01351     ) { disableDetectInBandDTMF = mode; } 
01352 
01355     BOOL CanDisplayAmountString() const
01356       { return canDisplayAmountString; }
01357 
01360     void SetCanDisplayAmountString(
01361       BOOL mode 
01362     ) { canDisplayAmountString = mode; } 
01363 
01366     BOOL CanEnforceDurationLimit() const
01367       { return canEnforceDurationLimit; }
01368 
01371     void SetCanEnforceDurationLimit(
01372       BOOL mode 
01373     ) { canEnforceDurationLimit = mode; } 
01374 
01377     unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01378 
01381     void SetCallIntrusionProtectionLevel(
01382       unsigned level  // New level from 0 to 3
01383     ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01384 
01392     virtual BOOL SetSoundChannelPlayDevice(const PString & name);
01393     virtual BOOL SetSoundChannelPlayDriver(const PString & name);
01394 
01399     const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
01400     const PString & GetSoundChannelPlayDriver() const { return soundChannelPlayDriver; }
01401 
01409     virtual BOOL SetSoundChannelRecordDevice(const PString & name);
01410     virtual BOOL SetSoundChannelRecordDriver(const PString & name);
01411 
01416     const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
01417     const PString & GetSoundChannelRecordDriver() const { return soundChannelRecordDriver; }
01418 
01421     unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
01422 
01425     void SetSoundChannelBufferDepth(
01426       unsigned depth    // New depth
01427     );
01428 
01431     H323AudioCodec::SilenceDetectionMode GetSilenceDetectionMode() const
01432       { return defaultSilenceDetection; }
01433 
01436     void SetSilenceDetectionMode(
01437       H323AudioCodec::SilenceDetectionMode mode 
01438     ) { defaultSilenceDetection = mode; } 
01439 
01442     H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
01443 
01446     void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
01447 
01450     BOOL CanAutoStartReceiveVideo() const { return autoStartReceiveVideo; }
01451 
01454     BOOL CanAutoStartTransmitVideo() const { return autoStartTransmitVideo; }
01455 
01458     BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01459 
01462     BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01463 
01466     BOOL CanAutoCallForward() const { return autoCallForward; }
01467 
01470     const H323ListenerList & GetListeners() const { return listeners; }
01471 
01474     const H323Capabilities & GetCapabilities() const { return capabilities; }
01475 
01478     enum TerminalTypes {
01479       e_TerminalOnly = 50,
01480       e_TerminalAndMC = 70,
01481       e_GatewayOnly = 60,
01482       e_GatewayAndMC = 80,
01483       e_GatewayAndMCWithDataMP = 90,
01484       e_GatewayAndMCWithAudioMP = 100,
01485       e_GatewayAndMCWithAVMP = 110,
01486       e_GatekeeperOnly = 120,
01487       e_GatekeeperWithDataMP = 130,
01488       e_GatekeeperWithAudioMP = 140,
01489       e_GatekeeperWithAVMP = 150,
01490       e_MCUOnly = 160,
01491       e_MCUWithDataMP = 170,
01492       e_MCUWithAudioMP = 180,
01493       e_MCUWithAVMP = 190
01494     };
01495 
01498     TerminalTypes GetTerminalType() const { return terminalType; }
01499 
01502     BOOL IsTerminal() const;
01503 
01506     BOOL IsGateway() const;
01507 
01510     BOOL IsGatekeeper() const;
01511 
01514     BOOL IsMCU() const;
01515 
01519     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01520 
01524     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01525 
01528     void SetAudioJitterDelay(
01529       unsigned minDelay,   // New minimum jitter buffer delay in milliseconds
01530       unsigned maxDelay    // New maximum jitter buffer delay in milliseconds
01531     );
01532 
01535     unsigned GetInitialBandwidth() const { return initialBandwidth; }
01536 
01539     void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01540 
01543     virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &);
01544 
01547     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &);
01548 
01554     PSTUNClient * GetSTUN(
01555       const PIPSocket::Address & address = 0
01556     ) const;
01557 
01560     void SetSTUNServer(
01561       const PString & server
01562     );
01563 
01566     virtual BOOL IsLocalAddress(
01567       const PIPSocket::Address & remoteAddress
01568     ) const;
01569 
01572     virtual void TranslateTCPAddress(
01573       PIPSocket::Address & /*localAddr*/,
01574       const PIPSocket::Address & /*remoteAddr */
01575     ) { }
01576     void InternalTranslateTCPAddress(
01577       PIPSocket::Address & /*localAddr*/,
01578       const PIPSocket::Address & /*remoteAddr */
01579     );
01580 
01583     WORD GetTCPPortBase() const { return tcpPorts.base; }
01584 
01587     WORD GetTCPPortMax() const { return tcpPorts.max; }
01588 
01591     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax);
01592 
01595     WORD GetNextTCPPort();
01596 
01599     WORD GetUDPPortBase() const { return udpPorts.base; }
01600 
01603     WORD GetUDPPortMax() const { return udpPorts.max; }
01604 
01607     void SetUDPPorts(unsigned udpBase, unsigned udpMax);
01608 
01611     WORD GetNextUDPPort();
01612 
01615     WORD GetRtpIpPortBase() const { return rtpIpPorts.base; }
01616 
01619     WORD GetRtpIpPortMax() const { return rtpIpPorts.max; }
01620 
01623     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax);
01624 
01627     WORD GetRtpIpPortPair();
01628 
01631     BYTE GetRtpIpTypeofService() const { return rtpIpTypeofService; }
01632 
01635     void SetRtpIpTypeofService(unsigned tos) { rtpIpTypeofService = (BYTE)tos; }
01636 
01639     const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
01640 
01643     const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
01644 
01647     const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
01648 
01651     const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
01652 
01655     unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
01656 
01659     const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
01660 
01663     const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
01664 
01667     const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
01668 
01671     const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
01672 
01675     const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
01676 
01679     BOOL ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
01680 
01683     const PTimeInterval & GetNoMediaTimeout() const;
01684 
01687     BOOL SetNoMediaTimeout(PTimeInterval newInterval);
01688 
01691     const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
01692 
01695     unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
01696 
01699     const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
01700 
01703     unsigned GetRasRequestRetries() const { return rasRequestRetries; }
01704 
01708     const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
01709 
01712     const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01713 
01716     void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
01717 
01720     const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
01721 
01724     const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
01725 
01728     const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
01729 
01732     const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
01733 
01735     const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
01736     const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
01737     const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
01738     const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
01739     const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
01740     const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
01741 
01744     PINDEX GetCleanerThreadStackSize() const { return cleanerThreadStackSize; }
01745 
01748     PINDEX GetListenerThreadStackSize() const { return listenerThreadStackSize; }
01749 
01752     PINDEX GetSignallingThreadStackSize() const { return signallingThreadStackSize; }
01753 
01756     PINDEX GetControlThreadStackSize() const { return controlThreadStackSize; }
01757 
01760     PINDEX GetChannelThreadStackSize() const { return logicalThreadStackSize; }
01761 
01764     PINDEX GetRasThreadStackSize() const { return rasThreadStackSize; }
01765 
01768     PINDEX GetJitterThreadStackSize() const { return jitterThreadStackSize; }
01769 
01772     PThread::Priority GetChannelThreadPriority() const { return channelThreadPriority; }
01773 
01776     H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
01778 
01782     static BYTE defaultT35CountryCode;
01783     static BYTE defaultT35Extension;
01784     static WORD defaultManufacturerCode;
01785 
01786   protected:
01787     H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
01788     BOOL InternalRegisterGatekeeper(H323Gatekeeper * gk, BOOL discovered);
01789     H323Connection * FindConnectionWithoutLocks(const PString & token);
01790     virtual H323Connection * InternalMakeCall(
01791       const PString & existingToken,
01792       const PString & callIdentity, 
01793       unsigned capabilityLevel,     
01794       const PString & remoteParty,  
01795       H323Transport * transport,    
01796       PString & token,              
01797       void * userData               
01798     );
01799 
01800     // Configuration variables, commonly changed
01801     PStringList localAliasNames;
01802     PString     soundChannelPlayDevice;
01803     PString     soundChannelPlayDriver;
01804     PString     soundChannelRecordDevice;
01805     PString     soundChannelRecordDriver;
01806     PString     videoChannelPlayDevice;
01807     PString     videoChannelRecordDevice;
01808     BOOL        autoStartReceiveVideo;
01809     BOOL        autoStartTransmitVideo;
01810     BOOL        autoStartReceiveFax;
01811     BOOL        autoStartTransmitFax;
01812     BOOL        autoCallForward;
01813     BOOL        disableFastStart;
01814     BOOL        disableH245Tunneling;
01815     BOOL        disableH245inSetup;
01816     BOOL        disableDetectInBandDTMF;
01817     BOOL        canDisplayAmountString;
01818     BOOL        canEnforceDurationLimit;
01819     unsigned    callIntrusionProtectionLevel;
01820     H323AudioCodec::SilenceDetectionMode defaultSilenceDetection;
01821     H323Connection::SendUserInputModes defaultSendUserInputMode;
01822 
01823     PString     ilsServer;
01824 
01825     // Some more configuration variables, rarely changed.
01826     unsigned      soundChannelBuffers;
01827     BYTE          rtpIpTypeofService;
01828     PTimeInterval signallingChannelCallTimeout;
01829     PTimeInterval controlChannelStartTimeout;
01830     PTimeInterval endSessionTimeout;
01831     PTimeInterval masterSlaveDeterminationTimeout;
01832     unsigned      masterSlaveDeterminationRetries;
01833     PTimeInterval capabilityExchangeTimeout;
01834     PTimeInterval logicalChannelTimeout;
01835     PTimeInterval requestModeTimeout;
01836     PTimeInterval roundTripDelayTimeout;
01837     PTimeInterval roundTripDelayRate;
01838     PTimeInterval noMediaTimeout;
01839     PTimeInterval gatekeeperRequestTimeout;
01840     unsigned      gatekeeperRequestRetries;
01841     PTimeInterval rasRequestTimeout;
01842     unsigned      rasRequestRetries;
01843     PTimeInterval registrationTimeToLive;
01844     PString       gkAccessTokenOID;
01845 
01846     unsigned minAudioJitterDelay;
01847     unsigned maxAudioJitterDelay;
01848     unsigned initialBandwidth;  // in 100s of bits/sev
01849     BOOL     clearCallOnRoundTripFail;
01850 
01851     struct PortInfo {
01852       void Set(
01853         unsigned base,
01854         unsigned max,
01855         unsigned range,
01856         unsigned dflt
01857       );
01858       WORD GetNext(
01859         unsigned increment
01860       );
01861 
01862       PMutex mutex;
01863       WORD   base;
01864       WORD   max;
01865       WORD   current;
01866     } tcpPorts, udpPorts, rtpIpPorts;
01867     PSTUNClient * stun;
01868 
01869     BYTE t35CountryCode;
01870     BYTE t35Extension;
01871     WORD manufacturerCode;
01872 
01873     TerminalTypes terminalType;
01874 
01875     /* Protect against absence of a response to the ctIdentify reqest
01876        (Transferring Endpoint - Call Transfer with a secondary Call) */
01877     PTimeInterval callTransferT1;
01878     /* Protect against failure of completion of the call transfer operation
01879        involving a secondary Call (Transferred-to Endpoint) */
01880     PTimeInterval callTransferT2;
01881     /* Protect against failure of the Transferred Endpoint not responding
01882        within sufficient time to the ctInitiate APDU (Transferring Endpoint) */
01883     PTimeInterval callTransferT3;
01884     /* May optionally operate - protects against absence of a response to the
01885        ctSetup request (Transferred Endpoint) */
01886     PTimeInterval callTransferT4;
01887 
01889     PTimeInterval callIntrusionT1;
01890     PTimeInterval callIntrusionT2;
01891     PTimeInterval callIntrusionT3;
01892     PTimeInterval callIntrusionT4;
01893     PTimeInterval callIntrusionT5;
01894     PTimeInterval callIntrusionT6;
01895 
01896     PINDEX cleanerThreadStackSize;
01897     PINDEX listenerThreadStackSize;
01898     PINDEX signallingThreadStackSize;
01899     PINDEX controlThreadStackSize;
01900     PINDEX logicalThreadStackSize;
01901     PINDEX rasThreadStackSize;
01902     PINDEX jitterThreadStackSize;
01903 
01904     PThread::Priority channelThreadPriority;
01905 
01906     // Dynamic variables
01907     H323ListenerList listeners;
01908     H323Capabilities capabilities;
01909     H323Gatekeeper * gatekeeper;
01910     PString          gatekeeperPassword;
01911 
01912     H323ConnectionDict       connectionsActive;
01913     H323CallIdentityDict     secondaryConnectionsActive;
01914     PMutex                   connectionsMutex;
01915     PMutex                   noMediaMutex;
01916     PStringSet               connectionsToBeCleaned;
01917     H323ConnectionsCleaner * connectionsCleaner;
01918     PSyncPoint               connectionsAreCleaned;
01919 };
01920 
01921 
01922 #endif // __OPAL_H323EP_H
01923 
01924 

Generated on Mon Sep 26 15:44:46 2005 for OpenH323 by  doxygen 1.4.4