📄 main.cxx
字号:
*
* Revision 1.223 2001/05/09 04:07:53 robertj
* Added more call end codes for busy and congested.
*
* Revision 1.222 2001/05/02 16:30:35 rogerh
* Tidy up comments
*
* Revision 1.221 2001/05/01 17:07:32 rogerh
* Allow CIF images to be transmitted by ordering the capabilities correctly
* The previous re-ordering code did not work as the codec names had changed
*
* Revision 1.220 2001/05/01 05:00:38 robertj
* Added command to do H.450.x call transfer and hold functions.
*
* Revision 1.219 2001/03/20 23:42:55 robertj
* Used the new PTrace::Initialise function for starting trace code.
*
* Revision 1.218 2001/03/12 03:52:09 dereks
* Tidy up fake video user interface. use --videodevice fake now.
*
* Revision 1.217 2001/03/08 23:53:26 robertj
* Changed the fake video test pattern numbers from -1, -2, -3 to 0, 1 & 2 due
* to -1 now being a default channel value for all video devices.
*
* Revision 1.216 2001/03/07 01:47:45 dereks
* Initial release of SDL (Simple DirectMedia Layer, a cross-platform multimedia library),
* a video library code.
*
* Revision 1.215 2001/03/03 05:59:16 robertj
* Major upgrade of video conversion and grabbing classes.
*
* Revision 1.214 2001/02/23 00:34:44 robertj
* Added ability to add/display non-standard data in setup PDU.
*
* Revision 1.213 2001/02/06 07:44:20 robertj
* Removed ACM codecs.
*
* Revision 1.212 2001/01/25 07:16:28 robertj
* Fixed spurious memory leak. It is OK for the trace file to never be deleted.
*
* Revision 1.211 2001/01/24 06:25:46 robertj
* Altered volume control range to be percentage, ie 100 is max volume.
*
* Revision 1.210 2001/01/18 12:24:19 rogerh
* Fix bug which prevented lookback being selected on OSs without IXJ (eg BSD)
*
* Revision 1.209 2001/01/16 13:52:19 rogerh
* Fix bug when reordering or deleting codecs. Found by "gnome" <gnome@21cn.com>
*
* Revision 1.208 2001/01/09 02:09:11 craigs
* Added extra logging
* Fixed problem with autodisconnect mode
*
* Revision 1.207 2001/01/05 14:55:53 rogerh
* remove a warning from non ixj systems
*
* Revision 1.206 2000/12/19 22:35:53 dereks
* Install revised video handling code, so that a video channel is used.
* Code now better handles the situation where the video grabber could not be opened.
*
* Revision 1.205 2000/12/16 21:54:31 eokerson
* Added DTMF generation when User Input Indication received.
*
* Revision 1.204 2000/11/13 22:31:38 craigs
* Fixed per connection options
*
* Revision 1.203 2000/11/10 04:09:43 craigs
* Changed to display AEC settings as text
* Fixed improved CIDCW support
* Removed misleading G728 defines
*
* Revision 1.202 2000/11/06 02:10:50 eokerson
* Added support for AGC on IXJ devices.
*
* Revision 1.201 2000/10/26 21:29:20 dereks
* Add --gsmframes parameter, for setting the number of gsmframes in one ethernet packet.
* Default value is 4. Lower audio latency can be achieved with a value of 1
*
* Revision 1.200 2000/10/22 20:27:39 rogerh
* Add more HAVE_IXJ #ifdefs to make code build on non-linux systems (eg FreeBSD)
* Submittd by Blaz Zupan <blaz@amis.net>
*
* Revision 1.199 2000/10/16 08:50:12 robertj
* Added single function to add all UserInput capability types.
*
* Revision 1.198 2000/10/13 01:47:59 dereks
* Include command line option for setting the number of transmitted video
* frames per second. use --videotxfps n (default n is 10)
*
* Revision 1.197 2000/09/29 00:07:38 craigs
* Added G711 frame size options
*
* Revision 1.196 2000/09/27 03:06:13 dereks
* Added lots of PTRACE statements to xlib code.
* Removed X videoMutex from main.cxx & main.h
* Removed some weird display issues from X code.
*
* Revision 1.195 2000/09/24 23:30:18 craigs
* Removed debugging messages
*
* Revision 1.194 2000/09/23 07:20:49 robertj
* Fixed problem with being able to distinguish between sw and hw codecs in LID channel.
*
* Revision 1.193 2000/09/22 01:35:55 robertj
* Added support for handling LID's that only do symmetric codecs.
*
* Revision 1.192 2000/09/22 01:30:14 robertj
* MSVC compatibility.
*
* Revision 1.191 2000/09/22 00:30:52 craigs
* Enhanced autoDisconnect and autoRepeat functions
*
* Revision 1.190 2000/09/21 00:42:50 craigs
* Changed play volume on sound cards to use PCM mixer channel
*
* Revision 1.189 2000/09/20 21:27:01 craigs
* Fixed problem with default connection options
*
* Revision 1.188 2000/09/13 23:58:11 dereks
* Corrected bug in video display. Now correctly handles 8, 16, 32 bit colour
* Correctly handles 8 bit grayscale.
*
* Revision 1.187 2000/09/08 06:50:06 craigs
* Added ability to set per-speed dial options
* Fixed problem with transmit-only endpoints
*
* Revision 1.186 2000/09/01 02:13:08 robertj
* Added ability to select a gatekeeper on LAN via it's identifier name.
*
* Revision 1.185 2000/08/30 23:43:27 robertj
* Added -C option to set IXJ country code.
* Added -c option for caller id, was documented in help but only had long version.
*
* Revision 1.184 2000/08/30 23:21:20 robertj
* Fixed MSVC warnings.
*
* Revision 1.183 2000/08/30 05:14:49 craigs
* Really fixed problem with setting quicknet volumes on startup
*
* Revision 1.182 2000/08/30 04:55:11 craigs
* Added ability to bind to discrete interfaces
* Fixed problem with initial audio settings
*
* Revision 1.181 2000/08/30 04:16:50 robertj
* Fixed MSVC warning.
*
* Revision 1.180 2000/08/30 01:52:53 craigs
* New IXJ volume code with pseudo-log scaling
*
* history deleted
*
* Revision 1.1 1998/12/14 09:13:19 robertj
* Initial revision
*
*/
#include <ptlib.h>
#include <ptclib/random.h>
#include "main.h"
#include "gsmcodec.h"
#include "lpc10codec.h"
#include "mscodecs.h"
#include <speexcodec.h>
#include "h261codec.h"
#include "h263codec.h"
#include "ffh263codec.h"
#include "h323pdu.h"
#include "g726codec.h"
//#include "h323t120.h"
//#include "t120proto.h"
#ifdef DEPRECATED_CU30
#include "cu30codec.h"
#endif
#ifdef P_LINUX
#include "vidlinux.h"
#include <sys/resource.h>
#endif
#define FICTITOUS_VIDEO "fake"
#if defined(P_FREEBSD) || defined(P_OPENBSD) || defined(P_NETBSD)
#define DEFAULT_VIDEO "/dev/bktr0"
#endif
#ifndef DEFAULT_VIDEO
#define DEFAULT_VIDEO "/dev/video0"
#endif
#ifdef HAS_X11
#include "xlibvid.h"
#endif
#ifdef P_SDL
#include <ptclib/vsdl.h>
#endif
#ifdef USE_SHM_VIDEO_DEVICES
#include "shmvideo.h"
#endif
#ifdef HAS_OSS
#define DEFAULT_MIXER "/dev/mixer"
#ifdef P_LINUX
#include <linux/soundcard.h>
#endif
#ifdef P_FREEBSD
#if P_FREEBSD >= 500000
#include <sys/soundcard.h>
#else
#include <machine/soundcard.h>
#endif
#endif
#if defined(P_OPENBSD) || defined(P_NETBSD)
#include <soundcard.h>
#endif
#endif // HAS OSS
// uncomment below if to include xJack G729 code
#ifdef _WIN32
#define G729
#endif
#ifdef HAS_LIDDEVICE
static const char * AECLevelNames[] = { "Off", "Low", "Medium", "High", "Auto AEC", "Auto AEC/AGC" };
#endif
#include "version.h"
PCREATE_PROCESS(OhPhone);
#define DEFAULT_TIMEOUT 60000
#define LAST_CALL_COUNT 16
#define POTS_LINE 0
class RingThread : public PThread
{
PCLASSINFO(RingThread, PThread);
public:
RingThread(MyH323EndPoint & ep)
: PThread(1000, NoAutoDeleteThread),
endpoint(ep)
{ Resume(); }
void Main()
{ endpoint.HandleRinging(); }
protected:
MyH323EndPoint & endpoint;
};
#define new PNEW
///////////////////////////////////////////////////////////////
OhPhone::OhPhone()
: PProcess("Open H323 Project", "OhPhone",
MAJOR_VERSION, MINOR_VERSION, BUILD_TYPE, BUILD_NUMBER)
{
}
OhPhone::~OhPhone()
{
}
void OhPhone::Main()
{
//PArgList & args = GetArguments();
PConfigArgs args(GetArguments());
args.Parse(
"a-auto-answer." "-no-auto-answer."
"b-bandwidth:" "-no-bandwidth."
"B-forward-busy:" "-no-forward-busy."
#ifdef HAS_LIDDEVICE
"c-callerid." "-no-callerid."
"C-country:" "-no-country."
#endif
"d-autodial:" "-no-autodial."
"D-disable:"
"e-silence." "-no-silence."
"f-fast-disable." "-no-fast-disable."
"F-forward-always:" "-no-forward-always."
"g-gatekeeper:"
"G-gatekeeper-id:"
"h-help."
"I-input-mode:"
"i-interface:" "-no-interface."
"j-jitter:" "-no-jitter."
"l-listen."
"n-no-gatekeeper."
"N-forward-no-answer:" "-no-forward-no-answer."
"-answer-timeout:" "-no-answer-timeout."
#if PTRACING
"o-output:" "-no-output."
#endif
"p-proxy:" "-no-proxy."
"-password:" "-no-password."
"-listenport:" "-no-listenport."
"-connectport:" "-no-connectport."
"-connectring:" "-no-connectring."
"-port:" "-no-port."
"P-prefer:"
#ifdef HAS_IXJ
"q-quicknet:" "-no-quicknet."
#endif
#ifdef HAS_VBLASTER
"V-voipblaster:" "-no-voipblaster."
#endif
"r-require-gatekeeper." "-no-require-gatekeeper."
"S-disable-h245-in-setup." "-no-disable-h245-in-setup."
"-save."
"-setup-param:" "-no-setup-param."
"s-sound:" "-no-sound."
"-sound-in:" "-no-sound-in."
"-sound-out:" "-no-sound-out."
"-sound-buffers:" "-no-sound-buffers."
#ifdef HAS_OSS
"-sound-mixer:" "-no-sound-mixer."
"-sound-recchan:" "-no-sound-recchan."
"-sound-recvol:" "-no-sound-recvol."
"-sound-playvol:" "-no-sound-playvol."
#endif
#ifdef PMEMORY_CHECK
"-setallocationbreakpoint:"
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -