D:/Storage/CVS_Head/h323plus/include/h323ep.h

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.2  2007/08/20 19:13:27  shorne
00031  * Added Generic Capability support. Fixed Linux compile errors
00032  *
00033  * Revision 1.1  2007/08/06 20:50:49  shorne
00034  * First commit of h323plus
00035  *
00036  * Revision 1.87.2.8  2007/07/20 22:03:21  shorne
00037  * Initial H.350 Support
00038  *
00039  * Revision 1.87.2.7  2007/05/23 06:59:36  shorne
00040  * Added Assigned Alias/Gatekeeper
00041  *
00042  * Revision 1.87.2.6  2007/04/19 12:16:15  shorne
00043  * added ability to detect if no nat
00044  *
00045  * Revision 1.87.2.5  2007/02/19 20:11:05  shorne
00046  * Added Baseline H.239 Support
00047  *
00048  * Revision 1.87.2.4  2007/02/11 00:45:20  shorne
00049  * Added ability to disable NAT method on a call by call basis
00050  *
00051  * Revision 1.87.2.3  2007/02/02 22:12:43  shorne
00052  * Added ability to set FrameSize for video plugins
00053  *
00054  * Revision 1.87.2.2  2007/01/30 01:07:40  shorne
00055  * Added ability to disable H460
00056  *
00057  * Revision 1.87.2.1  2006/12/23 19:08:02  shorne
00058  * Plugin video codecs & sundry
00059  *
00060  * Revision 1.87  2006/06/26 02:52:51  shorne
00061  * Moved H460 feature loader from H323EndPoint Constructor
00062  *
00063  * Revision 1.86  2006/06/23 20:01:28  shorne
00064  * More H460 support
00065  *
00066  * Revision 1.85  2006/06/23 07:06:04  csoutheren
00067  * Fixed linux compile
00068  *
00069  * Revision 1.84  2006/06/23 06:02:44  csoutheren
00070  * Added missing declarations for H.224 backport
00071  *
00072  * Revision 1.83  2006/06/09 06:30:12  csoutheren
00073  * Remove compile warning and errors with gcc
00074  *
00075  * Revision 1.82  2006/05/30 11:14:55  hfriederich
00076  * Switch from DISABLE_H460 to H323_H460
00077  *
00078  * Revision 1.81  2006/05/16 11:44:09  shorne
00079  * extended DNS SRV, H460 Feature , Call Credit, extend conference goals
00080  *
00081  * Revision 1.80  2006/03/07 10:37:46  csoutheren
00082  * Add ability to disable GRQ on GK registration
00083  *
00084  * Revision 1.79  2006/01/26 03:47:17  shorne
00085  * Caller Authentication, more Nat Traversal support, more PBX support
00086  *
00087  * Revision 1.78  2006/01/20 00:32:24  csoutheren
00088  * First check-in of signalling aggregation code - incomplete and disabled by default
00089  *
00090  * Revision 1.77  2006/01/18 07:46:08  csoutheren
00091  * Initial version of RTP aggregation (disabled by default)
00092  *
00093  * Revision 1.76  2005/11/30 13:05:01  csoutheren
00094  * Changed tags for Doxygen
00095  *
00096  * Revision 1.75  2005/11/22 03:38:45  shorne
00097  * Added ToS support to TCP Transports. thx Norbert Bartalsky (TOPCALL)
00098  *
00099  * Revision 1.74  2005/11/21 21:02:19  shorne
00100  * Added GnuGK Nat detection support
00101  *
00102  * Revision 1.73  2005/09/16 08:12:49  csoutheren
00103  * Added ability to set timeout for connect
00104  *
00105  * Revision 1.72  2005/07/12 12:28:52  csoutheren
00106  * Fixes for H.450 errors and return values
00107  * Thanks to Iker Perez San Roman
00108  *
00109  * Revision 1.71  2005/03/10 07:01:29  csoutheren
00110  * Fixed problem with H.450 call identifiers not being unique across all calls on an
00111  *  endpoint. Thanks to Thien Nguyen
00112  *
00113  * Revision 1.70  2005/01/03 14:03:20  csoutheren
00114  * Added new configure options and ability to disable/enable modules
00115  *
00116  * Revision 1.69  2005/01/03 06:25:52  csoutheren
00117  * Added extensive support for disabling code modules at compile time
00118  *
00119  * Revision 1.68  2004/12/20 02:32:34  csoutheren
00120  * Cleeaned up OSP functions
00121  *
00122  * Revision 1.67  2004/12/08 01:59:22  csoutheren
00123  * initial support for Transnexus OSP toolkit
00124  *
00125  * Revision 1.66  2004/11/25 07:38:58  csoutheren
00126  * Ensured that external TCP address translation is performed when using STUN to handle UDP
00127  *
00128  * Revision 1.65  2004/09/03 01:06:09  csoutheren
00129  * Added initial hooks for H.460 GEF
00130  * Thanks to Simon Horne and ISVO (Asia) Pte Ltd. for this contribution
00131  *
00132  * Revision 1.64  2004/07/27 05:28:45  csoutheren
00133  * Added ability to set priority of channel threads
00134  *
00135  * Revision 1.63  2004/07/27 01:15:16  csoutheren
00136  * Added virtual to InternalMakeCall
00137  *
00138  * Revision 1.62  2004/07/19 13:19:55  csoutheren
00139  * Fixed typo in secondaryConnectionsActive
00140  *
00141  * Revision 1.61  2004/07/11 11:36:25  rjongbloed
00142  * Added virtual to CleanUpConnections, thanks Eize Slange
00143  *
00144  * Revision 1.60  2004/06/15 03:30:00  csoutheren
00145  * Added OnSendARQ to allow access to the ARQ message before sent by connection
00146  *
00147  * Revision 1.59  2004/06/04 07:05:10  csoutheren
00148  * Fixed obvious typos
00149  *
00150  * Revision 1.58  2004/06/01 05:48:02  csoutheren
00151  * Changed capability table to use abstract factory routines rather than internal linked list
00152  *
00153  * Revision 1.57  2004/05/17 12:14:24  csoutheren
00154  * Added support for different SETUP PDU types
00155  *
00156  * Revision 1.56  2003/12/29 04:58:55  csoutheren
00157  * Added callbacks on H323EndPoint when gatekeeper discovery succeeds or fails
00158  *
00159  * Revision 1.55  2003/12/28 02:52:15  csoutheren
00160  * Added virtual to a few functions
00161  *
00162  * Revision 1.54  2003/12/28 02:38:14  csoutheren
00163  * Added H323EndPoint::OnOutgoingCall
00164  *
00165  * Revision 1.53  2003/12/28 00:07:10  csoutheren
00166  * Added callbacks on H323EndPoint when gatekeeper registration succeeds or fails
00167  *
00168  * Revision 1.52  2003/04/24 01:49:33  dereks
00169  * Add ability to set no media timeout interval
00170  *
00171  * Revision 1.51  2003/04/10 09:39:48  robertj
00172  * Added associated transport to new GetInterfaceAddresses() function so
00173  *   interfaces can be ordered according to active transport links. Improves
00174  *   interoperability.
00175  *
00176  * Revision 1.50  2003/04/10 01:05:11  craigs
00177  * Added functions to access to lists of interfaces
00178  *
00179  * Revision 1.49  2003/04/07 13:09:25  robertj
00180  * Added ILS support to callto URL parsing in MakeCall(), ie can now call hosts
00181  *   registered with an ILS directory.
00182  *
00183  * Revision 1.48  2003/02/13 00:11:31  robertj
00184  * Added missing virtual for controlling call transfer, thanks Andrey Pinaev
00185  *
00186  * Revision 1.47  2003/02/09 00:48:06  robertj
00187  * Added function to return if registered with gatekeeper.
00188  *
00189  * Revision 1.46  2003/02/04 07:06:41  robertj
00190  * Added STUN support.
00191  *
00192  * Revision 1.45  2003/01/26 05:57:58  robertj
00193  * Changed ParsePartyName so will accept addresses of the form
00194  *   alias@gk:address which will do an LRQ call to "address" using "alias"
00195  *   to determine the IP address to connect to.
00196  *
00197  * Revision 1.44  2003/01/23 02:36:30  robertj
00198  * Increased (and made configurable) timeout for H.245 channel TCP connection.
00199  *
00200  * Revision 1.43  2002/11/28 01:19:55  craigs
00201  * Added virtual to several functions
00202  *
00203  * Revision 1.42  2002/11/27 06:54:52  robertj
00204  * Added Service Control Session management as per Annex K/H.323 via RAS
00205  *   only at this stage.
00206  * Added H.248 ASN and very primitive infrastructure for linking into the
00207  *   Service Control Session management system.
00208  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00209  * Added Call Credit Service Control to display account balances.
00210  *
00211  * Revision 1.41  2002/11/15 05:17:22  robertj
00212  * Added facility redirect support without changing the call token for access
00213  *   to the call. If it gets redirected a new H323Connection object is
00214  *   created but it looks like the same thing to an application.
00215  *
00216  * Revision 1.40  2002/11/10 08:10:43  robertj
00217  * Moved constants for "well known" ports to better place (OPAL change).
00218  *
00219  * Revision 1.39  2002/10/31 00:32:15  robertj
00220  * Enhanced jitter buffer system so operates dynamically between minimum and
00221  *   maximum values. Altered API to assure app writers note the change!
00222  *
00223  * Revision 1.38  2002/10/23 06:06:10  robertj
00224  * Added function to be smarter in using a gatekeeper for use by endpoint.
00225  *
00226  * Revision 1.37  2002/10/21 06:07:44  robertj
00227  * Added function to set gatekeeper access token OID.
00228  *
00229  * Revision 1.36  2002/09/16 01:14:15  robertj
00230  * Added #define so can select if #pragma interface/implementation is used on
00231  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00232  *
00233  * Revision 1.35  2002/09/10 06:32:25  robertj
00234  * Added function to get gatekeeper password.
00235  *
00236  * Revision 1.34  2002/09/03 06:19:36  robertj
00237  * Normalised the multi-include header prevention ifdef/define symbol.
00238  *
00239  * Revision 1.33  2002/07/19 03:39:19  robertj
00240  * Bullet proofed setting of RTP IP port base, can't be zero!
00241  *
00242  * Revision 1.32  2002/07/18 01:50:10  robertj
00243  * Changed port secltion code to force apps to use function interface.
00244  *
00245  * Revision 1.31  2002/06/22 05:48:38  robertj
00246  * Added partial implementation for H.450.11 Call Intrusion
00247  *
00248  * Revision 1.30  2002/06/13 06:15:19  robertj
00249  * Allowed TransferCall() to be used on H323Connection as well as H323EndPoint.
00250  *
00251  * Revision 1.29  2002/06/12 03:55:21  robertj
00252  * Added function to add/remove multiple listeners in one go comparing against
00253  *   what is already running so does not interrupt unchanged listeners.
00254  *
00255  * Revision 1.28  2002/05/29 06:40:29  robertj
00256  * Changed sending of endSession/ReleaseComplete PDU's to occur immediately
00257  *   on call clearance and not wait for background thread to do it.
00258  * Stricter compliance by waiting for reply endSession before closing down.
00259  *
00260  * Revision 1.27  2002/05/28 06:15:09  robertj
00261  * Split UDP (for RAS) from RTP port bases.
00262  * Added current port variable so cycles around the port range specified which
00263  *   fixes some wierd problems on some platforms, thanks Federico Pinna
00264  *
00265  * Revision 1.26  2002/05/17 03:38:05  robertj
00266  * Fixed problems with H.235 authentication on RAS for server and client.
00267  *
00268  * Revision 1.25  2002/05/16 00:03:05  robertj
00269  * Added function to get the tokens for all active calls.
00270  * Improved documentation for use of T.38 and T.120 functions.
00271  *
00272  * Revision 1.24  2002/05/15 08:59:18  rogerh
00273  * Update comments
00274  *
00275  * Revision 1.23  2002/05/03 05:38:15  robertj
00276  * Added Q.931 Keypad IE mechanism for user indications (DTMF).
00277  *
00278  * Revision 1.22  2002/05/02 07:56:24  robertj
00279  * Added automatic clearing of call if no media (RTP data) is transferred in a
00280  *   configurable (default 5 minutes) amount of time.
00281  *
00282  * Revision 1.21  2002/04/18 01:41:07  robertj
00283  * Fixed bad variable name for disabling DTMF detection, very confusing.
00284  *
00285  * Revision 1.20  2002/04/17 00:49:56  robertj
00286  * Added ability to disable the in band DTMF detection.
00287  *
00288  * Revision 1.19  2002/04/10 06:48:47  robertj
00289  * Added functions to set port member variables.
00290  *
00291  * Revision 1.18  2002/03/14 03:49:38  dereks
00292  * Fix minor documentation error.
00293  *
00294  * Revision 1.17  2002/02/04 07:17:52  robertj
00295  * Added H.450.2 Consultation Transfer, thanks Norwood Systems.
00296  *
00297  * Revision 1.16  2002/01/24 06:29:02  robertj
00298  * Added option to disable H.245 negotiation in SETUP pdu, this required
00299  *   API change so have a bit mask instead of a series of booleans.
00300  *
00301  * Revision 1.15  2002/01/17 07:04:58  robertj
00302  * Added support for RFC2833 embedded DTMF in the RTP stream.
00303  *
00304  * Revision 1.14  2002/01/13 23:59:43  robertj
00305  * Added CallTransfer timeouts to endpoint, hanks Ben Madsen of Norwood Systems.
00306  *
00307  * Revision 1.13  2002/01/08 04:45:35  robertj
00308  * Added MakeCallLocked() so can start a call with the H323Connection instance
00309  *   initally locked so can do things to it before the call really starts.
00310  *
00311  * Revision 1.12  2001/12/22 03:20:44  robertj
00312  * Added create protocol function to H323Connection.
00313  *
00314  * Revision 1.11  2001/12/13 10:55:30  robertj
00315  * Added gatekeeper access token OID specification for auto inclusion of
00316  *   access tokens frm ACF to SETUP pdu.
00317  *
00318  * Revision 1.10  2001/11/09 05:39:54  craigs
00319  * Added initial T.38 support thanks to Adam Lazur
00320  *
00321  * Revision 1.9  2001/11/01 00:27:33  robertj
00322  * Added default Fast Start disabled and H.245 tunneling disable flags
00323  *   to the endpoint instance.
00324  *
00325  * Revision 1.8  2001/09/11 01:24:36  robertj
00326  * Added conditional compilation to remove video and/or audio codecs.
00327  *
00328  * Revision 1.7  2001/09/11 00:21:21  robertj
00329  * Fixed missing stack sizes in endpoint for cleaner thread and jitter thread.
00330  *
00331  * Revision 1.6  2001/08/24 14:03:26  rogerh
00332  * Fix some spelling mistakes
00333  *
00334  * Revision 1.5  2001/08/16 07:49:16  robertj
00335  * Changed the H.450 support to be more extensible. Protocol handlers
00336  *   are now in separate classes instead of all in H323Connection.
00337  *
00338  * Revision 1.4  2001/08/10 11:03:49  robertj
00339  * Major changes to H.235 support in RAS to support server.
00340  *
00341  * Revision 1.3  2001/08/08 23:54:11  robertj
00342  * Fixed problem with setting gk password before have a gk variable.
00343  *
00344  * Revision 1.2  2001/08/06 03:15:17  robertj
00345  * Improved access to H.235 secure RAS functionality.
00346  *
00347  * Revision 1.1  2001/08/06 03:08:11  robertj
00348  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00349  *
00350  */
00351 
00352 #ifndef __OPAL_H323EP_H
00353 #define __OPAL_H323EP_H
00354 
00355 #include "h323.h"
00356 #include "h323con.h"
00357 
00358 class PHandleAggregator;
00359 
00360 /* The following classes have forward references to avoid including the VERY
00361    large header files for H225 and H245. If an application requires access
00362    to the protocol classes they can include them, but for simple usage their
00363    inclusion can be avoided.
00364  */
00365 class H225_EndpointType;
00366 class H225_ArrayOf_SupportedProtocols;
00367 class H225_VendorIdentifier;
00368 class H225_H221NonStandard;
00369 class H225_ServiceControlDescriptor;
00370 class H225_ArrayOf_AliasAddress;
00371 
00372 class H323SignalPDU;
00373 class H323ConnectionsCleaner;
00374 class H323ServiceControlSession;
00375 
00376 #if H323_H224
00377 class OpalH224Handler;
00378 class OpalH281Handler;
00379 #endif
00380 
00381 #ifndef DISABLE_CALLAUTH
00382 #include "h235auth.h"
00383 #endif
00384 
00385 #ifdef H323_T120
00386 class OpalT120Protocol;
00387 #endif
00388 
00389 #ifdef H323_T38
00390 class OpalT38Protocol;
00391 #endif
00392 
00393 #ifdef H323_H224
00394 class OpalH224Handler;
00395 class OpalH281Handler;
00396 #endif
00397 
00398 #ifdef P_STUN
00399 #include <ptclib/pnat.h>
00400 class PSTUNClient;
00401 #endif
00402 
00403 #ifdef P_USE_PRAGMA
00404 #pragma interface
00405 #endif
00406 
00407 #ifdef H323_H460
00408 #include "h460/h4601.h"
00409 #endif
00410 
00412 
00425 class H323EndPoint : public PObject
00426 {
00427   PCLASSINFO(H323EndPoint, PObject);
00428 
00429   public:
00430     enum {
00431       DefaultTcpPort = 1720
00432     };
00433 
00438     H323EndPoint();
00439 
00442     ~H323EndPoint();
00443 
00446     virtual void SetEndpointTypeInfo(
00447       H225_EndpointType & info
00448     ) const;
00449 
00452     virtual void SetVendorIdentifierInfo(
00453       H225_VendorIdentifier & info
00454     ) const;
00455 
00458     BOOL SetGatewaySupportedProtocol(
00459                 H225_ArrayOf_SupportedProtocols & protocols
00460         ) const;
00461 
00465     virtual BOOL OnSetGatewayPrefixes(
00466                 PStringList & prefixes
00467         ) const;
00468 
00471     virtual void SetH221NonStandardInfo(
00472       H225_H221NonStandard & info
00473     ) const;
00475 
00476 
00487     void AddCapability(
00488       H323Capability * capability   
00489     );
00490 
00511     PINDEX SetCapability(
00512       PINDEX descriptorNum, 
00513       PINDEX simultaneous,  
00514       H323Capability * cap  
00515     );
00516 
00517 #ifdef H323_VIDEO
00518 
00523         BOOL SetVideoFrameSize(H323Capability::CapabilityFrameSize frameSize, 
00524                                   int frameUnits = 1
00525         );
00526 #endif
00527 
00532     PINDEX AddAllCapabilities(
00533       PINDEX descriptorNum, 
00534       PINDEX simultaneous,  
00535       const PString & name  
00536     );
00537 
00540     void AddAllUserInputCapabilities(
00541       PINDEX descriptorNum, 
00542       PINDEX simultaneous   
00543     );
00544 
00545 #ifdef H323_H239
00546 
00548     void AddAllExtendedVideoCapabilities(
00549       PINDEX descriptorNum, 
00550       PINDEX simultaneous   
00551     );
00552 #endif
00553 
00556     void RemoveCapabilities(
00557       const PStringArray & codecNames
00558     );
00559 
00562     void ReorderCapabilities(
00563       const PStringArray & preferenceOrder
00564     );
00565 
00568     H323Capability * FindCapability(
00569       const H245_Capability & cap  
00570     ) const;
00571 
00574     H323Capability * FindCapability(
00575       const H245_DataType & dataType  
00576     ) const;
00577 
00580     H323Capability * FindCapability(
00581       H323Capability::MainTypes mainType,   
00582       unsigned subType                      
00583     ) const;
00585 
00605     BOOL UseGatekeeper(
00606       const PString & address = PString::Empty(),     
00607       const PString & identifier = PString::Empty(),  
00608       const PString & localAddress = PString::Empty() 
00609     );
00610 
00621     BOOL SetGatekeeper(
00622       const PString & address,          
00623       H323Transport * transport = NULL  
00624     );
00625 
00640     BOOL SetGatekeeperZone(
00641       const PString & address,          
00642       const PString & identifier,       
00643       H323Transport * transport = NULL  
00644     );
00645 
00655     BOOL LocateGatekeeper(
00656       const PString & identifier,       
00657       H323Transport * transport = NULL  
00658     );
00659 
00668     BOOL DiscoverGatekeeper(
00669       H323Transport * transport = NULL  
00670     );
00671 
00679     virtual H323Gatekeeper * CreateGatekeeper(
00680       H323Transport * transport  
00681     );
00682 
00685     H323Gatekeeper * GetGatekeeper() const { return gatekeeper; }
00686 
00689     BOOL IsRegisteredWithGatekeeper() const;
00690 
00696     BOOL RemoveGatekeeper(
00697       int reason = -1    
00698     );
00699 
00702     virtual void SetGatekeeperPassword(
00703       const PString & password
00704     );
00705 
00708     virtual const PString & GetGatekeeperPassword() const { return gatekeeperPassword; }
00709 
00714         virtual BOOL GatekeeperCheckIP(const H323TransportAddress & oldAddr,H323TransportAddress & newaddress);
00715 
00718     virtual H235Authenticators CreateAuthenticators();
00719 
00722         virtual void OnAdmissionRequest(H323Connection & connection);
00723 
00726     virtual void  OnGatekeeperConfirm();
00727 
00730     virtual void  OnGatekeeperReject();
00731 
00734     virtual void OnRegistrationConfirm(const H323TransportAddress & rasAddress);
00735 
00738     virtual void  OnRegistrationReject();
00739 
00742         virtual void OnUnRegisterRequest(); 
00744 
00761     BOOL StartListener(
00762       H323Listener * listener 
00763     );
00764 
00776     BOOL StartListener(
00777       const H323TransportAddress & iface 
00778     );
00779 
00796     BOOL StartListeners(
00797       const H323TransportAddressArray & ifaces 
00798     );
00799 
00803     BOOL RemoveListener(
00804       H323Listener * listener 
00805     );
00806 
00809     H323TransportAddressArray GetInterfaceAddresses(
00810       BOOL excludeLocalHost = TRUE,       
00811       H323Transport * associatedTransport = NULL
00813     );
00814 
00815 #ifndef DISABLE_CALLAUTH
00816 
00820       H323Connection * MakeAuthenticatedCall (
00821                         const PString & remoteParty,  
00822                         const PString & UserName,     
00823                         const PString & Password,     
00824                         PString & token,              
00825                         void * userData = NULL        
00826      );                                                                                 
00827 #endif                                                          
00828 
00847     H323Connection * MakeCall(
00848       const PString & remoteParty,  
00849       PString & token,              
00850       void * userData = NULL        
00851     );
00852 
00873     H323Connection * MakeCall(
00874       const PString & remoteParty,  
00875       H323Transport * transport,    
00876       PString & token,              
00877       void * userData = NULL        
00878     );
00879 
00890     H323Connection * MakeCallLocked(
00891       const PString & remoteParty,     
00892       PString & token,                 
00893       void * userData = NULL,          
00894       H323Transport * transport = NULL 
00895     );
00896 
00897 #ifdef H323_H450
00898 
00919     virtual H323Connection * SetupTransfer(
00920       const PString & token,        
00921       const PString & callIdentity, 
00922       const PString & remoteParty,  
00923       PString & newToken,           
00924       void * userData = NULL        
00925     );
00926 
00932     void TransferCall(
00933       const PString & token,        
00934       const PString & remoteParty,  
00935       const PString & callIdentity = PString::Empty()
00937     );
00938 
00945     void ConsultationTransfer(
00946       const PString & primaryCallToken,   
00947       const PString & secondaryCallToken  
00948     );
00949 
00953     void HoldCall(
00954       const PString & token,        
00955       BOOL localHold   
00956     );
00957 
00961     H323Connection * IntrudeCall(
00962       const PString & remoteParty,  
00963       PString & token,              
00964       unsigned capabilityLevel,     
00965       void * userData = NULL        
00966     );
00967 
00968     H323Connection * IntrudeCall(
00969       const PString & remoteParty,  
00970       H323Transport * transport,    
00971       PString & token,              
00972       unsigned capabilityLevel,     
00973       void * userData = NULL        
00974     );
00975 
00976 #endif // H323_H450
00977 
00981     BOOL ResolveCallParty(
00982       const PString & _remoteParty, 
00983       PStringList & addresses
00984     );
00985 
00992     BOOL ParsePartyName(
00993       const PString & party,          
00994       PString & alias,                
00995       H323TransportAddress & address  
00996     );
00997 
01002     virtual BOOL ClearCall(
01003       const PString & token,  
01004       H323Connection::CallEndReason reason =
01005                   H323Connection::EndedByLocalUser 
01006     );
01007 
01013      virtual void OnCallClearing(H323Connection * connection,       
01014                               H323Connection::CallEndReason reason  
01015      );
01016 
01021     virtual BOOL ClearCallSynchronous(
01022       const PString & token,            
01023       H323Connection::CallEndReason reason =
01024                         H323Connection::EndedByLocalUser 
01025     );
01026     virtual BOOL ClearCallSynchronous(
01027       const PString & token,                
01028       H323Connection::CallEndReason reason, 
01029       PSyncPoint * sync
01030     );
01031 
01038     virtual void ClearAllCalls(
01039       H323Connection::CallEndReason reason =
01040                   H323Connection::EndedByLocalUser, 
01041       BOOL wait = TRUE   
01042     );
01043 
01046     virtual BOOL HasConnection(
01047       const PString & token   
01048     );
01049 
01061     H323Connection * FindConnectionWithLock(
01062       const PString & token     
01063     );
01064 
01067     PStringList GetAllConnections();
01068 
01080     virtual BOOL OnIncomingCall(
01081       H323Connection & connection,    
01082       const H323SignalPDU & setupPDU,   
01083       H323SignalPDU & alertingPDU       
01084     );
01085     virtual BOOL OnIncomingCall(
01086       H323Connection & connection,           
01087       const H323SignalPDU & setupPDU,        
01088       H323SignalPDU & alertingPDU,           
01089       H323Connection::CallEndReason & reason 
01090     );
01091 
01096     virtual BOOL OnCallTransferInitiate(
01097       H323Connection & connection,    
01098       const PString & remoteParty     
01099     );
01100 
01105     virtual BOOL OnCallTransferIdentify(
01106       H323Connection & connection    
01107     );
01108 
01113     virtual void OnSendARQ(
01114       H323Connection & conn,
01115       H225_AdmissionRequest & arq
01116     );
01117 
01121     virtual void OnReceivedACF(
01122       H323Connection & conn,
01123       const H225_AdmissionConfirm & acf
01124     );
01125 
01129     virtual void OnReceivedARJ(
01130       H323Connection & conn,
01131       const H225_AdmissionReject & arj
01132     );
01133 
01152     virtual H323Connection::AnswerCallResponse OnAnswerCall(
01153       H323Connection & connection,    
01154       const PString & callerName,       
01155       const H323SignalPDU & setupPDU,   
01156       H323SignalPDU & connectPDU        
01157     );
01158 
01169     virtual BOOL OnAlerting(
01170       H323Connection & connection,    
01171       const H323SignalPDU & alertingPDU,  
01172       const PString & user                
01173     );
01174 
01183     virtual BOOL OnConnectionForwarded(
01184       H323Connection & connection,    
01185       const PString & forwardParty,   
01186       const H323SignalPDU & pdu       
01187     );
01188 
01197     virtual BOOL ForwardConnection(
01198       H323Connection & connection,    
01199       const PString & forwardParty,   
01200       const H323SignalPDU & pdu       
01201     );
01202 
01209     virtual void OnConnectionEstablished(
01210       H323Connection & connection,    
01211       const PString & token           
01212     );
01213 
01216     virtual BOOL IsConnectionEstablished(
01217       const PString & token   
01218     );
01219 
01226     virtual void OnConnectionCleared(
01227       H323Connection & connection,    
01228       const PString & token           
01229     );
01230 
01235     static PString BuildConnectionToken(
01236       const H323Transport & transport,  
01237       unsigned callReference,           
01238       BOOL fromRemote                   
01239     );
01240 
01246     virtual H323Connection * OnIncomingConnection(
01247       H323Transport * transport,  
01248       H323SignalPDU & setupPDU    
01249     );
01250 
01257     virtual BOOL OnOutgoingCall(
01258         H323Connection & conn, 
01259         const H323SignalPDU & connectPDU
01260     );
01261 
01264     virtual H323Connection * CreateConnection(
01265       unsigned callReference,     
01266       void * userData,            
01267       H323Transport * transport,  
01268       H323SignalPDU * setupPDU    
01269     );
01270     virtual H323Connection * CreateConnection(
01271       unsigned callReference,   
01272       void * userData           
01273     );
01274     virtual H323Connection * CreateConnection(
01275       unsigned callReference    
01276     );
01277 
01284     virtual void CleanUpConnections();
01286 
01287 #ifndef DISABLE_CALLAUTH
01288 
01296      virtual H235Authenticators CreateEPAuthenticators();
01297 
01301     virtual BOOL GetEPCredentials(PString & password,   
01302                                   PString & username    
01303                                   );
01304 
01307      virtual void SetEPCredentials(PString password,   
01308                                    PString username    
01309                                    );
01310 
01311      enum EPSecurityPolicy
01312      {
01313          SecNone,           
01314          SecRequest,        
01315          SecRequired        
01316      };
01317 
01320      virtual void SetEPSecurityPolicy(EPSecurityPolicy policy);
01321 
01324      virtual EPSecurityPolicy GetEPSecurityPolicy();
01325 
01329      H235AuthenticatorList GetAuthenticatorList();
01330 
01340       virtual BOOL OnCallAuthentication(const PString & username,  
01341                                         PString & password         
01342                                         );
01344 #endif
01345 
01352     virtual BOOL OnStartLogicalChannel(
01353       H323Connection & connection,    
01354       H323Channel & channel           
01355     );
01356 
01361     virtual void OnClosedLogicalChannel(
01362       H323Connection & connection,    
01363       const H323Channel & channel     
01364     );
01365 
01366 #ifndef NO_H323_AUDIO_CODECS
01367 
01374     virtual BOOL OpenAudioChannel(
01375       H323Connection & connection,  
01376       BOOL isEncoding,              
01377       unsigned bufferSize,          
01378       H323AudioCodec & codec        
01379     );
01380 #endif
01381 
01382 #ifndef NO_H323_VIDEO
01383 
01389     virtual BOOL OpenVideoChannel(
01390       H323Connection & connection,  
01391       BOOL isEncoding,              
01392       H323VideoCodec & codec        
01393     );
01394 #endif // NO_H323_VIDEO
01395 
01403     virtual void OnRTPStatistics(
01404       const H323Connection & connection,  
01405       const RTP_Session & session         
01406     ) const;
01407 
01414     virtual void OnRTPFinalStatistics(
01415       const H323Connection & connection,  
01416       const RTP_Session & session         
01417     ) const;
01418 
01420 
01427     virtual void OnUserInputString(
01428       H323Connection & connection,  
01429       const PString & value         
01430     );
01431 
01436     virtual void OnUserInputTone(
01437       H323Connection & connection,  
01438       char tone,                    
01439       unsigned duration,            
01440       unsigned logicalChannel,      
01441       unsigned rtpTimestamp         
01442     );
01443 
01447         virtual void OnGatekeeperNATDetect(
01448                 PIPSocket::Address publicAddr,         
01449                 PString & gkIdentifier,                
01450                 H323TransportAddress & gkRouteAddress  
01451                 );
01452                 
01457         virtual void OnGatekeeperOpenNATDetect(
01458                 PString & gkIdentifier,                
01459                 H323TransportAddress & gkRouteAddress  
01460                 );
01461 
01466         virtual BOOL OnGatekeeperAliases(
01467                 const H225_ArrayOf_AliasAddress & aliases  
01468                 );
01470 
01471 #ifdef H323_H248
01472 
01480     virtual void OnHTTPServiceControl(
01481       unsigned operation,  
01482       unsigned sessionId,  
01483       const PString & url  
01484     );
01485 
01491         virtual void OnCallCreditServiceControl(
01492       const PString & amount,         
01493       BOOL mode,                      
01494           const unsigned & durationLimit  
01495     );
01496 
01497 #ifdef H323_H350
01498 
01504     virtual void OnH350ServiceControl(
01505                 const PString & url,
01506                 const PString & BaseDN
01507                 );
01508 #endif
01509 
01519     virtual void OnCallCreditServiceControl(
01520       const PString & amount,  
01521       BOOL mode          
01522     );
01523 
01527     virtual void OnServiceControlSession(
01528       unsigned type,
01529       unsigned sessionid,
01530       const H323ServiceControlSession & session,
01531       H323Connection * connection
01532     );
01533 
01536     virtual H323ServiceControlSession * CreateServiceControlSession(
01537       const H225_ServiceControlDescriptor & contents
01538     );
01540 #endif // H323_H248
01541 
01544 #ifdef H323_T120
01545 
01555     virtual OpalT120Protocol * CreateT120ProtocolHandler(
01556       const H323Connection & connection  
01557     ) const;
01558 #endif
01559 
01560 #ifdef H323_T38
01561 
01571     virtual OpalT38Protocol * CreateT38ProtocolHandler(
01572       const H323Connection & connection  
01573     ) const;
01575 #endif
01576 
01577 #if H323_H224
01578 
01588     virtual OpalH224Handler * CreateH224ProtocolHandler(
01589       H323Connection & connection, 
01590       unsigned sessionID
01591     ) const;
01592         
01602     virtual OpalH281Handler * CreateH281ProtocolHandler(
01603       OpalH224Handler & h224Handler
01604     ) const;
01605 #endif
01606 
01614     virtual BOOL OnConferenceInvite(
01615       BOOL sending,                       
01616       const H323Connection * connection,  
01617       const H323SignalPDU & setupPDU      
01618     );
01619 
01625     virtual BOOL OnSendCallIndependentSupplementaryService(
01626       const H323Connection * connection,  
01627       H323SignalPDU & pdu                 
01628     );
01629 
01630     virtual BOOL OnReceiveCallIndependentSupplementaryService(
01631       const H323Connection * connection,  
01632       const H323SignalPDU & pdu                 
01633     );
01634 
01640     virtual BOOL OnNegotiateConferenceCapabilities(
01641       const H323SignalPDU & setupPDU
01642     );
01644 
01655     virtual void SetLocalUserName(
01656       const PString & name  
01657     );
01658 
01663     virtual const PString & GetLocalUserName() const { return localAliasNames[0]; }
01664 
01671     BOOL AddAliasName(
01672       const PString & name  
01673     );
01674 
01678     BOOL RemoveAliasName(
01679       const PString & name  
01680     );
01681 
01686     const PStringList & GetAliasNames() const { return localAliasNames; }
01687 
01688 #if P_LDAP
01689 
01692     const PString & GetDefaultILSServer() const { return ilsServer; }
01693 
01696     void SetDefaultILSServer(
01697       const PString & server
01698       ) { ilsServer = server; }
01699 
01700 #endif
01701 
01704     BOOL IsFastStartDisabled() const
01705       { return disableFastStart; }
01706 
01709     void DisableFastStart(
01710       BOOL mode 
01711     ) { disableFastStart = mode; } 
01712 
01715     BOOL IsH245TunnelingDisabled() const
01716       { return disableH245Tunneling; }
01717 
01720     void DisableH245Tunneling(
01721       BOOL mode 
01722     ) { disableH245Tunneling = mode; } 
01723 
01726     BOOL IsH245inSetupDisabled() const
01727       { return disableH245inSetup; }
01728 
01731     void DisableH245inSetup(
01732       BOOL mode 
01733     ) { disableH245inSetup = mode; } 
01734 
01737     BOOL DetectInBandDTMFDisabled() const
01738       { return disableDetectInBandDTMF; }
01739 
01742     void DisableDetectInBandDTMF(
01743       BOOL mode 
01744     ) { disableDetectInBandDTMF = mode; } 
01745 
01748     BOOL CanDisplayAmountString() const
01749       { return canDisplayAmountString; }
01750 
01753     void SetCanDisplayAmountString(
01754       BOOL mode 
01755     ) { canDisplayAmountString = mode; } 
01756 
01759     BOOL CanEnforceDurationLimit() const
01760       { return canEnforceDurationLimit; }
01761 
01764     void SetCanEnforceDurationLimit(
01765       BOOL mode 
01766     ) { canEnforceDurationLimit = mode; } 
01767 
01768 #ifdef H323_RTP_AGGREGATE
01769 
01771     void SetRTPAggregatationSize(
01772       PINDEX size            
01773     ) { rtpAggregationSize = size; }
01774 
01777     PINDEX GetRTPAggregationSize() const
01778     { return rtpAggregationSize; }
01779 
01782     PHandleAggregator * GetRTPAggregator();
01783 #endif
01784 
01785 #ifdef H323_SIGNAL_AGGREGATE
01786 
01788     void SetSignallingAggregationSize(
01789       PINDEX size            
01790     ) { signallingAggregationSize = size; }
01791 
01794     PINDEX GetSignallingAggregationSize() const
01795     { return signallingAggregationSize; }
01796 
01799     PHandleAggregator * GetSignallingAggregator();
01800 #endif
01801 
01802 #ifdef H323_H450
01803 
01806     unsigned GetCallIntrusionProtectionLevel() const { return callIntrusionProtectionLevel; }
01807 
01810     void SetCallIntrusionProtectionLevel(
01811       unsigned level  
01812     ) { PAssert(level<=3, PInvalidParameter); callIntrusionProtectionLevel = level; }
01813 
01816     virtual void OnReceivedInitiateReturnError();
01817 
01818 #endif // H323_H450
01819 
01820 #ifdef H323_AUDIO_CODECS
01821 #ifdef P_AUDIO
01822 
01830     virtual BOOL SetSoundChannelPlayDevice(const PString & name);
01831     virtual BOOL SetSoundChannelPlayDriver(const PString & name);
01832 
01837     const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
01838     const PString & GetSoundChannelPlayDriver() const { return soundChannelPlayDriver; }
01839 
01847     virtual BOOL SetSoundChannelRecordDevice(const PString & name);
01848     virtual BOOL SetSoundChannelRecordDriver(const PString & name);
01849 
01854     const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
01855     const PString & GetSoundChannelRecordDriver() const { return soundChannelRecordDriver; }
01856 
01859     unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
01860 
01863     void SetSoundChannelBufferDepth(
01864       unsigned depth    
01865     );
01866 
01867 #endif  // P_AUDIO
01868 
01871     H323AudioCodec::SilenceDetectionMode GetSilenceDetectionMode() const
01872       { return defaultSilenceDetection; }
01873 
01876     void SetSilenceDetectionMode(
01877       H323AudioCodec::SilenceDetectionMode mode 
01878     ) { defaultSilenceDetection = mode; } 
01879 
01880 #endif  // H323_AUDIO_CODECS
01881 
01884     H323Connection::SendUserInputModes GetSendUserInputMode() const { return defaultSendUserInputMode; }
01885 
01888     void SetSendUserInputMode(H323Connection::SendUserInputModes mode) { defaultSendUserInputMode = mode; }
01889 
01890 #ifdef H323_VIDEO
01891 
01894     BOOL CanAutoStartReceiveVideo() const { return autoStartReceiveVideo; }
01895 
01898     BOOL CanAutoStartTransmitVideo() const { return autoStartTransmitVideo; }
01899 
01900 #endif  // H323_VIDEO
01901 
01902 #ifdef H323_T38
01903 
01906     BOOL CanAutoStartReceiveFax() const { return autoStartReceiveFax; }
01907 
01910     BOOL CanAutoStartTransmitFax() const { return autoStartTransmitFax; }
01911 
01912 #endif // H323_T38
01913 
01916     BOOL CanAutoCallForward() const { return autoCallForward; }
01917 
01920     const H323ListenerList & GetListeners() const { return listeners; }
01921 
01924     const H323Capabilities & GetCapabilities() const { return capabilities; }
01925 
01928     enum TerminalTypes {
01929       e_TerminalOnly = 50,
01930       e_TerminalAndMC = 70,
01931       e_GatewayOnly = 60,
01932       e_GatewayAndMC = 80,
01933       e_GatewayAndMCWithDataMP = 90,
01934       e_GatewayAndMCWithAudioMP = 100,
01935       e_GatewayAndMCWithAVMP = 110,
01936       e_GatekeeperOnly = 120,
01937       e_GatekeeperWithDataMP = 130,
01938       e_GatekeeperWithAudioMP = 140,
01939       e_GatekeeperWithAVMP = 150,
01940       e_MCUOnly = 160,
01941       e_MCUWithDataMP = 170,
01942       e_MCUWithAudioMP = 180,
01943       e_MCUWithAVMP = 190
01944     };
01945 
01948     TerminalTypes GetTerminalType() const { return terminalType; }
01949 
01952     BOOL IsTerminal() const;
01953 
01956     BOOL IsGateway() const;
01957 
01960     BOOL IsGatekeeper() const;
01961 
01964     BOOL IsMCU() const;
01965 
01966 #ifdef H323_AUDIO_CODECS
01967 
01970     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
01971 
01975     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
01976 
01979     void SetAudioJitterDelay(
01980       unsigned minDelay,   
01981       unsigned maxDelay    
01982     );
01983 #endif
01984 
01987     unsigned GetInitialBandwidth() const { return initialBandwidth; }
01988 
01991     void SetInitialBandwidth(unsigned bandwidth) { initialBandwidth = bandwidth; }
01992 
01995     virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &);
01996 
01999     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &);
02000 
02004         virtual void LoadBaseFeatureSet();
02005 
02009         virtual BOOL HandleUnsolicitedInformation(const H323SignalPDU & pdu);
02010 
02011 #ifdef H323_H460
02012 
02014     H460_FeatureSet & GetFeatureSet() {  return features.