OSDN Git Service

Add MS7619SE
[uclinux-h8/uClinux-dist.git] / lib / libopenh323 / samples / simple / main.h
1 /*
2  * main.h
3  *
4  * A simple H.323 "net telephone" application.
5  *
6  * Copyright (c) 2000 Equivalence Pty. Ltd.
7  *
8  * The contents of this file are subject to the Mozilla Public License
9  * Version 1.0 (the "License"); you may not use this file except in
10  * compliance with the License. You may obtain a copy of the License at
11  * http://www.mozilla.org/MPL/
12  *
13  * Software distributed under the License is distributed on an "AS IS"
14  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
15  * the License for the specific language governing rights and limitations
16  * under the License.
17  *
18  * The Original Code is Portable Windows Library.
19  *
20  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
21  *
22  * Contributor(s): ______________________________________.
23  *
24  * $Log: main.h,v $
25  * Revision 1.8  2001/11/01 01:35:25  robertj
26  * Added default Fast Start disabled and H.245 tunneling disable flags
27  *   to the endpoint instance.
28  *
29  * Revision 1.7  2001/08/06 03:18:35  robertj
30  * Fission of h323.h to h323ep.h & h323con.h, h323.h now just includes files.
31  * Improved access to H.235 secure RAS functionality.
32  * Changes to H.323 secure RAS contexts to help use with gk server.
33  *
34  * Revision 1.6  2001/08/03 11:56:26  robertj
35  * Added conditional compile for H.235 stuff.
36  *
37  * Revision 1.5  2001/03/21 04:52:40  robertj
38  * Added H.235 security to gatekeepers, thanks Fürbass Franz!
39  *
40  * Revision 1.4  2001/03/20 23:42:55  robertj
41  * Used the new PTrace::Initialise function for starting trace code.
42  *
43  * Revision 1.3  2000/07/31 14:08:09  robertj
44  * Added fast start and H.245 tunneling flags to the H323Connection constructor so can
45  *    disabled these features in easier manner to overriding virtuals.
46  *
47  * Revision 1.2  2000/06/07 05:47:56  robertj
48  * Added call forwarding.
49  *
50  * Revision 1.1  2000/05/11 04:05:57  robertj
51  * Simple sample program.
52  *
53  */
54
55 #ifndef _SimpleH323_MAIN_H
56 #define _SimpleH323_MAIN_H
57
58 #include <h323.h>
59
60
61 class SimpleH323EndPoint : public H323EndPoint
62 {
63   PCLASSINFO(SimpleH323EndPoint, H323EndPoint);
64
65   public:
66     SimpleH323EndPoint();
67     ~SimpleH323EndPoint();
68
69     // overrides from H323EndPoint
70     virtual H323Connection * CreateConnection(unsigned callReference);
71     virtual BOOL OnIncomingCall(H323Connection &, const H323SignalPDU &, H323SignalPDU &);
72     virtual H323Connection::AnswerCallResponse OnAnswerCall(H323Connection &, const PString &, const H323SignalPDU &, H323SignalPDU &);
73     virtual BOOL OnConnectionForwarded(H323Connection &, const PString &, const H323SignalPDU &);
74     virtual void OnConnectionEstablished(H323Connection & connection, const PString & token);
75     virtual void OnConnectionCleared(H323Connection & connection, const PString & clearedCallToken);
76     virtual BOOL OpenAudioChannel(H323Connection &, BOOL, unsigned, H323AudioCodec &);
77
78     // New functions
79     BOOL Initialise(PArgList &);
80     BOOL SetSoundDevice(PArgList &, const char *, PSoundChannel::Directions);
81
82     PString currentCallToken;
83
84   protected:
85     BOOL autoAnswer;
86     PString busyForwardParty;
87 };
88
89
90 class SimpleH323Connection : public H323Connection
91 {
92     PCLASSINFO(SimpleH323Connection, H323Connection);
93
94   public:
95     SimpleH323Connection(SimpleH323EndPoint &, unsigned);
96
97     virtual BOOL OnStartLogicalChannel(H323Channel &);
98     virtual void OnUserInputString(const PString &);
99
100   protected:
101     BOOL noFastStart;
102 };
103
104
105 class SimpleH323Process : public PProcess
106 {
107   PCLASSINFO(SimpleH323Process, PProcess)
108
109   public:
110     SimpleH323Process();
111     ~SimpleH323Process();
112
113     void Main();
114
115   protected:
116     SimpleH323EndPoint * endpoint;
117 };
118
119
120 #endif  // _SimpleH323_MAIN_H
121
122
123 // End of File ///////////////////////////////////////////////////////////////