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.50  2007/06/29 06:59:56  rjongbloed
00031  * Major improvement to the "product info", normalising H.221 and User-Agent mechanisms.
00032  *
00033  * Revision 2.49  2007/05/15 07:26:38  csoutheren
00034  * Remove deprecated  interface to STUN server in H323Endpoint
00035  * Change UseNATForIncomingCall to IsRTPNATEnabled
00036  * Various cleanups of messy and unused code
00037  *
00038  * Revision 2.48  2007/03/13 00:32:16  csoutheren
00039  * Simple but messy changes to allow compile time removal of protocol
00040  * options such as H.450 and H.460
00041  * Fix MakeConnection overrides
00042  *
00043  * Revision 2.47  2007/03/01 05:51:03  rjongbloed
00044  * Fixed backward compatibility of OnIncomingConnection() virtual
00045  *   functions on various classes. If an old override returned FALSE
00046  *   then it will now abort the call as it used to.
00047  *
00048  * Revision 2.46  2007/01/24 04:00:55  csoutheren
00049  * Arrrghh. Changing OnIncomingConnection turned out to have a lot of side-effects
00050  * Added some pure viritual functions to prevent old code from breaking silently
00051  * New OpalEndpoint and OpalConnection descendants will need to re-implement
00052  * OnIncomingConnection. Sorry :)
00053  *
00054  * Revision 2.45  2007/01/18 12:49:21  csoutheren
00055  * Add ability to disable T.38 in compile
00056  *
00057  * Revision 2.44  2007/01/18 04:45:16  csoutheren
00058  * Messy, but simple change to add additional options argument to OpalConnection constructor
00059  * This allows the provision of non-trivial arguments for connections
00060  *
00061  * Revision 2.43  2006/12/18 03:18:41  csoutheren
00062  * Messy but simple fixes
00063  *   - Add access to SIP REGISTER timeout
00064  *   - Ensure OpalConnection options are correctly progagated
00065  *
00066  * Revision 2.42  2006/12/13 05:01:21  csoutheren
00067  * Applied 1613992 - fixes a feature set memory leak
00068  * Thanks to Drazen Dimoti
00069  *
00070  * Revision 2.41  2006/08/29 01:37:11  csoutheren
00071  * Change secure URLs to use h323s and tcps to be inline with sips
00072  *
00073  * Revision 2.40  2006/08/21 05:29:25  csoutheren
00074  * Messy but relatively simple change to add support for secure (SSL/TLS) TCP transport
00075  * and secure H.323 signalling via the sh323 URL scheme
00076  *
00077  * Revision 2.39  2006/06/27 13:07:37  csoutheren
00078  * Patch 1374533 - add h323 Progress handling
00079  * Thanks to Frederich Heem
00080  *
00081  * Revision 2.38  2006/06/27 12:54:35  csoutheren
00082  * Patch 1374489 - h450.7 message center support
00083  * Thanks to Frederich Heem
00084  *
00085  * Revision 2.37  2006/05/30 11:33:02  hfriederich
00086  * Porting support for H.460 from OpenH323
00087  *
00088  * Revision 2.36  2006/05/30 04:58:05  csoutheren
00089  * Added suport for SIP INFO message (untested as yet)
00090  * Fixed some issues with SIP state machine on answering calls
00091  * Fixed some formatting issues
00092  *
00093  * Revision 2.35  2006/04/20 16:52:22  hfriederich
00094  * Adding support for H.224/H.281
00095  *
00096  * Revision 2.34  2006/03/07 11:23:46  csoutheren
00097  * Add ability to disable GRQ on GK registration
00098  *
00099  * Revision 2.33  2006/02/22 10:40:09  csoutheren
00100  * Added patch #1374583 from Frederic Heem
00101  * Added additional H.323 virtual function
00102  *
00103  * Revision 2.32  2006/02/22 10:29:09  csoutheren
00104  * Applied patch #1374470 from Frederic Heem
00105  * Add ability to disable H.245 negotiation
00106  *
00107  * Revision 2.31  2006/01/02 15:52:38  dsandras
00108  * Added what was required to merge changes from OpenH323 Altas_devel_2 in gkclient.cxx, gkserver.cxx and channels.cxx.
00109  *
00110  * Revision 2.30  2005/11/30 13:35:26  csoutheren
00111  * Changed tags for Doxygen
00112  *
00113  * Revision 2.29  2005/07/12 12:34:37  csoutheren
00114  * Fixes for H.450 errors and return values
00115  * Thanks to Iker Perez San Roman
00116  *
00117  * Revision 2.28  2005/07/11 01:52:23  csoutheren
00118  * Extended AnsweringCall to work for SIP as well as H.323
00119  * Fixed problems with external RTP connection in H.323
00120  * Added call to OnClosedMediaStream
00121  *
00122  * Revision 2.27  2004/09/01 12:21:27  rjongbloed
00123  * Added initialisation of H323EndPoints capability table to be all codecs so can
00124  *   correctly build remote caps from fqast connect params. This had knock on effect
00125  *   with const keywords added in numerous places.
00126  *
00127  * Revision 2.26  2004/08/14 07:56:28  rjongbloed
00128  * Major revision to utilise the PSafeCollection classes for the connections and calls.
00129  *
00130  * Revision 2.25  2004/07/11 12:42:09  rjongbloed
00131  * Added function on endpoints to get the list of all media formats any
00132  *   connection the endpoint may create can support.
00133  *
00134  * Revision 2.24  2004/06/05 14:31:32  rjongbloed
00135  * Added function to set gatekeeper registration time to live.
00136  * Added ability to have separate gatekeeper username to endpoint local alias name.
00137  *
00138  * Revision 2.23  2004/06/04 06:54:17  csoutheren
00139  * Migrated updates from OpenH323 1.14.1
00140  *
00141  * Revision 2.22  2004/02/24 09:40:27  rjongbloed
00142  * Fixed missing return in GetSTUN()
00143  *
00144  * Revision 2.21  2004/02/19 10:46:44  rjongbloed
00145  * Merged OpenH323 version 1.13.1 changes.
00146  *
00147  * Revision 2.20  2003/03/06 03:57:46  robertj
00148  * IVR support (work in progress) requiring large changes everywhere.
00149  *
00150  * Revision 2.19  2003/01/07 04:39:52  robertj
00151  * Updated to OpenH323 v1.11.2
00152  *
00153  * Revision 2.18  2002/11/10 11:33:16  robertj
00154  * Updated to OpenH323 v1.10.3
00155  *
00156  * Revision 2.17  2002/09/16 02:52:33  robertj
00157  * Added #define so can select if #pragma interface/implementation is used on
00158  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00159  *
00160  * Revision 2.16  2002/09/10 07:42:40  robertj
00161  * Added function to get gatekeeper password.
00162  *
00163  * Revision 2.15  2002/09/06 02:39:27  robertj
00164  * Added function to set gatekeeper access token OID.
00165  *
00166  * Revision 2.14  2002/09/04 06:01:46  robertj
00167  * Updated to OpenH323 v1.9.6
00168  *
00169  * Revision 2.13  2002/07/04 07:41:46  robertj
00170  * Fixed memory/thread leak of transports.
00171  *
00172  * Revision 2.12  2002/07/01 04:56:29  robertj
00173  * Updated to OpenH323 v1.9.1
00174  *
00175  * Revision 2.11  2002/03/22 06:57:48  robertj
00176  * Updated to OpenH323 version 1.8.2
00177  *
00178  * Revision 2.10  2002/03/18 00:33:36  robertj
00179  * Removed duplicate initialBandwidth variable in H.323 class, moved to ancestor.
00180  *
00181  * Revision 2.9  2002/02/11 09:32:11  robertj
00182  * Updated to openH323 v1.8.0
00183  *
00184  * Revision 2.8  2002/01/22 04:59:04  robertj
00185  * Update from OpenH323, RFC2833 support
00186  *
00187  * Revision 2.7  2002/01/14 06:35:57  robertj
00188  * Updated to OpenH323 v1.7.9
00189  *
00190  * Revision 2.6  2001/11/13 06:25:56  robertj
00191  * Changed SetUpConnection() so returns BOOL as returning
00192  *   pointer to connection is not useful.
00193  *
00194  * Revision 2.5  2001/11/02 10:45:19  robertj
00195  * Updated to OpenH323 v1.7.3
00196  *
00197  * Revision 2.4  2001/10/05 00:22:13  robertj
00198  * Updated to PWLib 1.2.0 and OpenH323 1.7.0
00199  *
00200  * Revision 2.3  2001/08/17 08:21:15  robertj
00201  * Update from OpenH323
00202  * Moved call end reasons enum from OpalConnection to global.
00203  *
00204  * Revision 2.2  2001/08/01 05:10:40  robertj
00205  * Moved media formats list from endpoint to connection.
00206  *
00207  * Revision 2.1  2001/07/30 07:22:25  robertj
00208  * Abstracted listener management from H.323 to OpalEndPoint class.
00209  *
00210  * Revision 2.0  2001/07/27 15:48:24  robertj
00211  * Conversion of OpenH323 to Open Phone Abstraction Library (OPAL)
00212  *
00213  * Revision 1.56  2003/12/29 04:58:55  csoutheren
00214  * Added callbacks on H323EndPoint when gatekeeper discovery succeeds or fails
00215  *
00216  * Revision 1.55  2003/12/28 02:52:15  csoutheren
00217  * Added virtual to a few functions
00218  *
00219  * Revision 1.54  2003/12/28 02:38:14  csoutheren
00220  * Added H323EndPoint::OnOutgoingCall
00221  *
00222  * Revision 1.53  2003/12/28 00:07:10  csoutheren
00223  * Added callbacks on H323EndPoint when gatekeeper registration succeeds or fails
00224  *
00225  * Revision 1.52  2003/04/24 01:49:33  dereks
00226  * Add ability to set no media timeout interval
00227  *
00228  * Revision 1.51  2003/04/10 09:39:48  robertj
00229  * Added associated transport to new GetInterfaceAddresses() function so
00230  *   interfaces can be ordered according to active transport links. Improves
00231  *   interoperability.
00232  *
00233  * Revision 1.50  2003/04/10 01:05:11  craigs
00234  * Added functions to access to lists of interfaces
00235  *
00236  * Revision 1.49  2003/04/07 13:09:25  robertj
00237  * Added ILS support to callto URL parsing in MakeCall(), ie can now call hosts
00238  *   registered with an ILS directory.
00239  *
00240  * Revision 1.48  2003/02/13 00:11:31  robertj
00241  * Added missing virtual for controlling call transfer, thanks Andrey Pinaev
00242  *
00243  * Revision 1.47  2003/02/09 00:48:06  robertj
00244  * Added function to return if registered with gatekeeper.
00245  *
00246  * Revision 1.46  2003/02/04 07:06:41  robertj
00247  * Added STUN support.
00248  *
00249  * Revision 1.45  2003/01/26 05:57:58  robertj
00250  * Changed ParsePartyName so will accept addresses of the form
00251  *   alias@gk:address which will do an LRQ call to "address" using "alias"
00252  *   to determine the IP address to connect to.
00253  *
00254  * Revision 1.44  2003/01/23 02:36:30  robertj
00255  * Increased (and made configurable) timeout for H.245 channel TCP connection.
00256  *
00257  * Revision 1.43  2002/11/28 01:19:55  craigs
00258  * Added virtual to several functions
00259  *
00260  * Revision 1.42  2002/11/27 06:54:52  robertj
00261  * Added Service Control Session management as per Annex K/H.323 via RAS
00262  *   only at this stage.
00263  * Added H.248 ASN and very primitive infrastructure for linking into the
00264  *   Service Control Session management system.
00265  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00266  * Added Call Credit Service Control to display account balances.
00267  *
00268  * Revision 1.41  2002/11/15 05:17:22  robertj
00269  * Added facility redirect support without changing the call token for access
00270  *   to the call. If it gets redirected a new H323Connection object is
00271  *   created but it looks like the same thing to an application.
00272  *
00273  * Revision 1.40  2002/11/10 08:10:43  robertj
00274  * Moved constants for "well known" ports to better place (OPAL change).
00275  *
00276  * Revision 1.39  2002/10/31 00:32:15  robertj
00277  * Enhanced jitter buffer system so operates dynamically between minimum and
00278  *   maximum values. Altered API to assure app writers note the change!
00279  *
00280  * Revision 1.38  2002/10/23 06:06:10  robertj
00281  * Added function to be smarter in using a gatekeeper for use by endpoint.
00282  *
00283  * Revision 1.37  2002/10/21 06:07:44  robertj
00284  * Added function to set gatekeeper access token OID.
00285  *
00286  * Revision 1.36  2002/09/16 01:14:15  robertj
00287  * Added #define so can select if #pragma interface/implementation is used on
00288  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00289  *
00290  * Revision 1.35  2002/09/10 06:32:25  robertj
00291  * Added function to get gatekeeper password.
00292  *
00293  * Revision 1.34  2002/09/03 06:19:36  robertj
00294  * Normalised the multi-include header prevention ifdef/define symbol.
00295  *
00296  * Revision 1.33  2002/07/19 03:39:19  robertj
00297  * Bullet proofed setting of RTP IP port base, can't be zero!
00298  *
00299  * Revision 1.32  2002/07/18 01:50:10  robertj
00300  * Changed port secltion code to force apps to use function interface.
00301  *
00302  * Revision 1.31  2002/06/22 05:48:38  robertj
00303  * Added partial implementation for H.450.11 Call Intrusion
00304  *
00305  * Revision 1.30  2002/06/13 06:15:19  robertj
00306  * Allowed TransferCall() to be used on H323Connection as well as H323EndPoint.
00307  *
00308  * Revision 1.29  2002/06/12 03:55:21  robertj
00309  * Added function to add/remove multiple listeners in one go comparing against
00310  *   what is already running so does not interrupt unchanged listeners.
00311  *
00312  * Revision 1.28  2002/05/29 06:40:29  robertj
00313  * Changed sending of endSession/ReleaseComplete PDU's to occur immediately
00314  *   on call clearance and not wait for background thread to do it.
00315  * Stricter compliance by waiting for reply endSession before closing down.
00316  *
00317  * Revision 1.27  2002/05/28 06:15:09  robertj
00318  * Split UDP (for RAS) from RTP port bases.
00319  * Added current port variable so cycles around the port range specified which
00320  *   fixes some wierd problems on some platforms, thanks Federico Pinna
00321  *
00322  * Revision 1.26  2002/05/17 03:38:05  robertj
00323  * Fixed problems with H.235 authentication on RAS for server and client.
00324  *
00325  * Revision 1.25  2002/05/16 00:03:05  robertj
00326  * Added function to get the tokens for all active calls.
00327  * Improved documentation for use of T.38 and T.120 functions.
00328  *
00329  * Revision 1.24  2002/05/15 08:59:18  rogerh
00330  * Update comments
00331  *
00332  * Revision 1.23  2002/05/03 05:38:15  robertj
00333  * Added Q.931 Keypad IE mechanism for user indications (DTMF).
00334  *
00335  * Revision 1.22  2002/05/02 07:56:24  robertj
00336  * Added automatic clearing of call if no media (RTP data) is transferred in a
00337  *   configurable (default 5 minutes) amount of time.
00338  *
00339  * Revision 1.21  2002/04/18 01:41:07  robertj
00340  * Fixed bad variable name for disabling DTMF detection, very confusing.
00341  *
00342  * Revision 1.20  2002/04/17 00:49:56  robertj
00343  * Added ability to disable the in band DTMF detection.
00344  *
00345  * Revision 1.19  2002/04/10 06:48:47  robertj
00346  * Added functions to set port member variables.
00347  *
00348  * Revision 1.18  2002/03/14 03:49:38  dereks
00349  * Fix minor documentation error.
00350  *
00351  * Revision 1.17  2002/02/04 07:17:52  robertj
00352  * Added H.450.2 Consultation Transfer, thanks Norwood Systems.
00353  *
00354  * Revision 1.16  2002/01/24 06:29:02  robertj
00355  * Added option to disable H.245 negotiation in SETUP pdu, this required
00356  *   API change so have a bit mask instead of a series of booleans.
00357  *
00358  * Revision 1.15  2002/01/17 07:04:58  robertj
00359  * Added support for RFC2833 embedded DTMF in the RTP stream.
00360  *
00361  * Revision 1.14  2002/01/13 23:59:43  robertj
00362  * Added CallTransfer timeouts to endpoint, hanks Ben Madsen of Norwood Systems.
00363  *
00364  * Revision 1.13  2002/01/08 04:45:35  robertj
00365  * Added MakeCallLocked() so can start a call with the H323Connection instance
00366  *   initally locked so can do things to it before the call really starts.
00367  *
00368  * Revision 1.12  2001/12/22 03:20:44  robertj
00369  * Added create protocol function to H323Connection.
00370  *
00371  * Revision 1.11  2001/12/13 10:55:30  robertj
00372  * Added gatekeeper access token OID specification for auto inclusion of
00373  *   access tokens frm ACF to SETUP pdu.
00374  *
00375  * Revision 1.10  2001/11/09 05:39:54  craigs
00376  * Added initial T.38 support thanks to Adam Lazur
00377  *
00378  * Revision 1.9  2001/11/01 00:27:33  robertj
00379  * Added default Fast Start disabled and H.245 tunneling disable flags
00380  *   to the endpoint instance.
00381  *
00382  * Revision 1.8  2001/09/11 01:24:36  robertj
00383  * Added conditional compilation to remove video and/or audio codecs.
00384  *
00385  * Revision 1.7  2001/09/11 00:21:21  robertj
00386  * Fixed missing stack sizes in endpoint for cleaner thread and jitter thread.
00387  *
00388  * Revision 1.6  2001/08/24 14:03:26  rogerh
00389  * Fix some spelling mistakes
00390  *
00391  * Revision 1.5  2001/08/16 07:49:16  robertj
00392  * Changed the H.450 support to be more extensible. Protocol handlers
00393  *   are now in separate classes instead of all in H323Connection.
00394  *
00395  * Revision 1.4  2001/08/10 11:03:49  robertj
00396  * Major changes to H.235 support in RAS to support server.
00397  *
00398  * Revision 1.3  2001/08/08 23:54:11  robertj
00399  * Fixed problem with setting gk password before have a gk variable.
00400  *
00401  * Revision 1.2  2001/08/06 03:15:17  robertj
00402  * Improved access to H.235 secure RAS functionality.
00403  *
00404  * Revision 1.1  2001/08/06 03:08:11  robertj
00405  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00406  */
00407 
00408 #ifndef __OPAL_H323EP_H
00409 #define __OPAL_H323EP_H
00410 
00411 #ifdef P_USE_PRAGMA
00412 #pragma interface
00413 #endif
00414 
00415 
00416 #include <opal/endpoint.h>
00417 #include <opal/manager.h>
00418 #include <opal/call.h>
00419 #include <opal/transports.h>
00420 #include <h323/h323con.h>
00421 #include <h323/h323caps.h>
00422 #include <h323/h235auth.h>
00423 
00424 #ifdef H323_H460
00425 #include <h323/h4601.h>
00426 #endif
00427 
00428 
00429 class H225_EndpointType;
00430 class H225_VendorIdentifier;
00431 class H225_H221NonStandard;
00432 class H225_ServiceControlDescriptor;
00433 class H225_FeatureSet;
00434 
00435 class H235SecurityInfo;
00436 
00437 class H323Gatekeeper;
00438 class H323SignalPDU;
00439 class H323ServiceControlSession;
00440 
00442 
00455 class H323EndPoint : public OpalEndPoint
00456 {
00457   PCLASSINFO(H323EndPoint, OpalEndPoint);
00458 
00459   public:
00460     enum {
00461       DefaultTcpSignalPort = 1720
00462     };
00463 
00468     H323EndPoint(
00469       OpalManager & manager,
00470       const char * prefix = "h323",
00471       WORD defaultSignalPort = DefaultTcpSignalPort
00472     );
00473 
00476     ~H323EndPoint();
00478 
00510     virtual BOOL MakeConnection(
00511       OpalCall & call,                  
00512       const PString & party,            
00513       void * userData  = NULL,          
00514       unsigned int options = NULL,      
00515       OpalConnection::StringOptions * stringOptions = NULL
00516     );
00517 
00527     virtual OpalMediaFormatList GetMediaFormats() const;
00529 
00534     virtual void SetEndpointTypeInfo(
00535       H225_EndpointType & info
00536     ) const;
00537 
00540     virtual void SetVendorIdentifierInfo(
00541       H225_VendorIdentifier & info
00542     ) const;
00543 
00546     virtual void SetH221NonStandardInfo(
00547       H225_H221NonStandard & info
00548     ) const;
00550 
00551 
00562     void AddCapability(
00563       H323Capability * capability   
00564     );
00565 
00586     PINDEX SetCapability(
00587       PINDEX descriptorNum, 
00588       PINDEX simultaneous,  
00589       H323Capability * cap  
00590     );
00591 
00596     PINDEX AddAllCapabilities(
00597       PINDEX descriptorNum, 
00598       PINDEX simultaneous,  
00599       const PString & name  
00600     );
00601 
00604     void AddAllUserInputCapabilities(
00605       PINDEX descriptorNum, 
00606       PINDEX simultaneous   
00607     );
00608 
00611     void RemoveCapabilities(
00612       const PStringArray & codecNames
00613     );
00614 
00617     void ReorderCapabilities(
00618       const PStringArray & preferenceOrder
00619     );
00620 
00623     H323Capability * FindCapability(
00624       const H245_Capability & cap  
00625     ) const;
00626 
00629     H323Capability * FindCapability(
00630       const H245_DataType & dataType  
00631     ) const;
00632 
00635     H323Capability * FindCapability(
00636       H323Capability::MainTypes mainType,   
00637       unsigned subType                      
00638     ) const;
00640 
00660     BOOL UseGatekeeper(
00661       const PString & address = PString::Empty(),     
00662       const PString & identifier = PString::Empty(),  
00663       const PString & localAddress = PString::Empty() 
00664     );
00665 
00676     BOOL SetGatekeeper(
00677       const PString & address,          
00678       H323Transport * transport = NULL  
00679     );
00680 
00695     BOOL SetGatekeeperZone(
00696       const PString & address,          
00697       const PString & identifier,       
00698       H323Transport * transport = NULL  
00699     );
00700 
00710     BOOL LocateGatekeeper(
00711       const PString & identifier,       
00712       H323Transport * transport = NULL  
00713     );
00714 
00723     BOOL DiscoverGatekeeper(
00724       H323Transport * transport = NULL  
00725     );
00726 
00734     virtual H323Gatekeeper * CreateGatekeeper(
00735       H323Transport * transport  
00736     );
00737 
00740     H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00741 
00744     BOOL IsRegisteredWithGatekeeper() const;
00745 
00751     BOOL RemoveGatekeeper(
00752       int reason = -1    
00753     );
00754 
00757     virtual void SetGatekeeperPassword(
00758       const PString & password,
00759       const PString & username = PString::Empty()
00760     );
00761 
00764     virtual const PString & GetGatekeeperUsername() const { return gatekeeperUsername; }
00765 
00768     virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00769 
00772     virtual H235Authenticators CreateAuthenticators();
00773 
00776     virtual void  OnGatekeeperConfirm();
00777 
00780     virtual void  OnGatekeeperReject();
00781 
00784     virtual void OnRegistrationConfirm();
00785 
00788     virtual void  OnRegistrationReject();
00790 
00795     virtual BOOL NewIncomingConnection(
00796       OpalTransport * transport  
00797     );
00798 
00801     virtual H323Connection * CreateConnection(
00802       OpalCall & call,                         
00803       const PString & token,                   
00804       void * userData,                         
00805       OpalTransport & transport,               
00806       const PString & alias,                   
00807       const H323TransportAddress & address,    
00808       H323SignalPDU * setupPDU,                
00809       unsigned options = 0,
00810       OpalConnection::StringOptions * stringOptions = NULL 
00811     );
00812 
00828     virtual BOOL SetupTransfer(
00829       const PString & token,        
00830       const PString & callIdentity, 
00831       const PString & remoteParty,  
00832       void * userData = NULL        
00833     );
00834 
00840     void TransferCall(
00841       const PString & token,        
00842       const PString & remoteParty,  
00843       const PString & callIdentity = PString::Empty()
00845     );
00846 
00853     void ConsultationTransfer(
00854       const PString & primaryCallToken,   
00855       const PString & secondaryCallToken  
00856     );
00857 
00861     void HoldCall(
00862       const PString & token,        
00863       BOOL localHold   
00864     );
00865 
00869     BOOL IntrudeCall(
00870       const PString & remoteParty,  
00871       unsigned capabilityLevel,     
00872       void * userData = NULL        
00873     );
00874 
00881     BOOL ParsePartyName(
00882       const PString & party,          
00883       PString & alias,                
00884       H323TransportAddress & address  
00885     );
00886 
00897     PSafePtr<H323Connection> FindConnectionWithLock(
00898       const PString & token,     
00899       PSafetyMode mode = PSafeReadWrite
00900     );
00901 
00909     virtual BOOL OnSendSignalSetup(H323Connection & connection,
00910                                    H323SignalPDU & setupPDU);
00911 
00923     virtual BOOL OnSendCallProceeding(H323Connection & connection,
00924                                       H323SignalPDU & callProceedingPDU
00925                                      );
00926     
00938     virtual BOOL OnSendConnect(H323Connection & connection,
00939                                H323SignalPDU & connectPDU
00940                               );
00941     
00953     virtual BOOL OnIncomingCall(
00954       H323Connection & connection,    
00955       const H323SignalPDU & setupPDU,   
00956       H323SignalPDU & alertingPDU       
00957     );
00958 
00965     virtual BOOL OnOutgoingCall(
00966         H323Connection & conn, 
00967         const H323SignalPDU & connectPDU
00968     );
00969 
00974     virtual BOOL OnCallTransferInitiate(
00975       H323Connection & connection,    
00976       const PString & remoteParty     
00977     );
00978 
00983     virtual BOOL OnCallTransferIdentify(
00984       H323Connection & connection    
00985     );
00986 
00991     virtual void OnSendARQ(
00992       H323Connection & conn,
00993       H225_AdmissionRequest & arq
00994     );
00995 
01002     virtual OpalConnection::AnswerCallResponse OnAnswerCall(
01003       H323Connection & connection,    
01004       const PString & callerName,       
01005       const H323SignalPDU & setupPDU,   
01006       H323SignalPDU & connectPDU,       
01007       H323SignalPDU & progressPDU        
01008     );
01009     virtual OpalConnection::AnswerCallResponse OnAnswerCall(
01010        OpalConnection & connection,
01011        const PString & caller
01012     );
01013 
01024     virtual BOOL OnAlerting(
01025       H323Connection & connection,    
01026       const H323SignalPDU & alertingPDU,  
01027       const PString & user                
01028     );
01029 
01035     virtual BOOL OnSendAlerting(H323Connection & connection,  
01036                                 H323SignalPDU & alerting,     
01037                                 const PString & calleeName,   
01038                                 BOOL withMedia                
01039                                );
01040         
01045     virtual BOOL OnSentAlerting(H323Connection & connection);
01046     
01055     virtual BOOL OnConnectionForwarded(
01056       H323Connection & connection,    
01057       const PString & forwardParty,   
01058       const H323SignalPDU & pdu       
01059     );
01060 
01069     virtual BOOL ForwardConnection(
01070       H323Connection & connection,    
01071       const PString & forwardParty,   
01072       const H323SignalPDU & pdu       
01073     );
01074 
01081     virtual void OnConnectionEstablished(
01082       H323Connection & connection,    
01083       const PString & token           
01084     );
01085 
01088     virtual BOOL IsConnectionEstablished(
01089       const PString & token   
01090     );
01091 
01098     virtual void OnConnectionCleared(
01099       H323Connection & connection,    
01100       const PString & token           
01101     );
01103 
01104 
01111     virtual BOOL OnStartLogicalChannel(
01112       H323Connection & connection,    
01113       H323Channel & channel           
01114     );
01115 
01120     virtual void OnClosedLogicalChannel(
01121       H323Connection & connection,    
01122       const H323Channel & channel     
01123     );
01124 
01132     virtual void OnRTPStatistics(
01133       const H323Connection & connection,  
01134       const RTP_Session & session         
01135     ) const;
01136 
01142     virtual void OnGatekeeperNATDetect(
01143       PIPSocket::Address publicAddr,         
01144       PString & gkIdentifier,                
01145       H323TransportAddress & gkRouteAddress  
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 
01202     virtual BOOL OnConferenceInvite(
01203       const H323SignalPDU & setupPDU
01204     );
01205 
01211     virtual BOOL OnCallIndependentSupplementaryService(
01212       const H323SignalPDU & setupPDU
01213     );
01214 
01220     virtual BOOL OnNegotiateConferenceCapabilities(
01221       const H323SignalPDU & setupPDU
01222     );
01224 
01235     virtual void SetLocalUserName(
01236       const PString & name  
01237     );
01238 
01243     virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01244 
01251     BOOL AddAliasName(
01252       const PString & name  
01253     );
01254 
01258     BOOL RemoveAliasName(
01259       const PString & name  
01260     );
01261 
01266     const PStringList & GetAliasNames() const { return localAliasNames; }
01267 
01270     const PString & GetDefaultILSServer() const { return manager.GetDefaultILSServer(); }
01271 
01274     void SetDefaultILSServer(
01275       const PString & server
01276     ) { manager.SetDefaultILSServer(server); }
01277 
01280     BOOL IsFastStartDisabled() const
01281       { return disableFastStart; }
01282 
01285     void DisableFastStart(
01286       BOOL mode 
01287     ) { disableFastStart = mode; } 
01288 
01291     BOOL IsH245TunnelingDisabled() const
01292       { return disableH245Tunneling; }
01293 
01296     void DisableH245Tunneling(
01297       BOOL mode 
01298     ) { disableH245Tunneling = mode; } 
01299 
01302     BOOL IsH245inSetupDisabled() const
01303       { return disableH245inSetup; }
01304 
01307     void DisableH245inSetup(
01308       BOOL mode 
01309     ) { disableH245inSetup = mode; } 
01310 
01314     BOOL IsH245Disabled() const
01315     { return m_bH245Disabled; }
01316 
01320     void DisableH245(BOOL bH245Disabled) { m_bH245Disabled = bH245Disabled; } 
01321     
01324     BOOL CanDisplayAmountString() const
01325       { return canDisplayAmountString; }
01326 
01329     void SetCanDisplayAmountString(
01330       BOOL mode 
01331     ) { canDisplayAmountString = mode; } 
01332 
01335     BOOL CanEnforceDurationLimit() const
01336       { return canEnforceDurationLimit; }
01337 
01340     void SetCanEnforceDurationLimit(
01341       BOOL mode 
01342     ) { canEnforceDurationLimit = mode; } 
01343 
01344 #if OPAL_H450
01345 
01347     unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01348 
01351     void SetCallIntrusionProtectionLevel(
01352       unsigned level  
01353     ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01354 #endif
01355 
01358     virtual void OnReceivedInitiateReturnError();
01359 
01360 #if OPAL_VIDEO
01361 
01363     BOOL CanAutoStartReceiveVideo() const { return manager.CanAutoStartReceiveVideo(); }
01364 
01367     BOOL CanAutoStartTransmitVideo() const { return manager.CanAutoStartTransmitVideo(); }
01368 #endif
01369 
01370 #if OPAL_T38FAX
01371 
01373     BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01374 
01377     BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01378 #endif
01379 
01382     BOOL IsH224Enabled() const { return isH224Enabled; }
01383         
01386     void SetIsH224Enabled(BOOL flag) { isH224Enabled = flag; }
01387 
01390     BOOL CanAutoCallForward() const { return autoCallForward; }
01391 
01394     const H323Capabilities & GetCapabilities() const;
01395 
01398     enum TerminalTypes {
01399       e_TerminalOnly = 50,
01400       e_TerminalAndMC = 70,
01401       e_GatewayOnly = 60,
01402       e_GatewayAndMC = 80,
01403       e_GatewayAndMCWithDataMP = 90,
01404       e_GatewayAndMCWithAudioMP = 100,
01405       e_GatewayAndMCWithAVMP = 110,
01406       e_GatekeeperOnly = 120,
01407       e_GatekeeperWithDataMP = 130,
01408       e_GatekeeperWithAudioMP = 140,
01409       e_GatekeeperWithAVMP = 150,
01410       e_MCUOnly = 160,
01411       e_MCUWithDataMP = 170,
01412       e_MCUWithAudioMP = 180,
01413       e_MCUWithAVMP = 190
01414     };
01415 
01418     TerminalTypes GetTerminalType() const { return terminalType; }
01419 
01422     BOOL IsTerminal() const;
01423 
01426     BOOL IsGateway() const;
01427 
01430     BOOL IsGatekeeper() const;
01431 
01434     BOOL IsMCU() const;
01435 
01439     unsigned GetMinAudioJitterDelay() const { return manager.GetMinAudioJitterDelay(); }
01440 
01444     unsigned GetMaxAudioJitterDelay() const { return manager.GetMaxAudioJitterDelay(); }
01445 
01448     void SetAudioJitterDelay(
01449       unsigned minDelay,   
01450       unsigned maxDelay    
01451     ) { manager.SetAudioJitterDelay(minDelay, maxDelay); }
01452 
01455     unsigned GetInitialBandwidth() const { return initialBandwidth; }
01456 
01459     void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01460 
01463     virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &);
01464 
01467     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &);
01468         
01469 #ifdef H323_H460
01470 
01472     H460_FeatureSet & GetFeatureSet() { return features; };
01473 #endif
01474 
01477     virtual BOOL IsLocalAddress(
01478       const PIPSocket::Address & remoteAddress
01479     ) const { return manager.IsLocalAddress(remoteAddress); }
01480 
01483     virtual void TranslateTCPAddress(
01484       PIPSocket::Address & localAddr,
01485       const PIPSocket::Address & remoteAddr
01486     );
01487 
01490     WORD GetTCPPortBase() const { return manager.GetTCPPortBase(); }
01491 
01494     WORD GetTCPPortMax() const { return manager.GetTCPPortMax(); }
01495 
01498     void SetTCPPorts(unsigned tcpBase, unsigned tcpMax) { manager.SetTCPPorts(tcpBase, tcpMax); }
01499 
01502     WORD GetNextTCPPort() { return manager.GetNextTCPPort(); }
01503 
01506     WORD GetUDPPortBase() const { return manager.GetUDPPortBase(); }
01507 
01510     WORD GetUDPPortMax() const { return manager.GetUDPPortMax(); }
01511 
01514     void SetUDPPorts(unsigned udpBase, unsigned udpMax) { manager.SetUDPPorts(udpBase, udpMax); }
01515 
01518     WORD GetNextUDPPort() { return manager.GetNextUDPPort(); }
01519 
01522     WORD GetRtpIpPortBase() const { return manager.GetRtpIpPortBase(); }
01523 
01526     WORD GetRtpIpPortMax() const { return manager.GetRtpIpPortMax(); }
01527 
01530     void SetRtpIpPorts(unsigned udpBase, unsigned udpMax) { manager.SetRtpIpPorts(udpBase, udpMax); }
01531 
01534     WORD GetRtpIpPortPair() { return manager.GetRtpIpPortPair(); }
01535 
01538     BYTE GetRtpIpTypeofService() const { return manager.GetRtpIpTypeofService(); }
01539 
01542     void SetRtpIpTypeofService(unsigned tos) { manager.SetRtpIpTypeofService(tos); }
01543 
01546     const PTimeInterval & GetSignallingChannelCallTimeout() const { return signallingChannelCallTimeout; }
01547 
01550     const PTimeInterval & GetControlChannelStartTimeout() const { return controlChannelStartTimeout; }
01551 
01554     const PTimeInterval & GetEndSessionTimeout() const { return endSessionTimeout; }
01555 
01558     const PTimeInterval & GetMasterSlaveDeterminationTimeout() const { return masterSlaveDeterminationTimeout; }
01559 
01562     unsigned GetMasterSlaveDeterminationRetries() const { return masterSlaveDeterminationRetries; }
01563 
01566     const PTimeInterval & GetCapabilityExchangeTimeout() const { return capabilityExchangeTimeout; }
01567 
01570     const PTimeInterval & GetLogicalChannelTimeout() const { return logicalChannelTimeout; }
01571 
01574     const PTimeInterval & GetRequestModeTimeout() const { return logicalChannelTimeout; }
01575 
01578     const PTimeInterval & GetRoundTripDelayTimeout() const { return roundTripDelayTimeout; }
01579 
01582     const PTimeInterval & GetRoundTripDelayRate() const { return roundTripDelayRate; }
01583 
01586     BOOL ShouldClearCallOnRoundTripFail() const { return clearCallOnRoundTripFail; }
01587 
01590     const PTimeInterval & GetNoMediaTimeout() const { return manager.GetNoMediaTimeout(); }
01591 
01594     BOOL SetNoMediaTimeout(
01595       const PTimeInterval & newInterval  
01596     ) { return manager.SetNoMediaTimeout(newInterval); }
01597 
01600     const PTimeInterval & GetGatekeeperRequestTimeout() const { return gatekeeperRequestTimeout; }
01601 
01604     unsigned GetGatekeeperRequestRetries() const { return gatekeeperRequestRetries; }
01605 
01608     const PTimeInterval & GetRasRequestTimeout() const { return rasRequestTimeout; }
01609 
01612     unsigned GetRasRequestRetries() const { return rasRequestRetries; }
01613 
01617     const PTimeInterval & GetGatekeeperTimeToLive() const { return registrationTimeToLive; }
01618 
01622     void SetGatekeeperTimeToLive(const PTimeInterval & ttl) { registrationTimeToLive = ttl; }
01623 
01626     const PString & GetGkAccessTokenOID() const { return gkAccessTokenOID; }
01627 
01630     void SetGkAccessTokenOID(const PString & token) { gkAccessTokenOID = token; }
01631 
01634     BOOL GetSendGRQ() const
01635     { return sendGRQ; }
01636 
01639     void SetSendGRQ(BOOL v) 
01640     { sendGRQ = v; }
01641 
01644     const PTimeInterval & GetCallTransferT1() const { return callTransferT1; }
01645 
01648     const PTimeInterval & GetCallTransferT2() const { return callTransferT2; }
01649 
01652     const PTimeInterval & GetCallTransferT3() const { return callTransferT3; }
01653 
01656     const PTimeInterval & GetCallTransferT4() const { return callTransferT4; }
01657 
01659     const PTimeInterval & GetCallIntrusionT1() const { return callIntrusionT1; }
01660     const PTimeInterval & GetCallIntrusionT2() const { return callIntrusionT2; }
01661     const PTimeInterval & GetCallIntrusionT3() const { return callIntrusionT3; }
01662     const PTimeInterval & GetCallIntrusionT4() const { return callIntrusionT4; }
01663     const PTimeInterval & GetCallIntrusionT5() const { return callIntrusionT5; }
01664     const PTimeInterval & GetCallIntrusionT6() const { return callIntrusionT6; }
01665 
01668     H323CallIdentityDict& GetCallIdentityDictionary() { return secondaryConnectionsActive; }
01669 
01672 #if OPAL_H450
01673     unsigned GetNextH450CallIdentityValue() const { return ++nextH450CallIdentity; }
01674 #endif
01675 
01677 
01678   protected:
01679     H323Gatekeeper * InternalCreateGatekeeper(H323Transport * transport);
01680     BOOL InternalRegisterGatekeeper(H323Gatekeeper * gk, BOOL discovered);
01681     BOOL InternalMakeCall(
01682       OpalCall & call,
01683       const PString & existingToken,           
01684       const PString & callIdentity,            
01685       unsigned capabilityLevel,                
01686       const PString & remoteParty,             
01687       void * userData,                         
01688       unsigned int options = 0,                
01689       OpalConnection::StringOptions * stringOptions = NULL 
01690     );
01691 
01692     // Configuration variables, commonly changed
01693     PStringList localAliasNames;
01694     BOOL        autoStartReceiveFax;
01695     BOOL        autoStartTransmitFax;
01696     BOOL        isH224Enabled;
01697     BOOL        autoCallForward;
01698     BOOL        disableFastStart;
01699     BOOL        disableH245Tunneling;
01700     BOOL        disableH245inSetup;
01701     BOOL        m_bH245Disabled; /* enabled or disabled h245 */
01702     BOOL        canDisplayAmountString;
01703     BOOL        canEnforceDurationLimit;
01704 #if OPAL_H450
01705     unsigned    callIntrusionProtectionLevel;
01706 #endif
01707 
01708     TerminalTypes terminalType;
01709 
01710     BOOL          clearCallOnRoundTripFail;
01711 
01712     // Some more configuration variables, rarely changed.
01713     PTimeInterval signallingChannelCallTimeout;
01714     PTimeInterval controlChannelStartTimeout;
01715     PTimeInterval endSessionTimeout;
01716     PTimeInterval masterSlaveDeterminationTimeout;
01717     unsigned      masterSlaveDeterminationRetries;
01718     PTimeInterval capabilityExchangeTimeout;
01719     PTimeInterval logicalChannelTimeout;
01720     PTimeInterval requestModeTimeout;
01721     PTimeInterval roundTripDelayTimeout;
01722     PTimeInterval roundTripDelayRate;
01723     PTimeInterval gatekeeperRequestTimeout;
01724     unsigned      gatekeeperRequestRetries;
01725     PTimeInterval rasRequestTimeout;
01726     unsigned      rasRequestRetries;
01727     PTimeInterval registrationTimeToLive;
01728 
01729     PString       gkAccessTokenOID;
01730     BOOL          sendGRQ;
01731 
01732     /* Protect against absence of a response to the ctIdentify reqest
01733        (Transferring Endpoint - Call Transfer with a secondary Call) */
01734     PTimeInterval callTransferT1;
01735     /* Protect against failure of completion of the call transfer operation
01736        involving a secondary Call (Transferred-to Endpoint) */
01737     PTimeInterval callTransferT2;
01738     /* Protect against failure of the Transferred Endpoint not responding
01739        within sufficient time to the ctInitiate APDU (Transferring Endpoint) */
01740     PTimeInterval callTransferT3;
01741     /* May optionally operate - protects against absence of a response to the
01742        ctSetup request (Transferred Endpoint) */
01743     PTimeInterval callTransferT4;
01744 
01746     PTimeInterval callIntrusionT1;
01747     PTimeInterval callIntrusionT2;
01748     PTimeInterval callIntrusionT3;
01749     PTimeInterval callIntrusionT4;
01750     PTimeInterval callIntrusionT5;
01751     PTimeInterval callIntrusionT6;
01752 
01753     // Dynamic variables
01754     mutable H323Capabilities capabilities;
01755     H323Gatekeeper *     gatekeeper;
01756     PString              gatekeeperUsername;
01757     PString              gatekeeperPassword;
01758     H323CallIdentityDict secondaryConnectionsActive;
01759 
01760 #if OPAL_H450
01761     mutable PAtomicInteger nextH450CallIdentity;
01763 #endif
01764 
01765 #if OPAL_H460
01766     H460_FeatureSet features;
01767 #endif
01768 
01769 };
01770 
01771 
01772 #if P_SSL
01773 
01774 class H323SecureEndPoint : public H323EndPoint
01775 {
01776   PCLASSINFO(H323SecureEndPoint, H323EndPoint);
01777   public:
01778     enum {
01779       DefaultTcpSignalPort = 1300
01780     };
01781 
01782     H323SecureEndPoint(OpalManager & _manager)
01783       : H323EndPoint(_manager, "h323s", DefaultTcpSignalPort)
01784     {
01785     }
01786 
01787     PString GetDefaultTransport() const
01788     {  return "tcps$"; }
01790 };
01791 
01792 #endif // P_SSL
01793 
01794 #endif // __OPAL_H323EP_H
01795 
01796 

Generated on Fri Mar 7 06:33:31 2008 for OPAL by  doxygen 1.5.1