h323.h

Go to the documentation of this file.
00001 /*
00002  * h323.h
00003  *
00004  * H.323 protocol handler
00005  *
00006  * Open H323 Library
00007  *
00008  * Copyright (c) 1998-2000 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: h323.h,v $
00030  * Revision 1.140  2005/01/03 06:25:52  csoutheren
00031  * Added extensive support for disabling code modules at compile time
00032  *
00033  * Revision 1.139  2004/05/10 13:37:49  rjongbloed
00034  * Changed G.726 and MS-ADPCM to plug in codecs.
00035  *
00036  * Revision 1.138  2004/05/04 23:54:07  csoutheren
00037  * Removed usage of lpc10codec.h
00038  *
00039  * Revision 1.137  2004/05/03 13:21:40  rjongbloed
00040  * Converted everything to be codec plug in freindly
00041  * Removed GSM and G.729 as now plug ins are "the way"!
00042  *
00043  * Revision 1.136  2004/05/02 13:47:56  csoutheren
00044  * Removed gsmcodec.h
00045  *
00046  * Revision 1.135  2004/04/05 04:22:55  rjongbloed
00047  * Removed speex and iLBC direct build as now use plug in
00048  *
00049  * Revision 1.134  2004/04/03 12:17:07  csoutheren
00050  * Updated plugin changes for RTTI changes and added missing include
00051  *
00052  * Revision 1.133  2004/04/03 10:38:23  csoutheren
00053  * Added in initial cut at codec plugin code. Branches are for wimps :)
00054  *
00055  * Revision 1.132.2.1  2004/03/31 11:50:24  csoutheren
00056  * Removed references to builtin iLBC as this has been moved to plugins
00057  *
00058  * Revision 1.132  2003/06/06 02:19:03  rjongbloed
00059  * Added iLBC codec
00060  *
00061  * Revision 1.131  2003/05/14 03:29:56  rjongbloed
00062  * Added H.263 codec and autoconf options header file.
00063  *
00064  * Revision 1.130  2002/11/05 02:18:03  robertj
00065  * Changed default for speex codec to be included.
00066  *
00067  * Revision 1.129  2002/11/04 02:57:24  dereks
00068  * Put test around include of speexcodec.h    SPEEX is now an optional codec.
00069  *
00070  * Revision 1.128  2002/10/24 05:34:03  robertj
00071  * Added speex codec
00072  *
00073  * Revision 1.127  2002/10/01 03:07:12  robertj
00074  * Added version number functions for OpenH323 library itself, plus included
00075  *   library version in the default vendor information.
00076  *
00077  * Revision 1.126  2002/06/27 03:08:57  robertj
00078  * Added code to include G.729 & G.726 codecs on static linking.
00079  *
00080  * Revision 1.125  2001/10/23 02:18:06  dereks
00081  * Initial release of CU30 video codec.
00082  *
00083  * Revision 1.124  2001/09/11 01:24:36  robertj
00084  * Added conditional compilation to remove video and/or audio codecs.
00085  *
00086  * Revision 1.123  2001/08/06 03:08:11  robertj
00087  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
00088  *
00089  * Revision 1.122  2001/08/01 00:46:16  craigs
00090  * Added ability to early start without Alerting
00091  *
00092  * Revision 1.121  2001/07/17 04:44:29  robertj
00093  * Partial implementation of T.120 and T.38 logical channels.
00094  *
00095  * Revision 1.120  2001/07/06 02:29:12  robertj
00096  * Moved initialisation of local capabilities back to constructor for
00097  *   backward compatibility reasons.
00098  *
00099  * Revision 1.119  2001/07/05 04:18:23  robertj
00100  * Added call back for setting local capabilities.
00101  *
00102  * Revision 1.118  2001/06/19 03:55:28  robertj
00103  * Added transport to CreateConnection() function so can use that as part of
00104  *   the connection creation decision making process.
00105  *
00106  * Revision 1.117  2001/06/14 23:18:04  robertj
00107  * Change to allow for CreateConnection() to return NULL to abort call.
00108  *
00109  * Revision 1.116  2001/06/14 04:24:16  robertj
00110  * Changed incoming call to pass setup pdu to endpoint so it can create
00111  *   different connection subclasses depending on the pdu eg its alias
00112  *
00113  * Revision 1.115  2001/06/13 06:38:23  robertj
00114  * Added early start (media before connect) functionality.
00115  *
00116  * Revision 1.114  2001/05/31 01:28:47  robertj
00117  * Added functions to determine if call currently being held.
00118  *
00119  * Revision 1.113  2001/05/30 23:34:54  robertj
00120  * Added functions to send TCS=0 for transmitter side pause.
00121  *
00122  * Revision 1.112  2001/05/17 07:11:29  robertj
00123  * Added more call end types for common transport failure modes.
00124  *
00125  * Revision 1.111  2001/05/17 03:31:07  robertj
00126  * Fixed support for transmiter side paused (TCS=0), thanks Paul van de Wijngaard
00127  *
00128  * Revision 1.110  2001/05/14 05:56:25  robertj
00129  * Added H323 capability registration system so can add capabilities by
00130  *   string name instead of having to instantiate explicit classes.
00131  *
00132  * Revision 1.109  2001/05/09 04:59:02  robertj
00133  * Bug fixes in H.450.2, thanks Klein Stefan.
00134  *
00135  * Revision 1.108  2001/05/09 04:07:53  robertj
00136  * Added more call end codes for busy and congested.
00137  *
00138  * Revision 1.107  2001/05/01 04:34:10  robertj
00139  * Changed call transfer API slightly to be consistent with new hold function.
00140  *
00141  * Revision 1.106  2001/05/01 02:12:48  robertj
00142  * Added H.450.4 call hold (Near End only), thanks David M. Cassel.
00143  *
00144  * Revision 1.105  2001/04/23 01:31:13  robertj
00145  * Improved the locking of connections especially at shutdown.
00146  *
00147  * Revision 1.104  2001/04/11 03:01:27  robertj
00148  * Added H.450.2 (call transfer), thanks a LOT to Graeme Reid & Norwood Systems
00149  *
00150  * Revision 1.103  2001/03/21 04:52:40  robertj
00151  * Added H.235 security to gatekeepers, thanks Fürbass Franz!
00152  *
00153  * Revision 1.102  2001/03/16 06:46:19  robertj
00154  * Added ability to set endpoints desired time to live on a gatekeeper.
00155  *
00156  * Revision 1.101  2001/03/15 00:24:01  robertj
00157  * Added function for setting gatekeeper with address and identifier values.
00158  *
00159  * Revision 1.100  2001/03/08 07:45:04  robertj
00160  * Fixed issues with getting media channels started in some early start
00161  *   regimes, in particular better Cisco compatibility.
00162  *
00163  * Revision 1.99  2001/03/02 06:59:57  robertj
00164  * Enhanced the globally unique identifier class.
00165  *
00166  * Revision 1.98  2001/02/16 04:11:46  robertj
00167  * Added ability for RemoveListener() to remove all listeners.
00168  *
00169  * Revision 1.97  2001/02/09 05:16:24  robertj
00170  * Added #pragma interface for GNU C++.
00171  *
00172  * Revision 1.96  2000/12/19 22:33:44  dereks
00173  * Adjust so that the video channel is used for reading/writing raw video
00174  * data, which better modularizes the video codec.
00175  *
00176  * Revision 1.95  2000/12/18 08:58:30  craigs
00177  * Added ability set ports
00178  *
00179  * Revision 1.94  2000/12/18 01:22:28  robertj
00180  * Changed semantics or HasConnection() so returns TRUE until the connection
00181  *   has been deleted and not just until ClearCall() was executure on it.
00182  *
00183  * Revision 1.93  2000/12/05 01:52:00  craigs
00184  * Made ClearCall functions virtual to allow overiding
00185  *
00186  * Revision 1.92  2000/11/27 02:44:06  craigs
00187  * Added ClearCall Synchronous to H323Connection and H323Endpoint to
00188  * avoid race conditions with destroying descendant classes
00189  *
00190  * Revision 1.91  2000/11/26 23:13:23  craigs
00191  * Added ability to pass user data to H323Connection constructor
00192  *
00193  * Revision 1.90  2000/11/12 23:49:16  craigs
00194  * Added per connection versions of OnEstablished and OnCleared
00195  *
00196  * Revision 1.89  2000/11/08 04:30:00  robertj
00197  * Added function to be able to alter/remove the call proceeding PDU.
00198  *
00199  * Revision 1.88  2000/10/20 06:10:20  robertj
00200  * Fixed very small race condition on creating new connectionon incoming call.
00201  *
00202  * Revision 1.87  2000/10/19 04:06:54  robertj
00203  * Added function to be able to remove a listener.
00204  *
00205  * Revision 1.86  2000/10/16 09:51:16  robertj
00206  * Fixed problem with not opening fast start video receive if do not have transmit enabled.
00207  *
00208  * Revision 1.85  2000/10/13 02:15:23  robertj
00209  * Added support for Progress Indicator Q.931/H.225 message.
00210  *
00211  * Revision 1.84  2000/10/04 12:20:50  robertj
00212  * Changed setting of callToken in H323Connection to be as early as possible.
00213  *
00214  * Revision 1.83  2000/09/25 12:59:16  robertj
00215  * Added StartListener() function that takes a H323TransportAddress to start
00216  *     listeners bound to specific interfaces.
00217  *
00218  * Revision 1.82  2000/09/22 01:35:02  robertj
00219  * Added support for handling LID's that only do symmetric codecs.
00220  *
00221  * Revision 1.81  2000/09/20 01:50:22  craigs
00222  * Added ability to set jitter buffer on a per-connection basis
00223  *
00224  * Revision 1.80  2000/09/05 01:16:19  robertj
00225  * Added "security" call end reason code.
00226  *
00227  * Revision 1.79  2000/09/01 02:12:54  robertj
00228  * Added ability to select a gatekeeper on LAN via it's identifier name.
00229  *
00230  * Revision 1.78  2000/07/31 14:08:09  robertj
00231  * Added fast start and H.245 tunneling flags to the H323Connection constructor so can
00232  *    disabled these features in easier manner to overriding virtuals.
00233  *
00234  * Revision 1.77  2000/07/13 12:33:38  robertj
00235  * Split autoStartVideo so can select receive and transmit independently
00236  *
00237  * Revision 1.76  2000/07/04 04:14:06  robertj
00238  * Fixed capability check of "combinations" for fast start cases.
00239  *
00240  * Revision 1.75  2000/07/04 01:16:49  robertj
00241  * Added check for capability allowed in "combinations" set, still needs more done yet.
00242  *
00243  * Revision 1.74  2000/06/29 10:59:53  robertj
00244  * Added user interface for sound buffer depth adjustment.
00245  *
00246  * Revision 1.73  2000/06/23 02:48:23  robertj
00247  * Added ability to adjust sound channel buffer depth, needed increasing under Win32.
00248  *
00249  * Revision 1.72  2000/06/21 08:07:38  robertj
00250  * Added cause/reason to release complete PDU, where relevent.
00251  *
00252  * Revision 1.71  2000/06/10 02:03:36  robertj
00253  * Fixed typo in comment
00254  *
00255  * Revision 1.70  2000/06/07 05:47:55  robertj
00256  * Added call forwarding.
00257  *
00258  * Revision 1.69  2000/06/05 06:33:08  robertj
00259  * Fixed problem with roud trip time statistic not being calculated if constant traffic.
00260  *
00261  * Revision 1.68  2000/05/23 12:57:28  robertj
00262  * Added ability to change IP Type Of Service code from applications.
00263  *
00264  * Revision 1.67  2000/05/23 11:32:26  robertj
00265  * Rewrite of capability table to combine 2 structures into one and move functionality into that class
00266  *    allowing some normalisation of usage across several applications.
00267  * Changed H323Connection so gets a copy of capabilities instead of using endponts, allows adjustments
00268  *    to be done depending on the remote client application.
00269  *
00270  * Revision 1.66  2000/05/18 11:53:33  robertj
00271  * Changes to support doc++ documentation generation.
00272  *
00273  * Revision 1.65  2000/05/16 08:12:37  robertj
00274  * Added documentation for FindChannel() function.
00275  * Added function to get a logical channel by channel number.
00276  *
00277  * Revision 1.64  2000/05/16 02:06:00  craigs
00278  * Added access functions for particular sessions
00279  *
00280  * Revision 1.63  2000/05/09 12:19:22  robertj
00281  * Added ability to get and set "distinctive ring" Q.931 functionality.
00282  *
00283  * Revision 1.62  2000/05/08 14:07:26  robertj
00284  * Improved the provision and detection of calling and caller numbers, aliases and hostnames.
00285  *
00286  * Revision 1.61  2000/05/02 04:32:24  robertj
00287  * Fixed copyright notice comment.
00288  *
00289  * Revision 1.60  2000/05/01 13:00:09  robertj
00290  * Changed SetCapability() to append capabilities to TCS, helps with assuring no gaps in set.
00291  *
00292  * Revision 1.59  2000/04/14 21:08:53  robertj
00293  * Work around for compatibility problem wth broken Altigen AltaServ-IG PBX.
00294  *
00295  * Revision 1.58  2000/04/14 20:01:38  robertj
00296  * Added function to get remote endpoints application name.
00297  *
00298  * Revision 1.57  2000/04/11 04:02:47  robertj
00299  * Improved call initiation with gatekeeper, no longer require @address as
00300  *    will default to gk alias if no @ and registered with gk.
00301  * Added new call end reasons for gatekeeper denied calls.
00302  *
00303  * Revision 1.56  2000/04/10 20:02:49  robertj
00304  * Added support for more sophisticated DTMF and hook flash user indication.
00305  *
00306  * Revision 1.55  2000/04/06 17:50:15  robertj
00307  * Added auto-start (including fast start) of video channels, selectable via boolean on the endpoint.
00308  *
00309  * Revision 1.54  2000/04/05 03:17:30  robertj
00310  * Added more RTP statistics gathering and H.245 round trip delay calculation.
00311  *
00312  * Revision 1.53  2000/03/29 04:32:55  robertj
00313  * Improved some trace logging messages.
00314  *
00315  * Revision 1.52  2000/03/29 02:12:38  robertj
00316  * Changed TerminationReason to CallEndReason to use correct telephony nomenclature.
00317  * Added CallEndReason for capability exchange failure.
00318  *
00319  * Revision 1.51  2000/03/25 02:03:18  robertj
00320  * Added default transport for gatekeeper to be UDP.
00321  *
00322  * Revision 1.50  2000/03/23 02:44:49  robertj
00323  * Changed ClearAllCalls() so will wait for calls to be closed (usefull in endpoint dtors).
00324  *
00325  * Revision 1.49  2000/03/02 02:18:13  robertj
00326  * Further fixes for early H245 establishment confusing the fast start code.
00327  *
00328  * Revision 1.48  2000/01/07 08:19:14  robertj
00329  * Added status functions for connection and tidied up the answer call function
00330  *
00331  * Revision 1.47  2000/01/04 00:14:26  craigs
00332  * Added additional states to AnswerCall callback
00333  *
00334  * Revision 1.46  1999/12/23 23:02:34  robertj
00335  * File reorganision for separating RTP from H.323 and creation of LID for VPB support.
00336  *
00337  * Revision 1.45  1999/12/11 02:20:53  robertj
00338  * Added ability to have multiple aliases on local endpoint.
00339  *
00340  * Revision 1.44  1999/11/22 10:07:23  robertj
00341  * Fixed some errors in correct termination states.
00342  *
00343  * Revision 1.43  1999/11/19 08:15:41  craigs
00344  * Added connectionStartTime
00345  *
00346  * Revision 1.42  1999/11/17 00:01:11  robertj
00347  * Improved determination of caller name, thanks Ian MacDonald
00348  *
00349  * Revision 1.41  1999/11/10 23:29:37  robertj
00350  * Changed OnAnswerCall() call back function  to allow for asyncronous response.
00351  *
00352  * Revision 1.40  1999/11/06 05:37:44  robertj
00353  * Complete rewrite of termination of connection to avoid numerous race conditions.
00354  *
00355  * Revision 1.39  1999/10/30 12:34:13  robertj
00356  * Added information callback for closed logical channel on H323EndPoint.
00357  *
00358  * Revision 1.38  1999/10/29 02:26:13  robertj
00359  * Added reason for termination code to H323Connection.
00360  *
00361  * Revision 1.37  1999/10/19 00:03:20  robertj
00362  * Changed OpenAudioChannel and OpenVideoChannel to allow a codec AttachChannel with no autodelete.
00363  * Added function to set initial bandwidth limit on a new connection.
00364  *
00365  * Revision 1.36  1999/10/14 12:05:03  robertj
00366  * Fixed deadlock possibilities in clearing calls.
00367  *
00368  * Revision 1.35  1999/10/09 01:19:07  craigs
00369  * Added codecs to OpenAudioChannel and OpenVideoDevice functions
00370  *
00371  * Revision 1.34  1999/09/23 07:25:12  robertj
00372  * Added open audio and video function to connection and started multi-frame codec send functionality.
00373  *
00374  * Revision 1.33  1999/09/21 14:24:34  robertj
00375  * Changed SetCapability() so automatically calls AddCapability().
00376  *
00377  * Revision 1.32  1999/09/21 14:05:21  robertj
00378  * Fixed incorrect PTRACING test and removed uneeded include of videoio.h
00379  *
00380  * Revision 1.31  1999/09/21 08:29:13  craigs
00381  * Added support for video codecs and H261
00382  *
00383  * Revision 1.30  1999/09/15 01:26:27  robertj
00384  * Changed capability set call backs to have more specific class as parameter.
00385  *
00386  * Revision 1.29  1999/09/14 06:52:54  robertj
00387  * Added better support for multi-homed client hosts.
00388  *
00389  * Revision 1.28  1999/09/13 14:23:11  robertj
00390  * Changed MakeCall() function return value to be something useful.
00391  *
00392  * Revision 1.27  1999/09/10 03:36:47  robertj
00393  * Added simple Q.931 Status response to Q.931 Status Enquiry
00394  *
00395  * Revision 1.26  1999/09/08 04:05:48  robertj
00396  * Added support for video capabilities & codec, still needs the actual codec itself!
00397  *
00398  * Revision 1.25  1999/08/31 12:34:18  robertj
00399  * Added gatekeeper support.
00400  *
00401  * Revision 1.24  1999/08/27 09:46:05  robertj
00402  * Added sepearte function to initialise vendor information from endpoint.
00403  *
00404  * Revision 1.23  1999/08/25 05:14:49  robertj
00405  * File fission (critical mass reached).
00406  * Improved way in which remote capabilities are created, removed case statement!
00407  * Changed MakeCall, so immediately spawns thread, no black on TCP connect.
00408  *
00409  * Revision 1.22  1999/08/08 10:02:49  robertj
00410  * Added access functions to remote capability table.
00411  *
00412  * Revision 1.21  1999/07/23 02:37:53  robertj
00413  * Fixed problems with hang ups and crash closes of connections.
00414  *
00415  * Revision 1.20  1999/07/18 14:29:31  robertj
00416  * Fixed bugs in slow start with H245 tunnelling, part 3.
00417  *
00418  * Revision 1.19  1999/07/16 14:05:10  robertj
00419  * Added application level jitter buffer adjustment.
00420  *
00421  * Revision 1.18  1999/07/16 06:15:59  robertj
00422  * Corrected semantics for tunnelled master/slave determination in fast start.
00423  *
00424  * Revision 1.17  1999/07/15 14:45:35  robertj
00425  * Added propagation of codec open error to shut down logical channel.
00426  * Fixed control channel start up bug introduced with tunnelling.
00427  *
00428  * Revision 1.16  1999/07/14 06:06:13  robertj
00429  * Fixed termination problems (race conditions) with deleting connection object.
00430  *
00431  * Revision 1.15  1999/07/13 02:50:58  craigs
00432  * Changed semantics of SetPlayDevice/SetRecordDevice, only descendent
00433  *    endpoint assumes PSoundChannel devices for audio codec.
00434  *
00435  * Revision 1.14  1999/07/10 02:59:26  robertj
00436  * Fixed ability to hang up incoming connection.
00437  *
00438  * Revision 1.13  1999/07/09 06:09:49  robertj
00439  * Major implementation. An ENORMOUS amount of stuff added everywhere.
00440  *
00441  * Revision 1.12  1999/06/25 10:25:35  robertj
00442  * Added maintentance of callIdentifier variable in H.225 channel.
00443  *
00444  * Revision 1.11  1999/06/22 13:45:05  robertj
00445  * Added user question on listener version to accept incoming calls.
00446  *
00447  * Revision 1.10  1999/06/14 05:15:56  robertj
00448  * Changes for using RTP sessions correctly in H323 Logical Channel context
00449  *
00450  * Revision 1.9  1999/06/13 12:41:14  robertj
00451  * Implement logical channel transmitter.
00452  * Fixed H245 connect on receiving call.
00453  *
00454  * Revision 1.8  1999/06/09 06:18:00  robertj
00455  * GCC compatibiltiy.
00456  *
00457  * Revision 1.7  1999/06/09 05:26:19  robertj
00458  * Major restructuring of classes.
00459  *
00460  * Revision 1.6  1999/06/06 06:06:36  robertj
00461  * Changes for new ASN compiler and v2 protocol ASN files.
00462  *
00463  * Revision 1.5  1999/04/26 06:14:46  craigs
00464  * Initial implementation for RTP decoding and lots of stuff
00465  * As a whole, these changes are called "First Noise"
00466  *
00467  * Revision 1.4  1999/02/23 11:04:28  robertj
00468  * Added capability to make outgoing call.
00469  *
00470  * Revision 1.3  1999/01/16 01:31:34  robertj
00471  * Major implementation.
00472  *
00473  * Revision 1.2  1999/01/02 04:00:59  robertj
00474  * Added higher level protocol negotiations.
00475  *
00476  * Revision 1.1  1998/12/14 09:13:12  robertj
00477  * Initial revision
00478  *
00479  */
00480 
00481 #include "openh323buildopts.h"
00482 
00483 #include "h323con.h"
00484 #include "h323ep.h"
00485 #include "gkclient.h"
00486 
00487 #ifndef NO_H323_VIDEO
00488 #include "h261codec.h"
00489 #include "h263codec.h"
00490 #ifdef HAS_CU30
00491 #include "cu30codec.h"
00492 #endif
00493 #endif // NO_H323_VIDEO
00494 
00495 #include <h323pluginmgr.h>
00496 
00497 PString  OpalGetVersion();
00498 unsigned OpalGetMajorVersion();
00499 unsigned OpalGetMinorVersion();
00500 unsigned OpalGetBuildNumber();
00501 
00502 namespace OpalOSP {
00503   // OSP token identifier as per section ETSI TS 101 32 D.3, using XML format
00504   // itu-t(0), identifier-organization(4), etsi(0), ts-101-1321(1321), token(1), xml-format(2)
00505   extern const char * ETSIXMLTokenOID;
00506 };
00507 

Generated on Sun Oct 22 13:32:21 2006 for OpenH323 by  doxygen 1.4.7