h323con.h

Go to the documentation of this file.
00001 /*
00002  * h323con.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: h323con.h,v $
00030  * Revision 1.101  2006/07/06 05:20:18  shorne
00031  * Added Feature CallEndReason
00032  *
00033  * Revision 1.100  2006/06/27 12:35:03  csoutheren
00034  * Patch 1366328 - Support for H.450.3 divertingLegInformation2
00035  * Thanks to Norbert Bartalsky
00036  *
00037  * Revision 1.99  2006/06/23 20:01:28  shorne
00038  * More H460 support
00039  *
00040  * Revision 1.98  2006/06/23 07:06:04  csoutheren
00041  * Fixed linux compile
00042  *
00043  * Revision 1.97  2006/06/23 06:02:44  csoutheren
00044  * Added missing declarations for H.224 backport
00045  *
00046  * Revision 1.96  2006/05/30 11:14:55  hfriederich
00047  * Switch from DISABLE_H460 to H323_H460
00048  *
00049  * Revision 1.95  2006/05/16 11:41:15  shorne
00050  * call credit, AEC and H460 support
00051  *
00052  * Revision 1.94  2006/04/07 10:24:20  rjongbloed
00053  * Fixed DevStudio compile errors
00054  *
00055  * Revision 1.93  2006/04/06 08:22:17  csoutheren
00056  * Added support for conference commands
00057  *
00058  * Revision 1.92  2006/03/02 07:52:49  csoutheren
00059  * Ensure prompt close of channels when using aggregation
00060  * Ensure MonitorCallStatus called when using aggregation
00061  *
00062  * Revision 1.91  2006/02/24 04:52:17  csoutheren
00063  * Fixd problem with H.245 aggregation
00064  *
00065  * Revision 1.90  2006/01/26 03:36:51  shorne
00066  * Add the ability to remove a local input device when placing a call on hold
00067  *
00068  * Revision 1.89  2006/01/24 08:15:24  csoutheren
00069  * Implement outgoing H.225 aggregation, and H.245 aggregation (disabled by default)
00070  * More testing to do, but this looks good :)
00071  *
00072  * Revision 1.88  2006/01/23 05:58:25  csoutheren
00073  * Working outgoing H.225 aggregation (disabled by default)
00074  *
00075  * Revision 1.87  2006/01/20 00:32:24  csoutheren
00076  * First check-in of signalling aggregation code - incomplete and disabled by default
00077  *
00078  * Revision 1.86  2006/01/18 07:46:08  csoutheren
00079  * Initial version of RTP aggregation (disabled by default)
00080  *
00081  * Revision 1.85  2005/12/09 05:20:07  csoutheren
00082  * Added ability to set explicit Q.931 cause code on call end
00083  *
00084  * Revision 1.84  2005/12/06 05:28:55  csoutheren
00085  * Changed AttachSignalChannel to be virtual
00086  *
00087  * Revision 1.83  2005/11/30 13:05:01  csoutheren
00088  * Changed tags for Doxygen
00089  *
00090  * Revision 1.82  2005/11/04 06:41:28  csoutheren
00091  * Changed PMutex to PTimedMutex
00092  *
00093  * Revision 1.81  2005/09/16 08:11:06  csoutheren
00094  * Added new error code
00095  * Added override for OnIncomingCall that can set return code
00096  *
00097  * Revision 1.80  2005/08/30 08:29:30  csoutheren
00098  * Added new error code
00099  *
00100  * Revision 1.79  2005/08/27 02:14:21  csoutheren
00101  * Capture time that reverse fast start acknowledge is received
00102  * Capture time that connect is sent/received
00103  *
00104  * Revision 1.78  2005/01/03 14:03:20  csoutheren
00105  * Added new configure options and ability to disable/enable modules
00106  *
00107  * Revision 1.77  2005/01/03 06:25:52  csoutheren
00108  * Added extensive support for disabling code modules at compile time
00109  *
00110  * Revision 1.76  2004/12/08 01:59:22  csoutheren
00111  * initial support for Transnexus OSP toolkit
00112  *
00113  * Revision 1.75  2004/11/22 11:30:42  rjongbloed
00114  * Added ability to restart H.245 negotiations, thanks Norbert Bartalsky
00115  *
00116  * Revision 1.74  2004/09/27 08:25:14  csoutheren
00117  * Changed in-header documentation for external headers to reflect changes
00118  * in external RTP interface
00119  *
00120  * Revision 1.73  2004/09/07 22:50:55  rjongbloed
00121  * Changed usage of template function as MSVC6 will not compile it.
00122  *
00123  * Revision 1.72  2004/09/03 01:06:09  csoutheren
00124  * Added initial hooks for H.460 GEF
00125  * Thanks to Simon Horne and ISVO (Asia) Pte Ltd. for this contribution
00126  *
00127  * Revision 1.71  2004/07/13 10:19:40  csoutheren
00128  * Fixed cut & paste errors in comments
00129  *
00130  * Revision 1.70  2004/06/15 03:30:00  csoutheren
00131  * Added OnSendARQ to allow access to the ARQ message before sent by connection
00132  *
00133  * Revision 1.69  2004/04/20 05:24:54  csoutheren
00134  * Added ability to specify Q.931 DisplayName
00135  *
00136  * Revision 1.68  2004/04/13 05:50:50  csoutheren
00137  * Added function to get access to the connection NAT flag
00138  *
00139  * Revision 1.67  2004/04/07 05:31:42  csoutheren
00140  * Added ability to receive calls from endpoints behind NAT firewalls
00141  *
00142  * Revision 1.66  2004/03/04 04:48:29  csoutheren
00143  * Added virtual keyword to allow overring of capability management functions
00144  * Added additional response code needed for MCU
00145  *
00146  * Revision 1.65  2004/02/26 08:32:47  csoutheren
00147  * Added release complete codes for MCU
00148  *
00149  * Revision 1.64  2003/12/28 02:38:14  csoutheren
00150  * Added H323EndPoint::OnOutgoingCall
00151  *
00152  * Revision 1.63  2003/12/14 10:42:29  rjongbloed
00153  * Changes for compilability without video support.
00154  *
00155  * Revision 1.62  2003/10/27 06:03:38  csoutheren
00156  * Added support for QoS
00157  *   Thanks to Henry Harrison of AliceStreet
00158  *
00159  * Revision 1.61  2003/10/09 09:47:45  csoutheren
00160  * Fixed problem with re-opening RTP half-channels under unusual
00161  * circumstances. Thanks to Damien Sandras
00162  *
00163  * Revision 1.60  2003/04/30 00:28:50  robertj
00164  * Redesigned the alternate credentials in ARQ system as old implementation
00165  *   was fraught with concurrency issues, most importantly it can cause false
00166  *   detection of replay attacks taking out an endpoint completely.
00167  *
00168  * Revision 1.59  2003/02/12 23:59:22  robertj
00169  * Fixed adding missing endpoint identifer in SETUP packet when gatekeeper
00170  * routed, pointed out by Stefan Klein
00171  * Also fixed correct rutrn of gk routing in IRR packet.
00172  *
00173  * Revision 1.58  2002/11/27 06:54:52  robertj
00174  * Added Service Control Session management as per Annex K/H.323 via RAS
00175  *   only at this stage.
00176  * Added H.248 ASN and very primitive infrastructure for linking into the
00177  *   Service Control Session management system.
00178  * Added basic infrastructure for Annex K/H.323 HTTP transport system.
00179  * Added Call Credit Service Control to display account balances.
00180  *
00181  * Revision 1.57  2002/11/15 05:17:22  robertj
00182  * Added facility redirect support without changing the call token for access
00183  *   to the call. If it gets redirected a new H323Connection object is
00184  *   created but it looks like the same thing to an application.
00185  *
00186  * Revision 1.56  2002/11/13 04:37:23  robertj
00187  * Added ability to get (and set) Q.931 release complete cause codes.
00188  *
00189  * Revision 1.55  2002/11/10 06:17:26  robertj
00190  * Fixed minor documentation errors.
00191  *
00192  * Revision 1.54  2002/11/05 00:24:09  robertj
00193  * Added function to determine if Q.931 CONNECT sent/received.
00194  *
00195  * Revision 1.53  2002/10/31 00:31:47  robertj
00196  * Enhanced jitter buffer system so operates dynamically between minimum and
00197  *   maximum values. Altered API to assure app writers note the change!
00198  *
00199  * Revision 1.52  2002/09/16 01:14:15  robertj
00200  * Added #define so can select if #pragma interface/implementation is used on
00201  *   platform basis (eg MacOS) rather than compiler, thanks Robert Monaghan.
00202  *
00203  * Revision 1.51  2002/09/03 06:19:36  robertj
00204  * Normalised the multi-include header prevention ifdef/define symbol.
00205  *
00206  * Revision 1.50  2002/08/05 10:03:47  robertj
00207  * Cosmetic changes to normalise the usage of pragma interface/implementation.
00208  *
00209  * Revision 1.49  2002/08/05 05:17:37  robertj
00210  * Fairly major modifications to support different authentication credentials
00211  *   in ARQ to the logged in ones on RRQ. For both client and server.
00212  * Various other H.235 authentication bugs and anomalies fixed on the way.
00213  *
00214  * Revision 1.48  2002/07/05 02:22:56  robertj
00215  * Added support for standard and non-standard T.38 mode change.
00216  *
00217  * Revision 1.47  2002/07/04 00:40:31  robertj
00218  * More H.450.11 call intrusion implementation, thanks Aleksandar Todorovic
00219  *
00220  * Revision 1.46  2002/06/22 06:11:30  robertj
00221  * Fixed bug on sometimes missing received endSession causing 10 second
00222  *   timeout in connection clean up.
00223  *
00224  * Revision 1.45  2002/06/22 05:48:38  robertj
00225  * Added partial implementation for H.450.11 Call Intrusion
00226  *
00227  * Revision 1.44  2002/06/13 06:15:19  robertj
00228  * Allowed TransferCall() to be used on H323Connection as well as H323EndPoint.
00229  *
00230  * Revision 1.43  2002/06/05 08:58:58  robertj
00231  * Fixed documentation of remote application name string.
00232  * Added missing virtual keywards on some protocol handler functions.
00233  *
00234  * Revision 1.42  2002/05/29 06:40:29  robertj
00235  * Changed sending of endSession/ReleaseComplete PDU's to occur immediately
00236  *   on call clearance and not wait for background thread to do it.
00237  * Stricter compliance by waiting for reply endSession before closing down.
00238  *
00239  * Revision 1.41  2002/05/29 03:55:17  robertj
00240  * Added protocol version number checking infrastructure, primarily to improve
00241  *   interoperability with stacks that are unforgiving of new features.
00242  *
00243  * Revision 1.40  2002/05/21 09:32:49  robertj
00244  * Added ability to set multiple alias names ona  connection by connection
00245  *   basis, defaults to endpoint list, thanks Artis Kugevics
00246  *
00247  * Revision 1.39  2002/05/15 23:59:33  robertj
00248  * Added memory management of created T.38 and T.120 handlers.
00249  * Improved documentation for use of T.38 and T.120 functions.
00250  * Added ability to initiate a mode change for non-standard T.38
00251  *
00252  * Revision 1.38  2002/05/07 01:31:51  dereks
00253  * Fix typo in documentation.
00254  *
00255  * Revision 1.37  2002/05/03 05:38:15  robertj
00256  * Added Q.931 Keypad IE mechanism for user indications (DTMF).
00257  *
00258  * Revision 1.36  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.35  2002/04/25 20:55:25  dereks
00263  * Fix documentation. Thanks Olaf Schulz.
00264  *
00265  * Revision 1.34  2002/04/17 00:50:34  robertj
00266  * Added ability to disable the in band DTMF detection.
00267  *
00268  * Revision 1.33  2002/03/27 06:04:42  robertj
00269  * Added Temporary Failure end code for connection, an application may
00270  *   immediately retry the call if this occurs.
00271  *
00272  * Revision 1.32  2002/02/11 04:20:48  robertj
00273  * Fixed documentation errors, thanks Horacio J. Peņa
00274  *
00275  * Revision 1.31  2002/02/11 04:16:37  robertj
00276  * Fixed bug where could send DRQ if never received an ACF.
00277  *
00278  * Revision 1.30  2002/02/06 06:30:47  craigs
00279  * Fixed problem whereby MSD/TCS was stalled if H245 was included in
00280  * SETUP, but other end did not respond
00281  *
00282  * Revision 1.29  2002/02/04 07:17:52  robertj
00283  * Added H.450.2 Consultation Transfer, thanks Norwood Systems.
00284  *
00285  * Revision 1.28  2002/01/25 05:20:05  robertj
00286  * Moved static strings for enum printing to inside of function, could crash with DLL's
00287  *
00288  * Revision 1.27  2002/01/24 06:29:02  robertj
00289  * Added option to disable H.245 negotiation in SETUP pdu, this required
00290  *   API change so have a bit mask instead of a series of booleans.
00291  *
00292  * Revision 1.26  2002/01/23 12:45:37  rogerh
00293  * Add the DTMF decoder. This identifies DTMF tones in an audio stream.
00294  *
00295  * Revision 1.25  2002/01/23 07:12:48  robertj
00296  * Added hooks for in band DTMF detection. Now need the detector!
00297  *
00298  * Revision 1.24  2002/01/22 22:48:21  robertj
00299  * Fixed RFC2833 support (transmitter) requiring large rewrite
00300  *
00301  * Revision 1.23  2002/01/18 06:02:08  robertj
00302  * Added some H323v4 functions (fastConnectRefused & TCS in SETUP)
00303  *
00304  * Revision 1.22  2002/01/17 07:04:58  robertj
00305  * Added support for RFC2833 embedded DTMF in the RTP stream.
00306  *
00307  * Revision 1.21  2002/01/14 00:05:24  robertj
00308  * Added H.450.6, better H.450.2 error handling and  and Music On Hold.
00309  * Added destExtraCallInfo field for ARQ.
00310  *   Thanks Ben Madsen of Norwood Systems
00311  *
00312  * Revision 1.20  2002/01/10 05:13:50  robertj
00313  * Added support for external RTP stacks, thanks NuMind Software Systems.
00314  *
00315  * Revision 1.19  2002/01/09 00:21:36  robertj
00316  * Changes to support outgoing H.245 RequstModeChange.
00317  *
00318  * Revision 1.18  2001/12/22 03:20:31  robertj
00319  * Added create protocol function to H323Connection.
00320  *
00321  * Revision 1.17  2001/12/22 03:09:36  robertj
00322  * Changed OnRequstModeChange to return ack, then actually do the change.
00323  *
00324  * Revision 1.16  2001/12/22 01:52:54  robertj
00325  * Added more support for H.245 RequestMode operation.
00326  *
00327  * Revision 1.15  2001/12/15 08:09:54  robertj
00328  * Added alerting, connect and end of call times to be sent to RAS server.
00329  *
00330  * Revision 1.14  2001/12/13 10:54:23  robertj
00331  * Added ability to automatically add ACF access token to SETUP pdu.
00332  *
00333  * Revision 1.13  2001/11/01 06:11:54  robertj
00334  * Plugged very small mutex hole that could cause crashes.
00335  *
00336  * Revision 1.12  2001/11/01 00:27:33  robertj
00337  * Added default Fast Start disabled and H.245 tunneling disable flags
00338  *   to the endpoint instance.
00339  *
00340  * Revision 1.11  2001/10/24 00:54:13  robertj
00341  * Made cosmetic changes to H.245 miscellaneous command function.
00342  *
00343  * Revision 1.10  2001/10/23 02:18:06  dereks
00344  * Initial release of CU30 video codec.
00345  *
00346  * Revision 1.9  2001/09/26 06:20:56  robertj
00347  * Fixed properly nesting connection locking and unlocking requiring a quite
00348  *   large change to teh implementation of how calls are answered.
00349  *
00350  * Revision 1.8  2001/09/19 03:30:53  robertj
00351  * Added some support for overlapped dialing, thanks Chris Purvis & Nick Hoath.
00352  *
00353  * Revision 1.7  2001/09/13 06:48:13  robertj
00354  * Added call back functions for remaining Q.931/H.225 messages.
00355  * Added call back to allow modification of Release Complete,thanks Nick Hoath
00356  *
00357  * Revision 1.6  2001/09/12 06:57:58  robertj
00358  * Added support for iNow Access Token from gk, thanks Nick Hoath
00359  *
00360  * Revision 1.5  2001/09/12 06:04:36  robertj
00361  * Added support for sending UUIE's to gk on request, thanks Nick Hoath
00362  *
00363  * Revision 1.4  2001/09/11 01:24:36  robertj
00364  * Added conditional compilation to remove video and/or audio codecs.
00365  *
00366  * Revision 1.3  2001/08/22 06:54:50  robertj
00367  * Changed connection locking to use double mutex to guarantee that
00368  *   no threads can ever deadlock or access deleted connection.
00369  *
00370  * Revision 1.2  2001/08/16 07:49:16  robertj
00371  * Changed the H.450 support to be more extensible. Protocol handlers
00372  *   are now in separate classes instead of all in H323Connection.
00373  *
00374  * Revision 1.1  2001/08/06 03:08:11  robertj
00375  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00376  *
00377  */
00378 
00379 #ifndef __OPAL_H323CON_H
00380 #define __OPAL_H323CON_H
00381 
00382 #ifdef P_USE_PRAGMA
00383 #pragma interface
00384 #endif
00385 
00386 #ifdef P_DTMF
00387 #include <ptclib/dtmf.h>
00388 #endif
00389 
00390 #include "h323caps.h"
00391 #include "transports.h"
00392 #include "channels.h"
00393 #include "guid.h"
00394 #include "openh323buildopts.h"
00395 #include "h235auth.h"
00396 
00397 #ifdef H323_TRANSNEXUS_OSP
00398 #include "opalosp.h"
00399 /*
00400 namespace OpalOSP {
00401   class Transaction;
00402   class Transaction::DestinationInfo;
00403 };
00404 */
00405 #endif
00406 
00407 #if OPAL_H224
00408 class OpalH224Handler;
00409 class OpalH281Handler;
00410 #endif
00411 
00412 #ifdef H323_SIGNAL_AGGREGATE
00413 #include <ptclib/sockagg.h>
00414 
00417 class H323AggregatedH2x5Handle : public PAggregatedHandle
00418 {
00419   PCLASSINFO(H323AggregatedH2x5Handle, PAggregatedHandle)
00420   public:
00421     H323AggregatedH2x5Handle(H323Transport & _transport, H323Connection & _connection);
00422     ~H323AggregatedH2x5Handle();
00423 
00424     PAggregatorFDList_t GetFDs();
00425 
00426     BOOL OnRead();
00427     virtual BOOL HandlePDU(BOOL ok, PBYTEArray & pdu) = 0;
00428     PTimeInterval GetTimeout()
00429     { return transport.GetReadTimeout(); }
00430 
00431   protected:
00432     PAggregatorFD fd;
00433     H323Transport & transport;
00434     H323Connection & connection;
00435     PBYTEArray pduBuffer;
00436     PINDEX pduDataLen;
00437 };
00438 
00439 #endif
00440 
00441 #ifdef H323_H248
00442  #include "svcctrl.h"
00443 #endif
00444 
00445 
00446 /* The following classes have forward references to avoid including the VERY
00447    large header files for H225 and H245. If an application requires access
00448    to the protocol classes they can include them, but for simple usage their
00449    inclusion can be avoided.
00450  */
00451 class PPER_Stream;
00452 
00453 class H225_EndpointType;
00454 class H225_TransportAddress;
00455 class H225_ArrayOf_PASN_OctetString;
00456 class H225_ProtocolIdentifier;
00457 class H225_AdmissionRequest;
00458 class H225_FeatureSet;
00459 class H225_Setup_UUIE;
00460 class H225_ArrayOf_ServiceControlSession;
00461 class H225_ServiceControlSession_reason;
00462 
00463 class H245_TerminalCapabilitySet;
00464 class H245_TerminalCapabilitySetReject;
00465 class H245_OpenLogicalChannel;
00466 class H245_OpenLogicalChannelAck;
00467 class H245_TransportAddress;
00468 class H245_UserInputIndication;
00469 class H245_RequestMode;
00470 class H245_RequestModeAck;
00471 class H245_RequestModeReject;
00472 class H245_ModeDescription;
00473 class H245_ArrayOf_ModeDescription;
00474 class H245_SendTerminalCapabilitySet;
00475 class H245_MultiplexCapability;
00476 class H245_FlowControlCommand;
00477 class H245_MiscellaneousCommand;
00478 class H245_MiscellaneousIndication;
00479 class H245_JitterIndication;
00480 class H245_ConferenceRequest;
00481 class H245_ConferenceResponse;
00482 class H245_ConferenceCommand;
00483 class H245_ConferenceIndication;
00484 
00485 class H323SignalPDU;
00486 class H323ControlPDU;
00487 
00488 class H235Authenticators;
00489 
00490 class H245NegMasterSlaveDetermination;
00491 class H245NegTerminalCapabilitySet;
00492 class H245NegLogicalChannels;
00493 class H245NegRequestMode;
00494 class H245NegRoundTripDelay;
00495 
00496 #ifdef H323_H450
00497 
00498 class H450xDispatcher;
00499 class H4502Handler;
00500 class H4503Handler;
00501 class H4504Handler;
00502 class H4506Handler;
00503 class H45011Handler;
00504 
00505 #endif
00506 
00507 #ifdef H323_T120
00508 class OpalT120Protocol;
00509 #endif
00510 
00511 #ifdef H323_T38
00512 class OpalT38Protocol;
00513 #endif
00514 
00515 #ifdef OPAL_H224
00516 class OpalH224Handler;
00517 class OpalH281Handler;
00518 #endif
00519 
00520 class OpalRFC2833;
00521 class OpalRFC2833Info;
00522 
00523 #ifdef H323_H460
00524 class H460_FeatureSet;
00525 #endif
00526 
00527 
00529 
00537 class H323Connection : public PObject
00538 {
00539   PCLASSINFO(H323Connection, PObject);
00540 
00541   friend class AggregatedH225Handle;
00542   friend class AggregatedH245Handle;
00543   public:
00546     enum Options {
00547       FastStartOptionDisable       = 0x0001,
00548       FastStartOptionEnable        = 0x0002,
00549       FastStartOptionMask          = 0x0003,
00550 
00551       H245TunnelingOptionDisable   = 0x0004,
00552       H245TunnelingOptionEnable    = 0x0008,
00553       H245TunnelingOptionMask      = 0x000c,
00554 
00555       H245inSetupOptionDisable     = 0x0010,
00556       H245inSetupOptionEnable      = 0x0020,
00557       H245inSetupOptionMask        = 0x0030,
00558 
00559       DetectInBandDTMFOptionDisable= 0x0040,
00560       DetectInBandDTMFOptionEnable = 0x0080,
00561       DetectInBandDTMFOptionMask   = 0x00c0,
00562 
00563 #ifdef H323_RTP_AGGREGATE
00564       RTPAggregationDisable        = 0x0100,
00565       RTPAggregationEnable         = 0x0200,
00566       RTPAggregationMask           = 0x0300,
00567 #endif
00568 
00569 #ifdef H323_SIGNAL_AGGREGATE
00570       SignallingAggregationDisable = 0x0400,
00571       SignallingAggregationEnable  = 0x0800,
00572       SignallingAggregationMask    = 0x0c00
00573 #endif
00574     };
00575 
00578     H323Connection(
00579       H323EndPoint & endpoint,  
00580       unsigned callReference,   
00581       unsigned options = 0      
00582     );
00583 
00586     ~H323Connection();
00587 
00597     BOOL Lock();
00598 
00610     int TryLock();
00611 
00617     void Unlock();
00618 
00625     virtual void OnSendARQ(
00626       H225_AdmissionRequest & arq
00627     );
00628 
00632     virtual void OnEstablished();
00633 
00637     virtual void OnCleared();
00638 
00645     BOOL IsConnected() const { return connectionState == HasExecutedSignalConnect || connectionState == EstablishedConnection; }
00646 
00652     BOOL IsEstablished() const { return connectionState == EstablishedConnection; }
00653 
00658     enum CallEndReason {
00659       EndedByLocalUser,         
00660       EndedByNoAccept,          
00661       EndedByAnswerDenied,      
00662       EndedByRemoteUser,        
00663       EndedByRefusal,           
00664       EndedByNoAnswer,          
00665       EndedByCallerAbort,       
00666       EndedByTransportFail,     
00667       EndedByConnectFail,       
00668       EndedByGatekeeper,        
00669       EndedByNoUser,            
00670       EndedByNoBandwidth,       
00671       EndedByCapabilityExchange,
00672       EndedByCallForwarded,     
00673       EndedBySecurityDenial,    
00674       EndedByLocalBusy,         
00675       EndedByLocalCongestion,   
00676       EndedByRemoteBusy,        
00677       EndedByRemoteCongestion,  
00678       EndedByUnreachable,       
00679       EndedByNoEndPoint,        
00680       EndedByHostOffline,       
00681       EndedByTemporaryFailure,  
00682       EndedByQ931Cause,         
00683       EndedByDurationLimit,     
00684       EndedByInvalidConferenceID, 
00685       EndedByOSPRefusal,          
00686       EndedByInvalidNumberFormat, 
00687       EndedByUnspecifiedProtocolError, 
00688       EndedByNoFeatureSupport,         
00689       NumCallEndReasons
00690     };
00691 #if PTRACING
00692     friend ostream & operator<<(ostream & o, CallEndReason r);
00693 #endif
00694 
00703     CallEndReason GetCallEndReason() const { return callEndReason; }
00704 
00709     virtual void SetCallEndReason(
00710       CallEndReason reason,     
00711       PSyncPoint * sync = NULL  
00712     );
00713 
00719     virtual BOOL ClearCall(
00720       CallEndReason reason = EndedByLocalUser  
00721     );
00722 
00725     virtual BOOL ClearCallSynchronous(
00726       PSyncPoint * sync,
00727       CallEndReason reason = EndedByLocalUser  
00728     );
00729 
00738     virtual void CleanUpOnCallEnd();
00740 
00741 
00746     virtual void AttachSignalChannel(
00747       const PString & token,    
00748       H323Transport * channel,  
00749       BOOL answeringCall        
00750     );
00751 
00754     BOOL WriteSignalPDU(
00755       H323SignalPDU & pdu       
00756     );
00757 
00761     virtual void HandleSignallingChannel();
00762 
00766     virtual BOOL HandleReceivedSignalPDU(BOOL readStatus, H323SignalPDU & pdu);
00767 
00771     virtual BOOL HandleReceivedControlPDU(BOOL readStatus, PPER_Stream & strm);
00772 
00776     virtual BOOL HandleSignalPDU(
00777       H323SignalPDU & pdu       
00778     );
00779 
00783     virtual void HandleTunnelPDU(
00784       H323SignalPDU * txPDU       
00785     );
00786 
00794     virtual BOOL OnReceivedSignalSetup(
00795       const H323SignalPDU & pdu   
00796     );
00797 
00804     virtual BOOL OnReceivedSignalSetupAck(
00805       const H323SignalPDU & pdu   
00806     );
00807 
00814     virtual BOOL OnReceivedSignalInformation(
00815       const H323SignalPDU & pdu   
00816     );
00817 
00826     virtual BOOL OnReceivedCallProceeding(
00827       const H323SignalPDU & pdu   
00828     );
00829 
00838     virtual BOOL OnReceivedProgress(
00839       const H323SignalPDU & pdu   
00840     );
00841 
00848     virtual BOOL OnReceivedAlerting(
00849       const H323SignalPDU & pdu   
00850     );
00851 
00860     virtual BOOL OnReceivedSignalConnect(
00861       const H323SignalPDU & pdu   
00862     );
00863 
00872     virtual BOOL OnReceivedFacility(
00873       const H323SignalPDU & pdu   
00874     );
00875 
00882     virtual BOOL OnReceivedSignalNotify(
00883       const H323SignalPDU & pdu   
00884     );
00885 
00892     virtual BOOL OnReceivedSignalStatus(
00893       const H323SignalPDU & pdu   
00894     );
00895 
00902     virtual BOOL OnReceivedStatusEnquiry(
00903       const H323SignalPDU & pdu   
00904     );
00905 
00910     virtual void OnReceivedReleaseComplete(
00911       const H323SignalPDU & pdu   
00912     );
00913 
00920     virtual BOOL OnUnknownSignalPDU(
00921       const H323SignalPDU & pdu  
00922     );
00923 
00935     virtual BOOL OnIncomingCall(
00936       const H323SignalPDU & setupPDU,   
00937       H323SignalPDU & alertingPDU       
00938     );
00939     virtual BOOL OnIncomingCall(
00940       const H323SignalPDU & setupPDU,   
00941       H323SignalPDU & alertingPDU,      
00942       CallEndReason & reason            
00943     );
00944 
00954     virtual BOOL ForwardCall(
00955       const PString & forwardParty   
00956     );
00957 
00958 #ifdef H323_H450
00959 
00964     void TransferCall(
00965       const PString & remoteParty,   
00966       const PString & callIdentity = PString::Empty()
00968     );
00969 
00974     void ConsultationTransfer(
00975       const PString & primaryCallToken  
00976     );
00977 
00980     virtual void OnReceivedInitiateReturnError();
00981 
00988     virtual void HandleConsultationTransfer(
00989       const PString & callIdentity, 
00991       H323Connection & incoming     
00992     );
00993 
00996     BOOL IsTransferringCall() const;
00997 
01000     BOOL IsTransferredCall() const;
01001 
01006     virtual void HandleTransferCall(
01007       const PString & token,
01008       const PString & identity
01009     );
01010 
01015     int GetCallTransferInvokeId();
01016 
01024     virtual void HandleCallTransferFailure(
01025       const int returnError    
01026     );
01027 
01032     void SetAssociatedCallToken(
01033       const PString & token  
01034     );
01035 
01040     virtual void OnConsultationTransferSuccess(
01041       H323Connection & secondaryCall  
01042     );
01043 
01048      virtual void SetCallLinkage(
01049                 H225_AdmissionRequest & arq   
01050       );
01051 
01056      virtual void GetCallLinkage(
01057                 const H225_AdmissionRequest & arq  
01058         );
01059 
01065     BOOL GetRedirectingNumber(
01066       PString &originalCalledNr,               
01067       PString &lastDivertingNr,
01068       int &divCounter, 
01069       int &originaldivReason,
01070       int &divReason);
01071 
01076     void HoldCall(
01077       BOOL localHold   
01078     );
01079 
01085     void RetrieveCall();
01086 
01093     void SetHoldMedia(
01094       PChannel * audioChannel
01095     );
01096 
01100     virtual PChannel *  OnCallHold(BOOL IsEncoder,     
01101                                unsigned sessionId,     
01102                                unsigned bufferSize,    
01103                                PChannel * channel);    
01104 
01108     virtual PChannel *  OnCallRetrieve(BOOL IsEncoder,  
01109                                unsigned sessionId,      
01110                                unsigned bufferSize,     
01111                                PChannel * channel);     
01112 
01115     BOOL IsMediaOnHold() const;
01116 
01119     BOOL IsLocalHold() const;
01120 
01123     BOOL IsRemoteHold() const;
01124 
01127     BOOL IsCallOnHold() const;
01128 
01133     virtual void IntrudeCall(
01134       unsigned capabilityLevel
01135     );
01136 
01141     virtual void HandleIntrudeCall(
01142       const PString & token,
01143       const PString & identity
01144     );
01145 
01151     void SetCallIntrusion() { isCallIntrusion = TRUE; }
01152 
01153     BOOL IsCallIntrusion() { return isCallIntrusion; }
01154 
01157     unsigned GetLocalCallIntrusionProtectionLevel() { return callIntrusionProtectionLevel; }
01158 
01162     virtual BOOL GetRemoteCallIntrusionProtectionLevel(
01163       const PString & callToken,
01164       unsigned callIntrusionProtectionLevel
01165     );
01166 
01167     virtual void SetIntrusionImpending();
01168 
01169     virtual void SetForcedReleaseAccepted();
01170 
01171     virtual void SetIntrusionNotAuthorized();
01172 
01179     void SendCallWaitingIndication(
01180       const unsigned nbOfAddWaitingCalls = 0   
01181     );
01182 
01183 #endif // H323_H450
01184 
01185     enum AnswerCallResponse {
01186       AnswerCallNow,               
01187       AnswerCallDenied,            
01188       AnswerCallPending,           
01189       AnswerCallDeferred,          
01190       AnswerCallAlertWithMedia,    
01191       AnswerCallDeferredWithMedia, 
01192       AnswerCallDeniedByInvalidCID, 
01193       NumAnswerCallResponses
01194     };
01195 #if PTRACING
01196     friend ostream & operator<<(ostream & o, AnswerCallResponse s);
01197 #endif
01198 
01225     virtual AnswerCallResponse OnAnswerCall(
01226       const PString & callerName,       
01227       const H323SignalPDU & setupPDU,   
01228       H323SignalPDU & connectPDU        
01229     );
01230 
01241     void AnsweringCall(
01242       AnswerCallResponse response 
01243     );
01244 
01255     virtual CallEndReason SendSignalSetup(
01256       const PString & alias,                
01257       const H323TransportAddress & address  
01258     );
01259 
01271     virtual BOOL OnSendSignalSetup(
01272       H323SignalPDU & setupPDU   
01273     );
01274 
01283     virtual BOOL OnSendCallProceeding(
01284       H323SignalPDU & callProceedingPDU   
01285     );
01286 
01298     virtual BOOL OnSendReleaseComplete(
01299       H323SignalPDU & releaseCompletePDU 
01300     );
01301 
01312     virtual BOOL OnAlerting(
01313       const H323SignalPDU & alertingPDU,  
01314       const PString & user                
01315     );
01316 
01331     virtual BOOL OnInsufficientDigits();
01332 
01345     virtual void SendMoreDigits(
01346       const PString & digits    
01347     );
01348 
01358     virtual BOOL OnOutgoingCall(
01359       const H323SignalPDU & connectPDU   
01360     );
01361 
01373     virtual BOOL SendFastStartAcknowledge(
01374       H225_ArrayOf_PASN_OctetString & array   
01375     );
01376 
01388     virtual BOOL HandleFastStartAcknowledge(
01389       const H225_ArrayOf_PASN_OctetString & array   
01390     );
01391 
01399     virtual BOOL StartControlChannel();
01400 
01412     virtual BOOL StartControlChannel(
01413       const H225_TransportAddress & h245Address   
01414     );
01416 
01423     BOOL WriteControlPDU(
01424       const H323ControlPDU & pdu
01425     );
01426 
01429     virtual BOOL StartControlNegotiations(
01430       BOOL renegotiate = FALSE  
01431     );
01432 
01435     virtual void HandleControlChannel();
01436 
01443     virtual BOOL HandleControlData(
01444       PPER_Stream & strm
01445     );
01446 
01453     virtual BOOL HandleControlPDU(
01454       const H323ControlPDU & pdu
01455     );
01456 
01466     virtual BOOL OnUnknownControlPDU(
01467       const H323ControlPDU & pdu  
01468     );
01469 
01473     virtual BOOL OnH245Request(
01474       const H323ControlPDU & pdu  
01475     );
01476 
01480     virtual BOOL OnH245Response(
01481       const H323ControlPDU & pdu  
01482     );
01483 
01487     virtual BOOL OnH245Command(
01488       const H323ControlPDU & pdu  
01489     );
01490 
01494     virtual BOOL OnH245Indication(
01495       const H323ControlPDU & pdu  
01496     );
01497 
01500     virtual BOOL OnH245_SendTerminalCapabilitySet(
01501       const H245_SendTerminalCapabilitySet & pdu  
01502     );
01503 
01508     virtual BOOL OnH245_FlowControlCommand(
01509       const H245_FlowControlCommand & pdu  
01510     );
01511 
01516     virtual BOOL OnH245_MiscellaneousCommand(
01517       const H245_MiscellaneousCommand & pdu  
01518     );
01519 
01524     virtual BOOL OnH245_MiscellaneousIndication(
01525       const H245_MiscellaneousIndication & pdu  
01526     );
01527 
01532     virtual BOOL OnH245_JitterIndication(
01533       const H245_JitterIndication & pdu  
01534     );
01535 
01538     enum ControlProtocolErrors {
01539       e_MasterSlaveDetermination,
01540       e_CapabilityExchange,
01541       e_LogicalChannel,
01542       e_ModeRequest,
01543       e_RoundTripDelay
01544     };
01545 
01557     virtual BOOL OnControlProtocolError(
01558       ControlProtocolErrors errorSource,  
01559       const void * errorData = NULL       
01560     );
01561 
01569     virtual void OnSendCapabilitySet(
01570       H245_TerminalCapabilitySet & pdu  
01571     );
01572 
01584     virtual BOOL OnReceivedCapabilitySet(
01585       const H323Capabilities & remoteCaps,      
01586       const H245_MultiplexCapability * muxCap,  
01587       H245_TerminalCapabilitySetReject & reject 
01588     );
01589 
01592     virtual void SendCapabilitySet(
01593       BOOL empty  
01594     );
01595 
01604     virtual void OnSetLocalCapabilities();
01605 
01608     BOOL IsH245Master() const;
01609 
01612     void StartRoundTripDelay();
01613 
01616     PTimeInterval GetRoundTripDelay() const;
01618 
01658     virtual void OnSelectLogicalChannels();
01659 
01662     virtual void SelectDefaultLogicalChannel(
01663       unsigned sessionID    
01664     );
01665 
01669     virtual void SelectFastStartChannels(
01670       unsigned sessionID,   
01671       BOOL transmitter,     
01672       BOOL receiver         
01673     );
01674 
01689     virtual BOOL OpenLogicalChannel(
01690       const H323Capability & capability,  
01691       unsigned sessionID,                 
01692       H323Channel::Directions dir         
01693     );
01694 
01704     virtual BOOL OnOpenLogicalChannel(
01705       const H245_OpenLogicalChannel & openPDU,  
01706       H245_OpenLogicalChannelAck & ackPDU,      
01707       unsigned & errorCode                      
01708     );
01709 
01717     virtual BOOL OnConflictingLogicalChannel(
01718       H323Channel & channel    
01719     );
01720 
01725     virtual H323Channel * CreateLogicalChannel(
01726       const H245_OpenLogicalChannel & open, 
01727       BOOL startingFast,                    
01728       unsigned & errorCode                  
01729     );
01730 
01766     virtual H323Channel * CreateRealTimeLogicalChannel(
01767       const H323Capability & capability, 
01768       H323Channel::Directions dir,       
01769       unsigned sessionID,                
01770       const H245_H2250LogicalChannelParameters * param,
01772       RTP_QOS * rtpqos = NULL            
01773     );
01774 
01785     virtual BOOL OnCreateLogicalChannel(
01786       const H323Capability & capability,  
01787       H323Channel::Directions dir,        
01788       unsigned & errorCode                
01789     );
01790 
01795     virtual BOOL OnStartLogicalChannel(
01796       H323Channel & channel    
01797     );
01798 
01799 #ifndef NO_H323_AUDIO_CODECS
01800 
01806     virtual BOOL OpenAudioChannel(
01807       BOOL isEncoding,       
01808       unsigned bufferSize,   
01809       H323AudioCodec & codec 
01810     );
01811 #endif
01812 
01813 #ifndef NO_H323_VIDEO
01814 
01820     virtual BOOL OpenVideoChannel(
01821       BOOL isEncoding,       
01822       H323VideoCodec & codec 
01823     );
01824 #endif // NO_H323_VIDEO
01825 
01828     virtual void CloseLogicalChannel(
01829       unsigned number,    
01830       BOOL fromRemote     
01831     );
01832 
01835     virtual void CloseLogicalChannelNumber(
01836       const H323ChannelNumber & number    
01837     );
01838 
01841     virtual void CloseAllLogicalChannels(
01842       BOOL fromRemote     
01843     );
01844 
01850     virtual void OnClosedLogicalChannel(
01851       const H323Channel & channel   
01852     );
01853 
01862     virtual BOOL OnClosingLogicalChannel(
01863       H323Channel & channel   
01864     );
01865 
01874     virtual void OnLogicalChannelFlowControl(
01875       H323Channel * channel,   
01876       long bitRateRestriction  
01877     );
01878 
01887     virtual void OnLogicalChannelJitter(
01888       H323Channel * channel,   
01889       DWORD jitter,            
01890       int skippedFrameCount,   
01891       int additionalBuffer     
01892     );
01893 
01896     void SendLogicalChannelMiscCommand(
01897       H323Channel & channel,  
01898       unsigned command        
01899     );
01900 
01904     H323Channel * GetLogicalChannel(
01905       unsigned number,    
01906       BOOL fromRemote     
01907     ) const;
01908 
01914     H323Channel * FindChannel(
01915       unsigned sessionId,   
01916       BOOL fromRemote       
01917     ) const;
01919 
01926     unsigned GetBandwidthUsed() const;
01927 
01933     BOOL UseBandwidth(
01934       unsigned bandwidth,     
01935       BOOL removing           
01936     );
01937 
01940     unsigned GetBandwidthAvailable() const { return bandwidthAvailable; }
01941 
01946     BOOL SetBandwidthAvailable(
01947       unsigned newBandwidth,    
01948       BOOL force = FALSE        
01949     );
01951 
01954     enum SendUserInputModes {
01955       SendUserInputAsQ931,
01956       SendUserInputAsString,
01957       SendUserInputAsTone,
01958       SendUserInputAsInlineRFC2833,
01959       SendUserInputAsSeparateRFC2833,  // Not implemented
01960       NumSendUserInputModes
01961     };
01962 #if PTRACING
01963     friend ostream & operator<<(ostream & o, SendUserInputModes m);
01964 #endif
01965 
01968     void SetSendUserInputMode(SendUserInputModes mode);
01969 
01972     SendUserInputModes GetSendUserInputMode() const { return sendUserInputMode; }
01973 
01979     SendUserInputModes GetRealSendUserInputMode() const;
01980 
01994     virtual void SendUserInput(
01995       const PString & value                   
01996     );
01997 
02004     virtual void OnUserInputString(
02005       const PString & value   
02006     );
02007 
02032     virtual void SendUserInputTone(
02033       char tone,                   
02034       unsigned duration = 0,       
02035       unsigned logicalChannel = 0, 
02036       unsigned rtpTimestamp = 0    
02037     );
02038 
02043     virtual void OnUserInputTone(
02044       char tone,               
02045       unsigned duration,       
02046       unsigned logicalChannel, 
02047       unsigned rtpTimestamp    
02048     );
02049 
02053     void SendUserInputHookFlash(
02054       int duration = 500  
02055     ) { SendUserInputTone('!', duration); }
02056 
02063     virtual void SendUserInputIndicationQ931(
02064       const PString & value                   
02065     );
02066 
02073     virtual void SendUserInputIndicationString(
02074       const PString & value                   
02075     );
02076 
02081     virtual void SendUserInputIndicationTone(
02082       char tone,                   
02083       unsigned duration = 0,       
02084       unsigned logicalChannel = 0, 
02085       unsigned rtpTimestamp = 0    
02086     );
02087 
02096     virtual void SendUserInputIndication(
02097       const H245_UserInputIndication & pdu    
02098     );
02099 
02104     virtual void OnUserInputIndication(
02105       const H245_UserInputIndication & pdu  
02106     );
02108 
02114     virtual RTP_Session * GetSession(
02115       unsigned sessionID
02116     ) const;
02117 
02121     virtual H323_RTP_Session * GetSessionCallbacks(
02122       unsigned sessionID
02123     ) const;
02124 
02134     virtual RTP_Session * UseSession(
02135       unsigned sessionID,
02136       const H245_TransportAddress & pdu,
02137       H323Channel::Directions dir,
02138       RTP_QOS * rtpqos = NULL
02139     );
02140 
02144     virtual void ReleaseSession(
02145       unsigned sessionID
02146     );
02147 
02155     virtual void OnRTPStatistics(
02156       const RTP_Session & session   
02157     ) const;
02158 
02162     virtual PString GetSessionCodecNames(
02163       unsigned sessionID
02164     ) const;
02165 
02168     BOOL IsBehindNAT() const
02169     { return remoteIsNAT; }
02170 
02173         void SetRemoteNAT()
02174         { remoteIsNAT = TRUE; }
02175 
02177 
02195     virtual BOOL RequestModeChange(
02196       const PString & newModes  
02197     );
02198 
02206     virtual BOOL RequestModeChange(
02207       const H245_ArrayOf_ModeDescription & newModes  
02208     );
02209 
02212     virtual BOOL OnRequestModeChange(
02213       const H245_RequestMode & pdu,     
02214       H245_RequestModeAck & ack,        
02215       H245_RequestModeReject & reject,  
02216       PINDEX & selectedMode           
02217     );
02218 
02225     virtual void OnModeChanged(
02226       const H245_ModeDescription & newMode
02227     );
02228 
02233     virtual void OnAcceptModeChange(
02234       const H245_RequestModeAck & pdu  
02235     );
02236 
02241     virtual void OnRefusedModeChange(
02242       const H245_RequestModeReject * pdu  
02243     );
02245 
02246 #ifdef H323_T120
02247 
02261     virtual OpalT120Protocol * CreateT120ProtocolHandler();
02262 #endif
02263 
02264 #ifdef H323_T38
02265 
02277     virtual OpalT38Protocol * CreateT38ProtocolHandler();
02278 
02281     virtual BOOL RequestModeChangeT38(
02282       const char * capabilityNames = "T.38\nT38FaxUDP"
02283     );
02284 #endif
02285 
02286 #ifdef OPAL_H224
02287 
02299     virtual OpalH224Handler *CreateH224ProtocolHandler(unsigned sessionID);
02300         
02310      virtual OpalH281Handler *CreateH281ProtocolHandler(OpalH224Handler & h224Handler);
02311 #endif
02312 
02322     virtual BOOL GetAdmissionRequestAuthentication(
02323       const H225_AdmissionRequest & arq,  
02324       H235Authenticators & authenticators 
02325     );
02327 
02332     H323EndPoint & GetEndPoint() const { return endpoint; }
02333 
02336     BOOL HadAnsweredCall() const { return callAnswered; }
02337 
02340     BOOL IsGatekeeperRouted() const { return gatekeeperRouted; }
02341 
02345     unsigned GetQ931Cause() const { return q931Cause; }
02346 
02350     void SetQ931Cause(unsigned v) { q931Cause = v; }
02351 
02356     unsigned GetDistinctiveRing() const { return distinctiveRing; }
02357 
02364     void SetDistinctiveRing(unsigned pattern) { distinctiveRing = pattern&7; }
02365 
02368     const PString & GetCallToken() const { return callToken; }
02369 
02372     unsigned GetCallReference() const { return callReference; }
02373 
02376     const OpalGloballyUniqueID & GetCallIdentifier() const { return callIdentifier; }
02377 
02380     const OpalGloballyUniqueID & GetConferenceIdentifier() const { return conferenceIdentifier; }
02381 
02384     const PString & GetLocalPartyName() const { return localPartyName; }
02385 
02388     void SetLocalPartyName(const PString & name);
02389 
02392     void SetDisplayName(const PString & name) { localDisplayName = name; }
02393 
02396     const PString GetDisplayName() const { return localDisplayName; }
02397 
02398     const PStringList & GetLocalAliasNames() const { return localAliasNames; }
02399 
02406     const PString & GetRemotePartyName() const { return remotePartyName; }
02407 
02412     const PString & GetRemotePartyNumber() const { return remotePartyNumber; }
02413 
02420     const PString & GetRemotePartyAddress() const { return remotePartyAddress; }
02421 
02424     void SetRemotePartyInfo(
02425       const H323SignalPDU & pdu 
02426     );
02427 
02439     const PString & GetRemoteApplication() const { return remoteApplication; }
02440 
02443     void SetRemoteApplication(
02444       const H225_EndpointType & pdu 
02445     );
02446     
02449     const H323Capabilities & GetLocalCapabilities() const { return localCapabilities; }
02450 
02453     const H323Capabilities & GetRemoteCapabilities() const { return remoteCapabilities; }
02454 
02457     unsigned GetRemoteMaxAudioDelayJitter() const { return remoteMaxAudioDelayJitter; }
02458 
02461     const H323Transport * GetSignallingChannel() const { return signallingChannel; }
02462 
02465     unsigned GetSignallingVersion() const { return h225version; }
02466 
02469     const H323Transport & GetControlChannel() const;
02470 
02473     unsigned GetControlVersion() const { return h245version; }
02474 
02477     PTime GetSetupUpTime() const { return setupTime; }
02478 
02481     PTime GetAlertingTime() const { return alertingTime; }
02482 
02486     PTime GetConnectionStartTime() const { return connectedTime; }
02487 
02490     PTime GetConnectionEndTime() const { return callEndTime; }
02491 
02494     PTime GetReverseMediaOpenTime() const { return reverseMediaOpenTime; }
02495 
02499     unsigned GetMinAudioJitterDelay() const { return minAudioJitterDelay; }
02500 
02504     unsigned GetMaxAudioJitterDelay() const { return maxAudioJitterDelay; }
02505 
02508     void SetAudioJitterDelay(
02509       unsigned minDelay,   
02510       unsigned maxDelay    
02511     );
02512 
02515     unsigned GetUUIEsRequested() const { return uuiesRequested; }
02516 
02519     void SetUUIEsRequested(unsigned mask) { uuiesRequested = mask; }
02520 
02523     const PString GetGkAccessTokenOID() const { return gkAccessTokenOID; }
02524 
02527     void SetGkAccessTokenOID(const PString & oid) { gkAccessTokenOID = oid; }
02528 
02531     const PBYTEArray & GetGkAccessTokenData() const { return gkAccessTokenData; }
02532 
02535     void SetDestExtraCallInfo(
02536       const PString & info
02537     ) { destExtraCallInfo = info; }
02538 
02541     void SetRemoteCallWaiting(const unsigned value) { remoteCallWaiting = value; }
02542 
02548     const int GetRemoteCallWaiting() const { return remoteCallWaiting; }
02549 
02554     void SetEnforcedDurationLimit(
02555       unsigned seconds  
02556     );
02558 
02559     virtual BOOL OnSendFeatureSet(unsigned, H225_FeatureSet &) const;
02560 
02561     virtual void OnReceiveFeatureSet(unsigned, const H225_FeatureSet &) const;
02562 
02563 #ifndef DISABLE_CALLAUTH
02564 
02568     const H235Authenticators & GetEPAuthenticators() const;
02569 
02574     virtual void SetAuthenticationConnection();
02575 
02580     virtual BOOL OnCallAuthentication(const PString & username, 
02581                                       PString & password);
02582 
02586     virtual void OnAuthenticationFinalise(unsigned pdu,PBYTEArray & rawData);
02587 
02590     BOOL HasAuthentication() const
02591        { return hasAuthentication; }
02593 #endif
02594 
02595 #ifdef H323_H248
02596 
02600     BOOL OnSendServiceControlSessions(
02601                  H225_ArrayOf_ServiceControlSession & serviceControl, 
02602                  H225_ServiceControlSession_reason reason           
02603                 ) const;
02604 
02607     void OnReceiveServiceControlSessions(
02608                 const H225_ArrayOf_ServiceControlSession & serviceControl  
02609                 );
02610 
02613     virtual void OnReceiveServiceControl(const PString & amount,    
02614                                          BOOL credit,               
02615                                          const unsigned & timelimit,
02616                                          const PString & url        
02617                                                                             );
02618 
02621     virtual BOOL OnSendServiceControl(PString & amount,          
02622                                       BOOL credit,               
02623                                       unsigned & timelimit,      
02624                                       PString & url              
02625                                                                      ) const;
02627 #endif
02628 
02633     virtual void DisableH245inSETUP();
02634 
02637     virtual void SetNonCallConnection();
02638 
02639 #ifdef H323_H460
02640 
02642     virtual H460_FeatureSet * GetFeatureSet();
02643 #endif
02644 
02645 
02646     enum ReleaseSequence {
02647       ReleaseSequenceUnknown,
02648       ReleaseSequence_Local,
02649       ReleaseSequence_Remote
02650     };
02651 
02652     ReleaseSequence GetReleaseSequence() const
02653     { return releaseSequence; }
02654 
02655     virtual BOOL OnHandleConferenceRequest(const H245_ConferenceRequest &)
02656     { return FALSE; }
02657 
02658     virtual BOOL OnHandleConferenceResponse(const H245_ConferenceResponse &)
02659     { return FALSE; }
02660 
02661     virtual BOOL OnHandleConferenceCommand(const H245_ConferenceCommand &)
02662     { return FALSE; }
02663 
02664     virtual BOOL OnHandleConferenceIndication(const H245_ConferenceIndication &)
02665     { return FALSE; }
02666 
02667   protected:
02673     virtual void InternalEstablishedConnectionCheck();
02674     BOOL DecodeFastStartCaps(const H225_ArrayOf_PASN_OctetString & fastStartCaps);
02675     BOOL InternalEndSessionCheck(PPER_Stream & strm);
02676     void SetRemoteVersions(const H225_ProtocolIdentifier & id);
02677     void MonitorCallStatus();
02678     PDECLARE_NOTIFIER(OpalRFC2833Info, H323Connection, OnUserInputInlineRFC2833);
02679     PDECLARE_NOTIFIER(H323Codec::FilterInfo, H323Connection, OnUserInputInBandDTMF);
02680 
02681     H323EndPoint & endpoint;
02682     PSyncPoint     * endSync;
02683 
02684     int                  remoteCallWaiting; // Number of call's waiting at the remote endpoint
02685     BOOL                 callAnswered;
02686     BOOL                 gatekeeperRouted;
02687     unsigned             distinctiveRing;
02688     PString              callToken;
02689     unsigned             callReference;
02690     OpalGloballyUniqueID callIdentifier;
02691     OpalGloballyUniqueID conferenceIdentifier;
02692 
02693     PStringList        localAliasNames;
02694     PString            localPartyName;
02695     PString            localDisplayName;
02696     H323Capabilities   localCapabilities; // Capabilities local system supports
02697     PString            remotePartyName;
02698     PString            remotePartyNumber;
02699     PString            remotePartyAddress;
02700     PString            destExtraCallInfo;
02701     PString            remoteApplication;
02702     H323Capabilities   remoteCapabilities; // Capabilities remote system supports
02703     unsigned           remoteMaxAudioDelayJitter;
02704     PTimer             roundTripDelayTimer;
02705     unsigned           minAudioJitterDelay;
02706     unsigned           maxAudioJitterDelay;
02707     unsigned           bandwidthAvailable;
02708     unsigned           uuiesRequested;
02709     PString            gkAccessTokenOID;
02710     PBYTEArray         gkAccessTokenData;
02711     BOOL               addAccessTokenToSetup;
02712     SendUserInputModes sendUserInputMode;
02713 
02714     H323Transport * signallingChannel;
02715     H323Transport * controlChannel;
02716     BOOL            h245Tunneling;
02717     H323SignalPDU * h245TunnelRxPDU;
02718     H323SignalPDU * h245TunnelTxPDU;
02719     H323SignalPDU * alertingPDU;
02720     H323SignalPDU * connectPDU;
02721 
02722     enum ConnectionStates {
02723       NoConnectionActive,
02724       AwaitingGatekeeperAdmission,
02725       AwaitingTransportConnect,
02726       AwaitingSignalConnect,
02727       AwaitingLocalAnswer,
02728       HasExecutedSignalConnect,
02729       EstablishedConnection,
02730       ShuttingDownConnection,
02731       NumConnectionStates
02732     } connectionState;
02733 
02734     PTime         setupTime;
02735     PTime         alertingTime;
02736     PTime         connectedTime;
02737     PTime         callEndTime;
02738     PTime         reverseMediaOpenTime;
02739     CallEndReason callEndReason;
02740     unsigned      q931Cause;
02741     ReleaseSequence releaseSequence;
02742 
02743     unsigned   h225version;
02744     unsigned   h245version;
02745     BOOL       h245versionSet;
02746     BOOL doH245inSETUP;
02747     BOOL lastPDUWasH245inSETUP;
02748     BOOL detectInBandDTMF;
02749     BOOL mustSendDRQ;
02750     BOOL mediaWaitForConnect;
02751     BOOL transmitterSidePaused;
02752     BOOL earlyStart;
02753 
02754 #ifdef H323_T120
02755     BOOL startT120;
02756 #endif
02757 
02758 #ifdef H323_T38
02759     PString    t38ModeChangeCapabilities;
02760 #endif
02761 
02762 #ifdef OPAL_H224
02763         BOOL startH224;
02764 #endif
02765 
02766     PSyncPoint digitsWaitFlag;
02767     BOOL       endSessionNeeded;
02768     BOOL       endSessionSent;
02769     PSyncPoint endSessionReceived;
02770     PTimer     enforcedDurationLimit;
02771 
02772 #ifdef H323_H450
02773     // Used as part of a local call hold operation involving MOH
02774     PChannel * holdMediaChannel;
02775     BOOL       isConsultationTransfer;
02776 
02778     BOOL     isCallIntrusion;
02779     unsigned callIntrusionProtectionLevel;
02780 #endif
02781 
02782     RTP_SessionManager rtpSessions;
02783 
02784     enum FastStartStates {
02785       FastStartDisabled,
02786       FastStartInitiate,
02787       FastStartResponse,
02788       FastStartAcknowledged,
02789       NumFastStartStates
02790     };
02791     FastStartStates        fastStartState;
02792     H323LogicalChannelList fastStartChannels;
02793 
02794 #if PTRACING
02795     static const char * const ConnectionStatesNames[NumConnectionStates];
02796     friend ostream & operator<<(ostream & o, ConnectionStates s) { return o << ConnectionStatesNames[s]; }
02797     static const char * const FastStartStateNames[NumFastStartStates];
02798     friend ostream & operator<<(ostream & o, FastStartStates s) { return o << FastStartStateNames[s]; }
02799 #endif
02800 
02801 
02802     // The following pointers are to protocol procedures, they are pointers to
02803     // hide their complexity from the H323Connection classes users.
02804     H245NegMasterSlaveDetermination  * masterSlaveDeterminationProcedure;
02805     H245NegTerminalCapabilitySet     * capabilityExchangeProcedure;
02806     H245NegLogicalChannels           * logicalChannels;
02807     H245NegRequestMode               * requestModeProcedure;
02808     H245NegRoundTripDelay            * roundTripDelayProcedure;
02809 
02810 #ifdef H323_H450
02811     H450xDispatcher                  * h450dispatcher;
02812     H4502Handler                     * h4502handler;
02813     H4503Handler                     * h4503handler;
02814     H4504Handler                     * h4504handler;
02815     H4506Handler                     * h4506handler;
02816     H45011Handler                    * h45011handler;
02817 #endif
02818 
02819     OpalRFC2833                      * rfc2833handler;
02820 
02821 #ifdef H323_T120
02822     OpalT120Protocol                 * t120handler;
02823 #endif
02824 
02825 #ifdef H323_T38
02826     OpalT38Protocol                  * t38handler;
02827 #endif
02828 
02829 #ifdef OPAL_H224
02830     OpalH224Handler                  * h224handler;
02831     OpalH281Handler                  * h281handler;
02832 #endif
02833 
02834 #ifdef P_DTMF
02835     // The In-Band DTMF detector. This is used inside an audio filter which is
02836     // added to the audio channel.
02837     PDTMFDecoder                     dtmfDecoder;
02838 #endif
02839 
02840     // used to detect remote NAT endpoints
02841     BOOL remoteIsNAT;
02842 
02843 #ifdef H323_TRANSNEXUS_OSP
02844   public:
02845     OpalOSP::Transaction * GetOSPTransaction() const
02846     { return ospTransaction; }
02847 
02848     void SetOSPTransaction(OpalOSP::Transaction * tran)
02849     { ospTransaction = tran; }
02850 
02851   protected:
02852     OpalOSP::Transaction * ospTransaction;
02853     virtual void CleanUpOSP();
02854     BOOL AuthoriseOSPTransaction(OpalOSP::Transaction & transaction, OpalOSP::Transaction::DestinationInfo & destInfo);
02855 #endif
02856 
02857 #ifndef DISABLE_CALLAUTH
02858     BOOL AuthenticationFailed;
02859     BOOL hasAuthentication;
02860     const H235Authenticators  EPAuthenticators;
02861 #endif
02862 
02863 #ifdef HAS_AEC
02864         PAec * aec;
02865 #endif
02866 
02867     BOOL IsNonCallConnection; 
02868 
02869   private:
02870     PChannel * SwapHoldMediaChannels(PChannel * newChannel);
02871 
02872     PTimedMutex outerMutex;
02873     PMutex innerMutex;
02874 
02875   public:
02876     BOOL StartHandleControlChannel();
02877     void EndHandleControlChannel();
02878 
02879 #ifdef H323_RTP_AGGREGATE
02880   private:
02881     BOOL useRTPAggregation;
02882 #endif
02883 
02884 #ifdef H323_SIGNAL_AGGREGATE
02885   public:
02886     void AggregateSignalChannel(H323Transport * transport);
02887     void AggregateControlChannel(H323Transport * transport);
02888   protected:
02889     BOOL useSignallingAggregation;
02890     H323AggregatedH2x5Handle * signalAggregator;
02891     H323AggregatedH2x5Handle * controlAggregator;
02892 #endif
02893 
02894 #ifdef H323_H248
02895     PDictionary<POrdinalKey, H323ServiceControlSession> serviceControlSessions;
02896 #endif
02897 
02898 #ifdef H323_H460
02899         H460_FeatureSet & features;
02900 #endif
02901 
02902 #ifdef OPAL_H224
02903   OpalH224Handler                 * h224Handler;
02904 #endif
02905 };
02906 
02907 
02908 PLIST(H323ConnectionList, H323Connection);
02909 PDICTIONARY(H323ConnectionDict, PString, H323Connection);
02910 PDICTIONARY(H323CallIdentityDict, PString, H323Connection);
02911 
02912 
02913 #endif // __OPAL_H323CON_H
02914 
02915 

Generated on Wed Feb 6 09:02:38 2008 for OpenH323 by  doxygen 1.5.4