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 2.31  2006/01/02 15:52:38  dsandras
00031  * Added what was required to merge changes from OpenH323 Altas_devel_2 in gkclient.cxx, gkserver.cxx and channels.cxx.
00032  *
00033  * Revision 2.30  2005/11/30 13:35:26  csoutheren
00034  * Changed tags for Doxygen
00035  *
00036  * Revision 2.29  2005/07/12 12:34:37  csoutheren
00037  * Fixes for H.450 errors and return values
00038  * Thanks to Iker Perez San Roman
00039  *
00040  * Revision 2.28  2005/07/11 01:52:23  csoutheren
00041  * Extended AnsweringCall to work for SIP as well as H.323
00042  * Fixed problems with external RTP connection in H.323
00043  * Added call to OnClosedMediaStream
00044  *
00045  * Revision 2.27  2004/09/01 12:21:27  rjongbloed
00046  * Added initialisation of H323EndPoints capability table to be all codecs so can
00047  *   correctly build remote caps from fqast connect params. This had knock on effect
00048  *   with const keywords added in numerous places.
00049  *
00050  * Revision 2.26  2004/08/14 07:56:28  rjongbloed
00051  * Major revision to utilise the PSafeCollection classes for the connections and calls.
00052  *
00053  * Revision 2.25  2004/07/11 12:42:09  rjongbloed
00054  * Added function on endpoints to get the list of all media formats any
00055  *   connection the endpoint may create can support.
00056  *
00057  * Revision 2.24  2004/06/05 14:31:32  rjongbloed
00058  * Added function to set gatekeeper registration time to live.
00059  * Added ability to have separate gatekeeper username to endpoint local alias name.
00060  *
00061  * Revision 2.23  2004/06/04 06:54:17  csoutheren
00062  * Migrated updates from OpenH323 1.14.1
00063  *
00064  * Revision 2.22  2004/02/24 09:40:27  rjongbloed
00065  * Fixed missing return in GetSTUN()
00066  *
00067  * Revision 2.21  2004/02/19 10:46:44  rjongbloed
00068  * Merged OpenH323 version 1.13.1 changes.
00069  *
00070  * Revision 2.20  2003/03/06 03:57:46  robertj
00071  * IVR support (work in progress) requiring large changes everywhere.
00072  *
00073  * Revision 2.19  2003/01/07 04:39:52  robertj
00074  * Updated to OpenH323 v1.11.2
00075  *
00076  * Revision 2.18  2002/11/10 11:33:16  robertj
00077  * Updated to OpenH323 v1.10.3
00078  *
00079  * Revision 2.17  2002/09/16 02:52:33  robertj
00080  * Added #define so can select if #pragma interface/implementation is used on
00081  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00082  *
00083  * Revision 2.16  2002/09/10 07:42:40  robertj
00084  * Added function to get gatekeeper password.
00085  *
00086  * Revision 2.15  2002/09/06 02:39:27  robertj
00087  * Added function to set gatekeeper access token OID.
00088  *
00089  * Revision 2.14  2002/09/04 06:01:46  robertj
00090  * Updated to OpenH323 v1.9.6
00091  *
00092  * Revision 2.13  2002/07/04 07:41:46  robertj
00093  * Fixed memory/thread leak of transports.
00094  *
00095  * Revision 2.12  2002/07/01 04:56:29  robertj
00096  * Updated to OpenH323 v1.9.1
00097  *
00098  * Revision 2.11  2002/03/22 06:57:48  robertj
00099  * Updated to OpenH323 version 1.8.2
00100  *
00101  * Revision 2.10  2002/03/18 00:33:36  robertj
00102  * Removed duplicate initialBandwidth variable in H.323 class, moved to ancestor.
00103  *
00104  * Revision 2.9  2002/02/11 09:32:11  robertj
00105  * Updated to openH323 v1.8.0
00106  *
00107  * Revision 2.8  2002/01/22 04:59:04  robertj
00108  * Update from OpenH323, RFC2833 support
00109  *
00110  * Revision 2.7  2002/01/14 06:35:57  robertj
00111  * Updated to OpenH323 v1.7.9
00112  *
00113  * Revision 2.6  2001/11/13 06:25:56  robertj
00114  * Changed SetUpConnection() so returns BOOL as returning
00115  *   pointer to connection is not useful.
00116  *
00117  * Revision 2.5  2001/11/02 10:45:19  robertj
00118  * Updated to OpenH323 v1.7.3
00119  *
00120  * Revision 2.4  2001/10/05 00:22:13  robertj
00121  * Updated to PWLib 1.2.0 and OpenH323 1.7.0
00122  *
00123  * Revision 2.3  2001/08/17 08:21:15  robertj
00124  * Update from OpenH323
00125  * Moved call end reasons enum from OpalConnection to global.
00126  *
00127  * Revision 2.2  2001/08/01 05:10:40  robertj
00128  * Moved media formats list from endpoint to connection.
00129  *
00130  * Revision 2.1  2001/07/30 07:22:25  robertj
00131  * Abstracted listener management from H.323 to OpalEndPoint class.
00132  *
00133  * Revision 2.0  2001/07/27 15:48:24  robertj
00134  * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL)
00135  *
00136  * Revision 1.56  2003/12/29 04:58:55  csoutheren
00137  * Added callbacks on H323EndPoint when gatekeeper discovery succeeds or fails
00138  *
00139  * Revision 1.55  2003/12/28 02:52:15  csoutheren
00140  * Added virtual to a few functions
00141  *
00142  * Revision 1.54  2003/12/28 02:38:14  csoutheren
00143  * Added H323EndPoint::OnOutgoingCall
00144  *
00145  * Revision 1.53  2003/12/28 00:07:10  csoutheren
00146  * Added callbacks on H323EndPoint when gatekeeper registration succeeds or fails
00147  *
00148  * Revision 1.52  2003/04/24 01:49:33  dereks
00149  * Add ability to set no media timeout interval
00150  *
00151  * Revision 1.51  2003/04/10 09:39:48  robertj
00152  * Added associated transport to new GetInterfaceAddresses() function so
00153  *   interfaces can be ordered according to active transport links. Improves
00154  *   interoperability.
00155  *
00156  * Revision 1.50  2003/04/10 01:05:11  craigs
00157  * Added functions to access to lists of interfaces
00158  *
00159  * Revision 1.49  2003/04/07 13:09:25  robertj
00160  * Added ILS support to callto URL parsing in MakeCall(), ie can now call hosts
00161  *   registered with an ILS directory.
00162  *
00163  * Revision 1.48  2003/02/13 00:11:31  robertj
00164  * Added missing virtual for controlling call transfer, thanks Andrey Pinaev
00165  *
00166  * Revision 1.47  2003/02/09 00:48:06  robertj
00167  * Added function to return if registered with gatekeeper.
00168  *
00169  * Revision 1.46  2003/02/04 07:06:41  robertj
00170  * Added STUN support.
00171  *
00172  * Revision 1.45  2003/01/26 05:57:58  robertj
00173  * Changed ParsePartyName so will accept addresses of the form
00174  *   alias@gk:address which will do an LRQ call to "address" using "alias"
00175  *   to determine the IP address to connect to.
00176  *
00177  * Revision 1.44  2003/01/23 02:36:30  robertj
00178  * Increased (and made configurable) timeout for H.245 channel TCP connection.
00179  *
00180  * Revision 1.43  2002/11/28 01:19:55  craigs
00181  * Added virtual to several functions
00182  *
00183  * Revision 1.42  2002/11/27 06:54:52  robertj
00184  * Added Service Control Session management as per Annex K/H.323 via RAS
00185  *   only at this stage.
00186  * Added H.248 ASN and very primitive infrastructure for linking into the
00187  *   Service Control Session management system.
00188  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00189  * Added Call Credit Service Control to display account balances.
00190  *
00191  * Revision 1.41  2002/11/15 05:17:22  robertj
00192  * Added facility redirect support without changing the call token for access
00193  *   to the call. If it gets redirected a new H323Connection object is
00194  *   created but it looks like the same thing to an application.
00195  *
00196  * Revision 1.40  2002/11/10 08:10:43  robertj
00197  * Moved constants for "well known" ports to better place (OPAL change).
00198  *
00199  * Revision 1.39  2002/10/31 00:32:15  robertj
00200  * Enhanced jitter buffer system so operates dynamically between minimum and
00201  *   maximum values. Altered API to assure app writers note the change!
00202  *
00203  * Revision 1.38  2002/10/23 06:06:10  robertj
00204  * Added function to be smarter in using a gatekeeper for use by endpoint.
00205  *
00206  * Revision 1.37  2002/10/21 06:07:44  robertj
00207  * Added function to set gatekeeper access token OID.
00208  *
00209  * Revision 1.36  2002/09/16 01:14:15  robertj
00210  * Added #define so can select if #pragma interface/implementation is used on
00211  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00212  *
00213  * Revision 1.35  2002/09/10 06:32:25  robertj
00214  * Added function to get gatekeeper password.
00215  *
00216  * Revision 1.34  2002/09/03 06:19:36  robertj
00217  * Normalised the multi-include header prevention ifdef/define symbol.
00218  *
00219  * Revision 1.33  2002/07/19 03:39:19  robertj
00220  * Bullet proofed setting of RTP IP port base, can't be zero!
00221  *
00222  * Revision 1.32  2002/07/18 01:50:10  robertj
00223  * Changed port secltion code to force apps to use function interface.
00224  *
00225  * Revision 1.31  2002/06/22 05:48:38  robertj
00226  * Added partial implementation for H.450.11 Call Intrusion
00227  *
00228  * Revision 1.30  2002/06/13 06:15:19  robertj
00229  * Allowed TransferCall() to be used on H323Connection as well as H323EndPoint.
00230  *
00231  * Revision 1.29  2002/06/12 03:55:21  robertj
00232  * Added function to add/remove multiple listeners in one go comparing against
00233  *   what is already running so does not interrupt unchanged listeners.
00234  *
00235  * Revision 1.28  2002/05/29 06:40:29  robertj
00236  * Changed sending of endSession/ReleaseComplete PDU's to occur immediately
00237  *   on call clearance and not wait for background thread to do it.
00238  * Stricter compliance by waiting for reply endSession before closing down.
00239  *
00240  * Revision 1.27  2002/05/28 06:15:09  robertj
00241  * Split UDP (for RAS) from RTP port bases.
00242  * Added current port variable so cycles around the port range specified which
00243  *   fixes some wierd problems on some platforms, thanks Federico Pinna
00244  *
00245  * Revision 1.26  2002/05/17 03:38:05  robertj
00246  * Fixed problems with H.235 authentication on RAS for server and client.
00247  *
00248  * Revision 1.25  2002/05/16 00:03:05  robertj
00249  * Added function to get the tokens for all active calls.
00250  * Improved documentation for use of T.38 and T.120 functions.
00251  *
00252  * Revision 1.24  2002/05/15 08:59:18  rogerh
00253  * Update comments
00254  *
00255  * Revision 1.23  2002/05/03 05:38:15  robertj
00256  * Added Q.931 Keypad IE mechanism for user indications (DTMF).
00257  *
00258  * Revision 1.22  2002/05/02 07:56:24  robertj
00259  * Added automatic clearing of call if no media (RTP data) is transferred in a
00260  *   configurable (default 5 minutes) amount of time.
00261  *
00262  * Revision 1.21  2002/04/18 01:41:07  robertj
00263  * Fixed bad variable name for disabling DTMF detection, very confusing.
00264  *
00265  * Revision 1.20  2002/04/17 00:49:56  robertj
00266  * Added ability to disable the in band DTMF detection.
00267  *
00268  * Revision 1.19  2002/04/10 06:48:47  robertj
00269  * Added functions to set port member variables.
00270  *
00271  * Revision 1.18  2002/03/14 03:49:38  dereks
00272  * Fix minor documentation error.
00273  *
00274  * Revision 1.17  2002/02/04 07:17:52  robertj
00275  * Added H.450.2 Consultation Transfer, thanks Norwood Systems.
00276  *
00277  * Revision 1.16  2002/01/24 06:29:02  robertj
00278  * Added option to disable H.245 negotiation in SETUP pdu, this required
00279  *   API change so have a bit mask instead of a series of booleans.
00280  *
00281  * Revision 1.15  2002/01/17 07:04:58  robertj
00282  * Added support for RFC2833 embedded DTMF in the RTP stream.
00283  *
00284  * Revision 1.14  2002/01/13 23:59:43  robertj
00285  * Added CallTransfer timeouts to endpoint, hanks Ben Madsen of Norwood Systems.
00286  *
00287  * Revision 1.13  2002/01/08 04:45:35  robertj
00288  * Added MakeCallLocked() so can start a call with the H323Connection instance
00289  *   initally locked so can do things to it before the call really starts.
00290  *
00291  * Revision 1.12  2001/12/22 03:20:44  robertj
00292  * Added create protocol function to H323Connection.
00293  *
00294  * Revision 1.11  2001/12/13 10:55:30  robertj
00295  * Added gatekeeper access token OID specification for auto inclusion of
00296  *   access tokens frm ACF to SETUP pdu.
00297  *
00298  * Revision 1.10  2001/11/09 05:39:54  craigs
00299  * Added initial T.38 support thanks to Adam Lazur
00300  *
00301  * Revision 1.9  2001/11/01 00:27:33  robertj
00302  * Added default Fast Start disabled and H.245 tunneling disable flags
00303  *   to the endpoint instance.
00304  *
00305  * Revision 1.8  2001/09/11 01:24:36  robertj
00306  * Added conditional compilation to remove video and/or audio codecs.
00307  *
00308  * Revision 1.7  2001/09/11 00:21:21  robertj
00309  * Fixed missing stack sizes in endpoint for cleaner thread and jitter thread.
00310  *
00311  * Revision 1.6  2001/08/24 14:03:26  rogerh
00312  * Fix some spelling mistakes
00313  *
00314  * Revision 1.5  2001/08/16 07:49:16  robertj
00315  * Changed the H.450 support to be more extensible. Protocol handlers
00316  *   are now in separate classes instead of all in H323Connection.
00317  *
00318  * Revision 1.4  2001/08/10 11:03:49  robertj
00319  * Major changes to H.235 support in RAS to support server.
00320  *
00321  * Revision 1.3  2001/08/08 23:54:11  robertj
00322  * Fixed problem with setting gk password before have a gk variable.
00323  *
00324  * Revision 1.2  2001/08/06 03:15:17  robertj
00325  * Improved access to H.235 secure RAS functionality.
00326  *
00327  * Revision 1.1  2001/08/06 03:08:11  robertj
00328  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00329  */
00330 
00331 #ifndef __OPAL_H323EP_H
00332 #define __OPAL_H323EP_H
00333 
00334 #ifdef P_USE_PRAGMA
00335 #pragma interface
00336 #endif
00337 
00338 
00339 #include <opal/endpoint.h>
00340 #include <opal/manager.h>
00341 #include <opal/call.h>
00342 #include <opal/transports.h>
00343 #include <h323/h323con.h>
00344 #include <h323/h323caps.h>
00345 #include <h323/h235auth.h>
00346 
00347 
00348 class H225_EndpointType;
00349 class H225_VendorIdentifier;
00350 class H225_H221NonStandard;
00351 class H225_ServiceControlDescriptor;
00352 
00353 class H235SecurityInfo;
00354 
00355 class H323Gatekeeper;
00356 class H323SignalPDU;
00357 class H323ServiceControlSession;
00358 
00359 class PSTUNClient;
00360 
00361 
00363 
00376 class H323EndPoint : public OpalEndPoint
00377 {
00378   PCLASSINFO(H323EndPoint, OpalEndPoint);
00379 
00380   public:
00381     enum {
00382       DefaultTcpPort = 1720
00383     };
00384 
00389     H323EndPoint(
00390       OpalManager & manager
00391     );
00392 
00395     ~H323EndPoint();
00397 
00429     virtual BOOL MakeConnection(
00430       OpalCall & call,        
00431       const PString & party,  
00432       void * userData = NULL  
00433     );
00434 
00444     virtual OpalMediaFormatList GetMediaFormats() const;
00446 
00451     virtual void SetEndpointTypeInfo(
00452       H225_EndpointType & info
00453     ) const;
00454 
00457     virtual void SetVendorIdentifierInfo(
00458       H225_VendorIdentifier & info
00459     ) const;
00460 
00463     virtual void SetH221NonStandardInfo(
00464       H225_H221NonStandard & info
00465     ) const;
00467 
00468 
00479     void AddCapability(
00480       H323Capability * capability   
00481     );
00482 
00503     PINDEX SetCapability(
00504       PINDEX descriptorNum, 
00505       PINDEX simultaneous,  
00506       H323Capability * cap  
00507     );
00508 
00513     PINDEX AddAllCapabilities(
00514       PINDEX descriptorNum, 
00515       PINDEX simultaneous,  
00516       const PString & name  
00517     );
00518 
00521     void AddAllUserInputCapabilities(
00522       PINDEX descriptorNum, 
00523       PINDEX simultaneous   
00524     );
00525 
00528     void RemoveCapabilities(
00529       const PStringArray & codecNames
00530     );
00531 
00534     void ReorderCapabilities(
00535       const PStringArray & preferenceOrder
00536     );
00537 
00540     H323Capability * FindCapability(
00541       const H245_Capability & cap  
00542     ) const;
00543 
00546     H323Capability * FindCapability(
00547       const H245_DataType & dataType  
00548     ) const;
00549 
00552     H323Capability * FindCapability(
00553       H323Capability::MainTypes mainType,   
00554       unsigned subType                      
00555     ) const;
00557 
00577     BOOL UseGatekeeper(
00578       const PString & address = PString::Empty(),     
00579       const PString & identifier = PString::Empty(),  
00580       const PString & localAddress = PString::Empty() 
00581     );
00582 
00593     BOOL SetGatekeeper(
00594       const PString & address,          
00595       H323Transport * transport = NULL  
00596     );
00597 
00612     BOOL SetGatekeeperZone(
00613       const PString & address,          
00614       const PString & identifier,       
00615       H323Transport * transport = NULL  
00616     );
00617 
00627     BOOL LocateGatekeeper(
00628       const PString & identifier,       
00629       H323Transport * transport = NULL  
00630     );
00631 
00640     BOOL DiscoverGatekeeper(
00641       H323Transport * transport = NULL  
00642     );
00643 
00651     virtual H323Gatekeeper * CreateGatekeeper(
00652       H323Transport * transport  
00653     );
00654 
00657     H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00658 
00661     BOOL IsRegisteredWithGatekeeper() const;
00662 
00668     BOOL RemoveGatekeeper(
00669       int reason = -1    
00670     );
00671 
00674     virtual void SetGatekeeperPassword(
00675       const PString & password,
00676       const PString & username = PString::Empty()
00677     );
00678 
00681     virtual const PString & GetGatekeeperUsername() const { return gatekeeperUsername; }
00682 
00685     virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00686 
00689     virtual H235Authenticators CreateAuthenticators();
00690 
00693     virtual void  OnGatekeeperConfirm();
00694 
00697     virtual void  OnGatekeeperReject();
00698 
00701     virtual void OnRegistrationConfirm();
00702 
00705     virtual void  OnRegistrationReject();
00707 
00712     virtual BOOL NewIncomingConnection(
00713       OpalTransport * transport  
00714     );
00715 
00718     virtual H323Connection * CreateConnection(
00719       OpalCall & call,           
00720       const PString & token,     
00721       void * userData,           
00722       OpalTransport & transport, 
00723       const PString & alias,     
00724       const H323TransportAddress & address,   
00725       H323SignalPDU * setupPDU   
00726     );
00727 
00743     virtual BOOL SetupTransfer(
00744       const PString & token,        
00745       const PString & callIdentity, 
00746       const PString & remoteParty,  
00747       void * userData = NULL        
00748     );
00749 
00755     void TransferCall(
00756       const PString & token,        
00757       const PString & remoteParty,  
00758       const PString & callIdentity = PString::Empty()
00760     );
00761 
00768     void ConsultationTransfer(
00769       const PString & primaryCallToken,   
00770       const PString & secondaryCallToken  
00771     );
00772 
00776     void HoldCall(
00777       const PString & token,        
00778       BOOL localHold   
00779     );
00780 
00784     BOOL IntrudeCall(
00785       const PString & remoteParty,  
00786       unsigned capabilityLevel,     
00787       void * userData = NULL        
00788     );
00789 
00796     BOOL ParsePartyName(
00797       const PString & party,          
00798       PString & alias,                
00799       H323TransportAddress & address  
00800     );
00801 
00812     PSafePtr<H323Connection> FindConnectionWithLock(
00813       const PString & token,     
00814       PSafetyMode mode = PSafeReadWrite
00815     );
00816 
00828     virtual BOOL OnIncomingCall(
00829       H323Connection & connection,    
00830       const H323SignalPDU & setupPDU,   
00831       H323SignalPDU & alertingPDU       
00832     );
00833 
00840     virtual BOOL OnOutgoingCall(
00841         H323Connection & conn, 
00842         const H323SignalPDU & connectPDU
00843     );
00844 
00849     virtual BOOL OnCallTransferInitiate(
00850       H323Connection & connection,    
00851       const PString & remoteParty     
00852     );
00853 
00858     virtual BOOL OnCallTransferIdentify(
00859       H323Connection & connection    
00860     );
00861 
00866     virtual void OnSendARQ(
00867       H323Connection & conn,
00868       H225_AdmissionRequest & arq
00869     );
00870 
00877     virtual OpalConnection::AnswerCallResponse OnAnswerCall(
00878       H323Connection & connection,    
00879       const PString & callerName,       
00880       const H323SignalPDU & setupPDU,   
00881       H323SignalPDU & connectPDU        
00882     );
00883     virtual OpalConnection::AnswerCallResponse OnAnswerCall(
00884        OpalConnection & connection,
00885        const PString & caller
00886     );
00887 
00898     virtual BOOL OnAlerting(
00899       H323Connection & connection,    
00900       const H323SignalPDU & alertingPDU,  
00901       const PString & user                
00902     );
00903 
00912     virtual BOOL OnConnectionForwarded(
00913       H323Connection & connection,    
00914       const PString & forwardParty,   
00915       const H323SignalPDU & pdu       
00916     );
00917 
00926     virtual BOOL ForwardConnection(
00927       H323Connection & connection,    
00928       const PString & forwardParty,   
00929       const H323SignalPDU & pdu       
00930     );
00931 
00938     virtual void OnConnectionEstablished(
00939       H323Connection & connection,    
00940       const PString & token           
00941     );
00942 
00945     virtual BOOL IsConnectionEstablished(
00946       const PString & token   
00947     );
00948 
00955     virtual void OnConnectionCleared(
00956       H323Connection & connection,    
00957       const PString & token           
00958     );
00960 
00961 
00968     virtual BOOL OnStartLogicalChannel(
00969       H323Connection & connection,    
00970       H323Channel & channel           
00971     );
00972 
00977     virtual void OnClosedLogicalChannel(
00978       H323Connection & connection,    
00979       const H323Channel & channel     
00980     );
00981 
00989     virtual void OnRTPStatistics(
00990       const H323Connection & connection,  
00991       const RTP_Session & session         
00992     ) const;
00993 
00999     virtual void OnGatekeeperNATDetect(
01000       PIPSocket::Address publicAddr,         
01001       PString & gkIdentifier,                
01002       H323TransportAddress & gkRouteAddress  
01003     );
01005 
01015     virtual void OnHTTPServiceControl(
01016       unsigned operation,  
01017       unsigned sessionId,  
01018       const PString & url  
01019     );
01020 
01030     virtual void OnCallCreditServiceControl(
01031       const PString & amount,  
01032       BOOL mode          
01033     );
01034 
01038     virtual void OnServiceControlSession(
01039       unsigned type,
01040       unsigned sessionid,
01041       const H323ServiceControlSession & session,
01042       H323Connection * connection
01043     );
01044 
01047     virtual H323ServiceControlSession * CreateServiceControlSession(
01048       const H225_ServiceControlDescriptor & contents
01049     );
01051 
01059     virtual BOOL OnConferenceInvite(
01060       const H323SignalPDU & setupPDU
01061     );
01062 
01068     virtual BOOL OnCallIndependentSupplementaryService(
01069       const H323SignalPDU & setupPDU
01070     );
01071 
01077     virtual BOOL OnNegotiateConferenceCapabilities(
01078       const H323SignalPDU & setupPDU
01079     );
01081 
01092     virtual void SetLocalUserName(
01093       const PString & name  
01094     );
01095 
01100     virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01101 
01108     BOOL AddAliasName(
01109       const PString & name  
01110     );
01111 
01115     BOOL RemoveAliasName(
01116       const PString & name  
01117     );
01118 
01123     const PStringList & GetAliasNames() const { return localAliasNames; }
01124 
01127     const PString & GetDefaultILSServer() const { return manager.GetDefaultILSServer(); }
01128 
01131     void SetDefaultILSServer(
01132       const PString & server
01133     ) { manager.SetDefaultILSServer(server); }
01134 
01137     BOOL IsFastStartDisabled() const
01138       { return disableFastStart; }
01139 
01142     void DisableFastStart(
01143       BOOL mode 
01144     ) { disableFastStart = mode; } 
01145 
01148     BOOL IsH245TunnelingDisabled() const
01149       { return disableH245Tunneling; }
01150 
01153     void DisableH245Tunneling(
01154       BOOL mode 
01155     ) { disableH245Tunneling = mode; } 
01156 
01159     BOOL IsH245inSetupDisabled() const
01160       { return disableH245inSetup; }
01161 
01164     void DisableH245inSetup(
01165       BOOL mode 
01166     ) { disableH245inSetup = mode; } 
01167 
01170     BOOL CanDisplayAmountString() const
01171       { return canDisplayAmountString; }
01172 
01175     void SetCanDisplayAmountString(
01176       BOOL mode 
01177     ) { canDisplayAmountString = mode; } 
01178 
01181     BOOL CanEnforceDurationLimit() const
01182       { return canEnforceDurationLimit; }
01183 
01186     void SetCanEnforceDurationLimit(
01187       BOOL mode 
01188     ) { canEnforceDurationLimit = mode; } 
01189 
01192     unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01193 
01196     void SetCallIntrusionProtectionLevel(
01197       unsigned level  
01198     ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01199 
01202     virtual void OnReceivedInitiateReturnError();
01203 
01206     H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
01207 
01210     void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
01211 
01214     BOOL CanAutoStartReceiveVideo() const { return manager.CanAutoStartReceiveVideo(); }
01215 
01218     BOOL CanAutoStartTransmitVideo() const { return manager.CanAutoStartTransmitVideo(); }
01219 
01222     BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01223 
01226     BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01227 
01230     BOOL CanAutoCallForward() const { return autoCallForward; }
01231 
01234     const H323Capabilities & GetCapabilities() const;
01235 
01238     enum TerminalTypes {
01239       e_TerminalOnly = 50,
01240       e_TerminalAndMC = 70,
01241       e_GatewayOnly = 60,
01242       e_GatewayAndMC = 80,
01243       e_GatewayAndMCWithDataMP = 90,
01244       e_GatewayAndMCWithAudioMP = 100,
01245       e_GatewayAndMCWithAVMP = 110,
01246       e_GatekeeperOnly = 120,
01247       e_GatekeeperWithDataMP = 130,
01248       e_GatekeeperWithAudioMP = 140,
01249       e_GatekeeperWithAVMP = 150,
01250       e_MCUOnly = 160,
01251       e_MCUWithDataMP = 170,
01252       e_MCUWithAudioMP = 180,
01253       e_MCUWithAVMP = 190
01254     };
01255 
01258     TerminalTypes GetTerminalType() const { return terminalType; }
01259 
01262     BOOL IsTerminal() const;
01263 
01266     BOOL IsGateway() const;
01267 
01270     BOOL IsGatekeeper() const;
01271 
01274     BOOL IsMCU() const;
01275 
01279     unsigned GetMinAudioJitterDelay() const { return manager.GetMinAudioJitterDelay(); }
01280 
01284     unsigned GetMaxAudioJitterDelay() const { return manager.GetMaxAudioJitterDelay(); }
01285 
01288     void SetAudioJitterDelay(
01289       unsigned minDelay,   
01290       unsigned maxDelay    
01291     ) { manager.SetAudioJitterDelay(minDelay, maxDelay); }
01292 
01295     unsigned GetInitialBandwidth() const { return initialBandwidth; }
01296 
01299     void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01300 
01306     PSTUNClient * GetSTUN(
01307       const PIPSocket::Address & address = 0
01308     ) const { return manager.GetSTUN(address); }
01309 
01312     void SetSTUNServer(
01313       const PString & server
01314     ) { manager.SetSTUNServer(server); }
01315 
01318     virtual BOOL IsLocalAddress(
01319       const PIPSocket::Address & remoteAddress
01320     ) const { return manager.IsLocalAddress(remoteAddress); }
01321 
01324     virtual void TranslateTCPAddress(
01325       PIPSocket::Address & localAddr,
01326       const PIPSocket::Address & remoteAddr
01327     );
01328 
01331     WORD GetTCPPortBase() const { return manager.GetTCPPortBase(); }
01332 
01335     WORD GetTCPPortMax() const { return manager.GetTCPPortMax(); }
01336 
01339     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax) { manager.SetTCPPorts(tcpBase, tcpMax); }
01340 
01343     WORD GetNextTCPPort() { return manager.GetNextTCPPort(); }
01344 
01347     WORD GetUDPPortBase() const { return manager.GetUDPPortBase(); }
01348 
01351     WORD GetUDPPortMax() const { return manager.GetUDPPortMax(); }
01352 
01355     void SetUDPPorts(unsigned udpBase, unsigned udpMax) { manager.SetUDPPorts(udpBase, udpMax); }
01356 
01359     WORD GetNextUDPPort() { return manager.GetNextUDPPort(); }
01360 
01363     WORD GetRtpIpPortBase() const { return manager.GetRtpIpPortBase(); }
01364 
01367     WORD GetRtpIpPortMax() const { return manager.GetRtpIpPortMax(); }
01368 
01371     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax) { manager.SetRtpIpPorts(udpBase, udpMax); }
01372 
01375     WORD GetRtpIpPortPair() { return manager.GetRtpIpPortPair(); }
01376 
01379     BYTE GetRtpIpTypeofService() const { return manager.GetRtpIpTypeofService(); }
01380 
01383     void SetRtpIpTypeofService(unsigned tos) { manager.SetRtpIpTypeofService(tos); }
01384 
01387     const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
01388 
01391     const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
01392 
01395     const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
01396 
01399     const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
01400 
01403     unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
01404 
01407     const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
01408 
01411     const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
01412 
01415     const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
01416 
01419     const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
01420 
01423     const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
01424 
01427     BOOL ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
01428 
01431     const PTimeInterval & GetNoMediaTimeout() const { return manager.GetNoMediaTimeout(); }
01432 
01435     BOOL SetNoMediaTimeout(
01436       const PTimeInterval & newInterval  
01437     ) { return manager.SetNoMediaTimeout(newInterval); }
01438 
01441     const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
01442 
01445     unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
01446 
01449     const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
01450 
01453     unsigned GetRasRequestRetries() const { return rasRequestRetries; }
01454 
01458     const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
01459 
01463     void SetGatekeeperTimeToLive(const PTimeInterval & ttl) { registrationTimeToLive = ttl; }
01464 
01467     const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01468 
01471     void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
01472 
01475     const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
01476 
01479     const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
01480 
01483     const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
01484 
01487     const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
01488 
01490     const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
01491     const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
01492     const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
01493     const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
01494     const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
01495     const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
01496 
01499     H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
01500 
01503     unsigned GetNextH450CallIdentityValue() const { return ++nextH450CallIdentity; }
01504 
01506 
01510     static BYTE defaultT35CountryCode;
01511     static BYTE defaultT35Extension;
01512     static WORD defaultManufacturerCode;
01513 
01514   protected:
01515     H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
01516     BOOL InternalRegisterGatekeeper(H323Gatekeeper * gk, BOOL discovered);
01517     BOOL InternalMakeCall(
01518       OpalCall & call,
01519       const PString & existingToken,
01520       const PString & callIdentity, 
01521       unsigned capabilityLevel,     
01522       const PString & remoteParty,  
01523       void * userData               
01524     );
01525 
01526     // Configuration variables, commonly changed
01527     PStringList localAliasNames;
01528     BOOL        autoStartReceiveFax;
01529     BOOL        autoStartTransmitFax;
01530     BOOL        autoCallForward;
01531     BOOL        disableFastStart;
01532     BOOL        disableH245Tunneling;
01533     BOOL        disableH245inSetup;
01534     BOOL        canDisplayAmountString;
01535     BOOL        canEnforceDurationLimit;
01536     unsigned    callIntrusionProtectionLevel;
01537     H323Connection::SendUserInputModes defaultSendUserInputMode;
01538 
01539     BYTE          t35CountryCode;
01540     BYTE          t35Extension;
01541     WORD          manufacturerCode;
01542     TerminalTypes terminalType;
01543 
01544     BOOL          clearCallOnRoundTripFail;
01545 
01546     // Some more configuration variables, rarely changed.
01547     PTimeInterval signallingChannelCallTimeout;
01548     PTimeInterval controlChannelStartTimeout;
01549     PTimeInterval endSessionTimeout;
01550     PTimeInterval masterSlaveDeterminationTimeout;
01551     unsigned      masterSlaveDeterminationRetries;
01552     PTimeInterval capabilityExchangeTimeout;
01553     PTimeInterval logicalChannelTimeout;
01554     PTimeInterval requestModeTimeout;
01555     PTimeInterval roundTripDelayTimeout;
01556     PTimeInterval roundTripDelayRate;
01557     PTimeInterval gatekeeperRequestTimeout;
01558     unsigned      gatekeeperRequestRetries;
01559     PTimeInterval rasRequestTimeout;
01560     unsigned      rasRequestRetries;
01561     PTimeInterval registrationTimeToLive;
01562 
01563     PString       gkAccessTokenOID;
01564 
01565     /* Protect against absence of a response to the ctIdentify reqest
01566        (Transferring Endpoint - Call Transfer with a secondary Call) */
01567     PTimeInterval callTransferT1;
01568     /* Protect against failure of completion of the call transfer operation
01569        involving a secondary Call (Transferred-to Endpoint) */
01570     PTimeInterval callTransferT2;
01571     /* Protect against failure of the Transferred Endpoint not responding
01572        within sufficient time to the ctInitiate APDU (Transferring Endpoint) */
01573     PTimeInterval callTransferT3;
01574     /* May optionally operate - protects against absence of a response to the
01575        ctSetup request (Transferred Endpoint) */
01576     PTimeInterval callTransferT4;
01577 
01579     PTimeInterval callIntrusionT1;
01580     PTimeInterval callIntrusionT2;
01581     PTimeInterval callIntrusionT3;
01582     PTimeInterval callIntrusionT4;
01583     PTimeInterval callIntrusionT5;
01584     PTimeInterval callIntrusionT6;
01585 
01586     // Dynamic variables
01587     mutable H323Capabilities capabilities;
01588     H323Gatekeeper *     gatekeeper;
01589     PString              gatekeeperUsername;
01590     PString              gatekeeperPassword;
01591     H323CallIdentityDict secondaryConnectionsActive;
01592 
01593     mutable PAtomicInteger nextH450CallIdentity;
01595 
01596 };
01597 
01598 
01599 #endif // __OPAL_H323EP_H
01600 
01601 

Generated on Mon Sep 25 16:19:59 2006 for OPAL by  doxygen 1.4.7