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