2
/* Ekiga -- A VoIP and Video-Conferencing application
3
* Copyright (C) 2000-2006 Damien Sandras
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20
* Ekiga is licensed under the GPL license and as a special exception,
21
* you have permission to link or otherwise combine this program with the
22
* programs OPAL, OpenH323 and PWLIB, and distribute the combination,
23
* without applying the requirements of the GNU GPL to the OPAL, OpenH323
24
* and PWLIB programs, as long as you do follow the requirements of the
25
* GNU GPL for all the rest of the software thus combined.
30
* h323endpoint.h - description
31
* ------------------------------
32
* begin : Wed 24 Nov 2004
33
* copyright : (C) 2000-2006 by Damien Sandras
34
* description : This file contains the H.323 Endpoint class.
39
#ifndef _H323_ENDPOINT_H_
40
#define _H323_ENDPOINT_H_
43
#include "../../config.h"
50
/* Minimal H.323 endpoint implementation */
51
class GMH323Endpoint : public H323EndPoint
53
PCLASSINFO(GMH323Endpoint, H323EndPoint);
57
/* DESCRIPTION : The constructor.
58
* BEHAVIOR : Creates the H.323 Endpoint
59
* and initialises the variables
62
GMH323Endpoint (GMManager &ep);
65
/* DESCRIPTION : The destructor.
73
* BEHAVIOR : Init the endpoint internal values and the various
81
* BEHAVIOR : Starts the listener thread on the port choosen
82
* in the options after having removed old listeners.
83
* returns TRUE if success and FALSE in case of error.
84
* PRE : The interface.
86
BOOL StartListener (PString iface,
91
* BEHAVIOR : Set the local user name following the firstname and last
92
* name stored by the conf, set the gatekeeper alias,
93
* possibly as first alias.
96
void SetUserNameAndAlias ();
100
* BEHAVIOR : Adds the User Input Mode following the
101
* configuration options. String, Tone, and RFC2833 are
105
void SetUserInputMode ();
109
* BEHAVIOR : Use the given gatekeeper.
112
BOOL UseGatekeeper (const PString & address = PString::Empty (),
113
const PString & domain = PString::Empty (),
114
const PString & iface = PString::Empty ());
118
* BEHAVIOR : Remove the given gatekeeper if we were registered to it.
119
* Returns TRUE if it worked.
120
* PRE : Non-Empty address.
122
BOOL RemoveGatekeeper (const PString & address);
126
* BEHAVIOR : Returns TRUE if we are registered with
127
* the given gatekeeper.
128
* PRE : Non-Empty address.
130
BOOL IsRegisteredWithGatekeeper (const PString & address);
133
/* DESCRIPTION : Called when there is an incoming SIP connection.
134
* BEHAVIOR : Checks if the connection must be rejected or forwarded
135
* and call the manager function of the same name
136
* to update the GUI and take the appropriate action
137
* on the connection. If the connection is not forwarded,
138
* or rejected, OnShowIncoming will be called on the PCSS
139
* endpoint, allowing to auto-answer the call or do further
140
* updates of the GUI and internal timers.
143
BOOL OnIncomingConnection (OpalConnection &connection);
146
/* DESCRIPTION : Called when the gatekeeper accepts the registration.
147
* BEHAVIOR : Update the endpoint state.
150
void OnRegistrationConfirm ();
153
/* DESCRIPTION : Called when the gatekeeper rejects the registration.
154
* BEHAVIOR : Update the endpoint state.
157
void OnRegistrationReject ();
160
/* DESCRIPTION : This callback is called when the connection is
161
* established and everything is ok.
162
* BEHAVIOR : Stops the timers.
165
void OnEstablished (OpalConnection &);
168
/* DESCRIPTION : This callback is called when a connection to a remote
169
* endpoint is cleared.
170
* BEHAVIOR : Stops the timers.
173
void OnReleased (OpalConnection &);
178
/* DESCRIPTION : Notifier called when an incoming call
179
* has not been answered in the required time.
180
* BEHAVIOR : Reject the call, or forward if forward on no answer is
181
* enabled in the config database.
184
PDECLARE_NOTIFIER(PTimer, GMH323Endpoint, OnNoAnswerTimeout);
186
PTimer NoAnswerTimer;
189
GMManager & endpoint;
190
PMutex gk_name_mutex;