📄 h323.cxx
字号:
/* * h323.cxx * * H.323 protocol handler * * Open H323 Library * * Copyright (c) 1998-2000 Equivalence Pty. Ltd. * * The contents of this file are subject to the Mozilla Public License * Version 1.0 (the "License"); you may not use this file except in * compliance with the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See * the License for the specific language governing rights and limitations * under the License. * * The Original Code is Open H323 Library. * * The Initial Developer of the Original Code is Equivalence Pty. Ltd. * * Contributor(s): ______________________________________. * * $Log: h323.cxx,v $ * Revision 1.125 2000/07/15 09:56:37 robertj * Changed adding of fake remote capability to after fast start element has been * checked and new parameters (eg frames per packet) has been parsed out of it. * * Revision 1.124 2000/07/14 14:03:47 robertj * Changed fast start connect so if has bad h245 address does not clear call. * * Revision 1.123 2000/07/13 16:07:22 robertj * Fixed ability to receive a H.245 secondary TCP link in a Connect during a fast start. * * Revision 1.122 2000/07/13 12:35:13 robertj * Fixed problems with fast start frames per packet adjustment. * Split autoStartVideo so can select receive and transmit independently * * Revision 1.121 2000/07/10 16:06:59 robertj * Added TCS=0 support. * Fixed bug where negotiations hang if not fast start and tunnelled but remot does not tunnel. * * Revision 1.120 2000/07/09 15:24:42 robertj * Removed sending of MSD in Setup PDU, is not to spec. * Added start of TCS if received TCS from other end and have not already started. * * Revision 1.119 2000/07/08 19:49:27 craigs * Fixed stupidity in handling of fastStart capabilities * * Revision 1.118 2000/07/04 09:00:54 robertj * Added traces for indicating failure of channel establishment due to capability set rules. * * Revision 1.117 2000/07/04 04:15:38 robertj * Fixed capability check of "combinations" for fast start cases. * * Revision 1.116 2000/07/04 01:16:49 robertj * Added check for capability allowed in "combinations" set, still needs more done yet. * * Revision 1.115 2000/06/17 09:14:13 robertj * Moved sending of DRQ to after release complete to be closer to spec, thanks Thien Nguyen * * Revision 1.114 2000/06/07 05:48:06 robertj * Added call forwarding. * * Revision 1.113 2000/06/05 06:33:08 robertj * Fixed problem with roud trip time statistic not being calculated if constant traffic. * * Revision 1.112 2000/06/03 03:16:39 robertj * Fixed using the wrong capability table (should be connections) for some operations. * * Revision 1.111 2000/05/23 11:32:36 robertj * Rewrite of capability table to combine 2 structures into one and move functionality into that class * allowing some normalisation of usage across several applications. * Changed H323Connection so gets a copy of capabilities instead of using endponts, allows adjustments * to be done depending on the remote client application. * * Revision 1.110 2000/05/22 05:21:36 robertj * Fixed race condition where controlChannel variable could be used before set. * * Revision 1.109 2000/05/16 08:14:30 robertj * Added function to find channel by session ID, supporting H323Connection::FindChannel() with mutex. * Added function to get a logical channel by channel number. * * Revision 1.108 2000/05/16 02:06:00 craigs * Added access functions for particular sessions * * Revision 1.107 2000/05/09 12:19:31 robertj * Added ability to get and set "distinctive ring" Q.931 functionality. * * Revision 1.106 2000/05/09 04:12:36 robertj * Changed fast start to offer multiple codecs instead of only the preferred one. * * Revision 1.105 2000/05/08 14:32:26 robertj * Fixed GNU compiler compatibility problems. * * Revision 1.104 2000/05/08 14:07:35 robertj * Improved the provision and detection of calling and caller numbers, aliases and hostnames. * * Revision 1.103 2000/05/05 05:05:55 robertj * Removed warning in GNU compiles. * * Revision 1.102 2000/05/02 04:32:26 robertj * Fixed copyright notice comment. * * Revision 1.101 2000/04/28 13:01:44 robertj * Fixed problem with adjusting tx/rx frame counts in capabilities during fast start. * * Revision 1.100 2000/04/18 23:10:49 robertj * Fixed bug where fast starts two video recievers instread of receiver and transmitter. * * Revision 1.99 2000/04/14 21:09:51 robertj * Work around for compatibility problem wth broken Altigen AltaServ-IG PBX. * * Revision 1.98 2000/04/14 20:03:05 robertj * Added function to get remote endpoints application name. * * Revision 1.97 2000/04/14 17:31:05 robertj * Fixed bug where checking the error code on the wrong channel. Caused hang ups. * * Revision 1.96 2000/04/13 18:08:46 robertj * Fixed error in SendUserInput() check for value string, previous change was seriously broken. * * Revision 1.95 2000/04/11 20:07:01 robertj * Added missing trace strings for new call end reasons on gatekeeper denied calls. * * Revision 1.94 2000/04/11 04:02:48 robertj * Improved call initiation with gatekeeper, no longer require @address as * will default to gk alias if no @ and registered with gk. * Added new call end reasons for gatekeeper denied calls. * * Revision 1.93 2000/04/10 20:37:33 robertj * Added support for more sophisticated DTMF and hook flash user indication. * * Revision 1.92 2000/04/06 17:50:16 robertj * Added auto-start (including fast start) of video channels, selectable via boolean on the endpoint. * * Revision 1.91 2000/04/05 03:17:31 robertj * Added more RTP statistics gathering and H.245 round trip delay calculation. * * Revision 1.90 2000/03/29 04:42:19 robertj * Improved some trace logging messages. * * Revision 1.89 2000/03/29 02:14:45 robertj * Changed TerminationReason to CallEndReason to use correct telephony nomenclature. * Added CallEndReason for capability exchange failure. * * Revision 1.88 2000/03/27 22:43:11 robertj * Fixed possible write to closed channel on shutdown when control channel separate. * * Revision 1.87 2000/03/25 02:01:50 robertj * Added adjustable caller name on connection by connection basis. * * Revision 1.86 2000/03/22 01:30:34 robertj * Fixed race condition in accelerated start (Cisco compatibility). * * Revision 1.85 2000/03/21 01:43:59 robertj * Fixed (faint) race condition when starting separate H.245 channel. * * Revision 1.84 2000/03/21 01:08:10 robertj * Fixed incorrect call reference code being used in originated call. * * Revision 1.83 2000/03/07 13:54:28 robertj * Fixed assert when cancelling call during TCP connect, thanks Yura Ershov. * * Revision 1.82 2000/03/02 02:18:13 robertj * Further fixes for early H245 establishment confusing the fast start code. * * Revision 1.81 2000/03/01 02:09:51 robertj * Fixed problem if H245 channel established before H225 connect. * * Revision 1.80 2000/01/07 08:21:32 robertj * Added status functions for connection and tidied up the answer call function * * Revision 1.79 2000/01/04 01:06:06 robertj * Removed redundent code, thanks Dave Harvey. * * Revision 1.78 2000/01/04 00:14:53 craigs * Added extra states to AnswerCall * * Revision 1.77 1999/12/23 23:02:35 robertj * File reorganision for separating RTP from H.323 and creation of LID for VPB support. * * Revision 1.76 1999/12/11 02:21:00 robertj * Added ability to have multiple aliases on local endpoint. * * Revision 1.75 1999/12/09 20:30:54 robertj * Fixed problem with receiving multiple fast start open fields in multiple PDU's. * * Revision 1.74 1999/11/23 03:38:51 robertj * Fixed yet another call termination reason code error. * * Revision 1.73 1999/11/22 10:07:23 robertj * Fixed some errors in correct termination states. * * Revision 1.72 1999/11/20 04:36:56 robertj * Fixed setting of transmitter channel numbers on receiving fast start. * * Revision 1.71 1999/11/19 13:00:25 robertj * Added call token into traces so can tell which connection is being cleaned up. * * Revision 1.70 1999/11/19 08:16:08 craigs * Added connectionStartTime * * Revision 1.69 1999/11/17 04:22:59 robertj * Fixed bug in incorrect termination state when making a fast start call. * * Revision 1.68 1999/11/17 00:01:12 robertj * Improved determination of caller name, thanks Ian MacDonald * * Revision 1.67 1999/11/14 11:25:34 robertj * Fixed bug with channel close callback being called twice when fast starting. * * Revision 1.66 1999/11/13 14:11:24 robertj * Fixed incorrect state on fast start receive. * * Revision 1.65 1999/11/10 23:29:45 robertj * Changed OnAnswerCall() call back function to allow for asyncronous response. * * Revision 1.64 1999/11/06 11:58:24 robertj * Changed clean up to delete logical channels before channel destructor is called. * * Revision 1.63 1999/11/06 11:03:58 robertj * Fixed bug in fast start with H245 channel opening multiple channels. * Fixed bug in clean up, write of release complete if TCP connection failed. * * Revision 1.62 1999/11/06 05:37:45 robertj * Complete rewrite of termination of connection to avoid numerous race conditions. * * Revision 1.61 1999/11/05 08:24:43 robertj * Fixed bug in receiver refusing fast start, then not being able to start normally. * * Revision 1.60 1999/10/30 12:34:46 robertj * Added information callback for closed logical channel on H323EndPoint. * * Revision 1.59 1999/10/29 14:19:14 robertj * Fixed incorrect termination code when connection closed locally. * * Revision 1.58 1999/10/29 02:26:18 robertj * Added reason for termination code to H323Connection. * * Revision 1.57 1999/10/19 00:04:57 robertj * Changed OpenAudioChannel and OpenVideoChannel to allow a codec AttachChannel with no autodelete. * * Revision 1.56 1999/10/16 03:47:49 robertj * Fixed termination of gatekeeper RAS thread problem * * Revision 1.55 1999/10/14 12:05:03 robertj * Fixed deadlock possibilities in clearing calls. * * Revision 1.54 1999/10/10 08:59:47 robertj * no message * * Revision 1.53 1999/10/09 01:18:23 craigs * Added codecs to OpenAudioChannel and OpenVideoDevice functions * * Revision 1.52 1999/10/08 08:31:18 robertj * Fixed problem with fast start fall back to capability exchange * * Revision 1.51 1999/10/07 03:26:58 robertj * Fixed some fast-start compatbility problems. * * Revision 1.50 1999/09/23 07:33:53 robertj * Fixed some fast start/245 tunnelling bugs, some odd cases. * * Revision 1.49 1999/09/23 07:25:12 robertj * Added open audio and video function to connection and started multi-frame codec send functionality. * * Revision 1.48 1999/09/21 14:09:39 robertj * Removed warnings when no tracing enabled. * * Revision 1.47 1999/09/15 01:26:27 robertj * Changed capability set call backs to have more specific class as parameter. * * Revision 1.46 1999/09/14 14:26:17 robertj * Added more debug tracing. * * Revision 1.45 1999/09/10 03:36:48 robertj * Added simple Q.931 Status response to Q.931 Status Enquiry * * Revision 1.44 1999/09/08 04:05:49 robertj * Added support for video capabilities & codec, still needs the actual codec itself! * * Revision 1.43 1999/08/31 12:34:19 robertj * Added gatekeeper support. * * Revision 1.42 1999/08/27 15:42:44 craigs * Fixed problem with local call tokens using ambiguous interface names, and connect timeouts not changing connection state * * Revision 1.41 1999/08/25 05:11:22 robertj * File fission (critical mass reached). * Improved way in which remote capabilities are created, removed case statement! * Changed MakeCall, so immediately spawns thread, no black on TCP connect. * * Revision 1.40 1999/08/14 03:26:45 robertj * Compiler compatibility problems. * * Revision 1.39 1999/08/10 04:20:26 robertj * Fixed constness problems in some PASN_Choice casts. * * Revision 1.38 1999/08/08 10:03:33 robertj * Fixed capability selection to honor local table priority order. * * Revision 1.37 1999/07/23 02:37:53 robertj * Fixed problems with hang ups and crash closes of connections. * * Revision 1.36 1999/07/19 02:01:02 robertj * Fixeed memory leask on connection termination. * Fixed connection "orderly close" on endpoint termination. * * Revision 1.35 1999/07/18 14:57:29 robertj * Fixed bugs in slow start with H245 tunnelling, part 4. * * Revision 1.34 1999/07/18 14:29:31 robertj * Fixed bugs in slow start with H245 tunnelling, part 3. * * Revision 1.33 1999/07/18 13:59:12 robertj * Fixed bugs in slow start with H245 tunnelling, part 2. * * Revision 1.32 1999/07/18 13:25:40 robertj * Fixed bugs in slow start with H245 tunnelling. * * Revision 1.31 1999/07/18 10:19:39 robertj * Fixed CreateCapability function: missing break's in case! * * Revision 1.30 1999/07/17 06:22:32 robertj * Fixed bug in setting up control channel when initiating call (recently introduced) * * Revision 1.29 1999/07/16 16:04:41 robertj * Bullet proofed local capability table data entry. * * Revision 1.28 1999/07/16 14:04:47 robertj * Fixed bug that caused signal channel to be closed, forgot to disable connect time. * * Revision 1.27 1999/07/16 06:15:59 robertj * Corrected semantics for tunnelled master/slave determination in fast start. * * Revision 1.26 1999/07/16 02:15:20 robertj * Fixed more tunneling problems. * Fixed fastStart initiator matching response to correct channels. * * Revision 1.25 1999/07/16 00:51:03 robertj * Some more debugging of fast start. * * Revision 1.24 1999/07/15 14:45:36 robertj * Added propagation of codec open error to shut down logical channel. * Fixed control channel start up bug introduced with tunnelling. * * Revision 1.23 1999/07/15 09:04:31 robertj * Fixed some fast start bugs * * Revision 1.22 1999/07/14 06:06:14 robertj * Fixed termination problems (race conditions) with deleting connection object. * * Revision 1.21 1999/07/13 09:53:24 robertj * Fixed some problems with jitter buffer and added more debugging. * * Revision 1.20 1999/07/13 02:50:58 craigs * Changed semantics of SetPlayDevice/SetRecordDevice, only descendent * endpoint assumes PSoundChannel devices for audio codec. * * Revision 1.19 1999/07/10 02:59:26 robertj * Fixed ability to hang up incoming connection. * * Revision 1.18 1999/07/10 02:51:36 robertj * Added mutexing in H245 procedures. Also fixed MSD state bug. * * Revision 1.17 1999/07/09 14:59:59 robertj * Fixed GNU C++ compatibility. * * Revision 1.16 1999/07/09 06:09:49 robertj * Major implementation. An ENORMOUS amount of stuff added everywhere. * * Revision 1.15 1999/06/25 10:25:35 robertj * Added maintentance of callIdentifier variable in H.225 channel. * * Revision 1.14 1999/06/22 13:45:05 robertj * Added user question on listener version to accept incoming calls. * * Revision 1.13 1999/06/14 06:39:08 robertj * Fixed problem with getting transmit flag to channel from PDU negotiator * * Revision 1.12 1999/06/14 05:15:55 robertj * Changes for using RTP sessions correctly in H323 Logical Channel context * * Revision 1.11 1999/06/13 12:41:14 robertj * Implement logical channel transmitter.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -