⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 网络电话(VOIP)软件Pchone 1、按照OpenH323库中readme.txt说明编译OpenH323库 2、再用VC编译PCPhone代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/*
 * main.h
 *
 * PWLib application header file for OpenPhone
 *
 * Open H323 Library
 *
 * Copyright (c) 1993-1998 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.
 *
 * Portions of this code were written with the assisance of funding from
 * Vovida Networks, Inc. http://www.vovida.com.
 *
 * Portions are Copyright (C) 1993 Free Software Foundation, Inc.
 * All Rights Reserved.
 *
 * Contributor(s): Portions Copyright 1999 NEWLINK
 *
 * $Log: main.h,v $
 * Revision 1.54  2002/06/22 05:49:11  robertj
 * Added partial implementation for H.450.11 Call Intrusion
 *
 * Revision 1.53  2002/05/21 02:43:40  robertj
 * Added ability to record incoming media to WAV file.
 *
 * Revision 1.52  2002/05/17 05:56:47  robertj
 * Removed T.38 as is this app is useless for testing.
 *
 * Revision 1.51  2002/04/12 06:08:42  robertj
 * Added ability to set ports for TCP and RTP IDP.
 *
 * Revision 1.50  2002/03/05 08:02:55  robertj
 * Added caller id output to Quicknet card.
 *
 * Revision 1.49  2002/02/01 01:46:08  robertj
 * Fixed T.120 and T.38 callbacks, still debugging them!
 *
 * Revision 1.48  2002/01/17 07:03:30  robertj
 * Added support for RFC2833 embedded DTMF in the RTP stream
 *
 * Revision 1.47  2002/01/15 06:39:54  robertj
 * Added support for VOIP blaster
 *
 * Revision 1.46  2002/01/08 02:12:00  robertj
 * Fixed bad override of PVideoDevice::SetFrameSize so didn't resize window.
 *
 * Revision 1.45  2001/11/01 01:35:25  robertj
 * Added default Fast Start disabled and H.245 tunneling disable flags
 *   to the endpoint instance.
 *
 * Revision 1.44  2001/10/25 01:21:31  robertj
 * Fixed incorrect type for virtual so does not override correctly, this causing
 *   video window not to be opened, thanks Robert Lupa & Kurt Michael Krauss
 *
 * Revision 1.43  2001/07/17 04:44:32  robertj
 * Partial implementation of T.120 and T.38 logical channels.
 *
 * Revision 1.42  2001/05/23 10:06:58  robertj
 * Added ability to send fake video, thanks Paonza
 *
 * Revision 1.41  2001/05/01 05:25:34  robertj
 * Added command to do H.450.x call hold function.
 *
 * Revision 1.40  2001/04/11 03:01:30  robertj
 * Added H.450.2 (call transfer), thanks a LOT to Graeme Reid & Norwood Systems
 *
 * Revision 1.39  2001/03/30 07:54:46  robertj
 * Added VU meters.
 *
 * Revision 1.38  2001/03/03 05:59:17  robertj
 * Major upgrade of video conversion and grabbing classes.
 *
 * Revision 1.37  2000/12/19 22:43:13  dereks
 * Add calls to use the video channel, rather than video device
 * Better handles the case where the grabber could not be opened.
 *
 * Revision 1.36  2000/12/01 00:09:53  robertj
 * Rearranged sliders for adjusting silence detect delays.
 *
 * Revision 1.35  2000/11/30 05:16:24  robertj
 * Added ability to adjust the silence detection deadband times.
 *
 * Revision 1.34  2000/11/27 00:42:42  robertj
 * Added detection of tones and hookflash on xJACK to be sent via UserIndication.
 * Added forced test for PSTN line on startup.
 *
 * Revision 1.33  2000/07/31 14:08:19  robertj
 * Added fast start and H.245 tunneling flags to the H323Connection constructor so can
 *    disabled these features in easier manner to overriding virtuals.
 *
 * Revision 1.32  2000/07/02 09:14:09  robertj
 * Fixed problems with closing video receive window under Win32.
 *
 * Revision 1.31  2000/06/29 06:20:53  robertj
 * Fixed deadlock when exiting application while in a call.
 *
 * Revision 1.30  2000/06/15 01:46:15  robertj
 * Added channel pause (aka mute) functions.
 *
 * Revision 1.29  2000/06/07 05:48:06  robertj
 * Added call forwarding.
 *
 * Revision 1.28  2000/05/10 05:16:00  robertj
 * Added hook flash to user indications. Also allowed selection of the User Indication
 *    method to be used in the H.245 protocol.
 *
 * Revision 1.27  2000/05/04 11:53:38  robertj
 * Added Packets Too Late statistics.
 * Fixed gatekeeper detection so if "required", disables call menus.
 *
 * Revision 1.26  2000/05/01 08:20:28  robertj
 * Fixed capability loading so do not need to restart program when altering video parameters.
 *
 * Revision 1.25  2000/04/19 02:07:29  robertj
 * Fixed problems with video window.
 *
 * Revision 1.24  2000/04/11 03:59:33  robertj
 * Added new call end reasons for gatekeeper denied calls.
 *
 * Revision 1.23  2000/04/05 20:56:47  robertj
 * Added more statistics.
 *
 * Revision 1.22  2000/03/04 13:44:00  robertj
 * Added timer to ring every 5 seconds and not just once!
 *
 * Revision 1.21  2000/03/04 12:16:55  robertj
 * Added ring sound file to standard sound device on incoming calls.
 *
 * Revision 1.20  2000/02/17 12:25:17  robertj
 * Added user indication send/receive and option to disable H.245 tunneling.
 *
 * Revision 1.19  1999/12/23 23:02:35  robertj
 * File reorganision for separating RTP from H.323 and creation of LID for VPB support.
 *
 * Revision 1.18  1999/11/22 11:20:47  robertj
 * Fixed problem with handset pick up while making H.323 call but before connected.
 *
 * Revision 1.17  1999/11/19 13:00:52  robertj
 * Added HangingUp state so can't start new call till old one fully cleared.
 *
 * Revision 1.16  1999/11/17 03:49:51  robertj
 * Added RTP statistics display.
 *
 * Revision 1.15  1999/11/16 13:22:24  robertj
 * Improved versioning in about dialog (version number now in single place)
 *
 * Revision 1.14  1999/11/13 14:11:56  robertj
 * Changes to make silence detection selectable.
 *
 * Revision 1.13  1999/11/11 23:14:40  robertj
 * Fixed turning off ring on answering call and disabling call menu if initialisation failed.
 *
 * Revision 1.12  1999/11/11 08:54:27  robertj
 * Changed preferred codec function to be full codec ordering.
 *
 * Revision 1.11  1999/11/11 01:20:48  robertj
 * Numerous enhancements to get nearly feature complete for version 1.
 *
 * Revision 1.10  1999/11/06 03:48:36  robertj
 * Added shells for mute functions
 *
 * Revision 1.9  1999/11/05 08:54:41  robertj
 * Rewrite of ixj interface code to fix support for arbitrary codecs.
 *
 * Revision 1.8  1999/11/01 00:50:16  robertj
 * Added receive H.261 video window
 *
 * Revision 1.7  1999/10/30 12:45:47  robertj
 * Added stop channel message, outside line message and G728/G729 interlock for LineJACK
 *
 * Revision 1.6  1999/10/29 02:26:52  robertj
 * Added scrollable status window and better termination information.
 *
 * Revision 1.5  1999/10/28 12:21:34  robertj
 * Added AEC support and speakerphone switching button.
 *
 * Revision 1.4  1999/10/27 06:32:50  robertj
 * Changes to prevent H225 alerting message being sent if "engaged".
 *
 * Revision 1.3  1999/10/24 12:59:40  robertj
 * Added platform independent support for Quicknet xJACK cards.
 *
 * Revision 1.2  1999/10/07 07:37:31  robertj
 * Added auto-answer and trace options (thanks David Iodice of NEWLINK)
 *
 * Revision 1.1  1999/08/25 05:16:11  robertj
 * GUI test application.
 *
 * Revision 1.3  1999/05/24 03:03:08  robertj
 * Fixed include paths after restructure (much belated).
 *
 * Revision 1.2  1999/01/26 06:35:08  robertj
 * Fixed $LOG$ variable in template files
 *
 */

#ifndef _OpenPhone_MAIN_H
#define _OpenPhone_MAIN_H

#include "h323.h"
#include "videoio.h"


//#define TESTING_T120
//#define TESTING_T38

#ifdef TESTING_T120
#include "t120proto.h"
#endif

#ifdef TESTING_T38
#include "t38proto.h"
#endif


class MainWindow;
//class MainMenu;
class StatisticsDlg;
class OpalLineInterfaceDevice;
class OpalRtpToWavFile;


///////////////////////////////////////////////////////

class OpenPhoneEndPoint : public H323EndPoint
{
  PCLASSINFO(OpenPhoneEndPoint, H323EndPoint);

  public:
    OpenPhoneEndPoint(MainWindow * mainWindow);
    ~OpenPhoneEndPoint();

    // overrides from H323EndPoint
    BOOL OnIncomingCall(H323Connection &, const H323SignalPDU &, H323SignalPDU &);
    BOOL OnConnectionForwarded(H323Connection &, const PString &, const H323SignalPDU &);
    void OnConnectionEstablished(H323Connection &, const PString &);
    void OnConnectionCleared    (H323Connection &, const PString &);
 
    H323Connection * CreateConnection(unsigned callReference);
    BOOL OpenAudioChannel(H323Connection &, BOOL, unsigned, H323AudioCodec &);
    BOOL OpenVideoChannel(H323Connection &, BOOL, H323VideoCodec &);
    BOOL OnStartLogicalChannel(H323Connection &, H323Channel &);
    void OnClosedLogicalChannel(H323Connection &, const H323Channel &);
    void OnRTPStatistics(const H323Connection &, const RTP_Session &) const;

#ifdef TESTING_T120
    virtual OpalT120Protocol * CreateT120ProtocolHandler(const H323Connection &) const;
#endif

    // new functions
    BOOL Initialise(PConfig & config);
    BOOL OpenLID(PConfig & config);
    void CloseLID();
    BOOL FindGatekeeper(PConfig & config);
    void LoadCapabilities(PConfig & config);

    OpalLineInterfaceDevice * lid;
    unsigned potsLine, pstnLine;
    unsigned silenceDeadband, signalDeadband;
    PString alwaysForwardParty;
    PString busyForwardParty;
    int  videoSize;
    int videoWidth;
    int videoHeight;
    BOOL localVideo;
    BOOL localFlip;
    BOOL remoteFlip;

  protected:
    PDECLARE_NOTIFIER(PThread, OpenPhoneEndPoint, HandleLID);

    MainWindow * mainWindow;
    PThread    * phoneThread;
};


///////////////////////////////////////////////////////

class OpenPhoneConnection : public H323Connection
{
  PCLASSINFO(OpenPhoneConnection, H323Connection);

  public:
    OpenPhoneConnection(
      OpenPhoneEndPoint & mgr,
      unsigned callReference,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -