~ubuntu-branches/ubuntu/saucy/ekiga/saucy

« back to all changes in this revision

Viewing changes to src/endpoints/sip.h

  • Committer: Bazaar Package Importer
  • Author(s): Eugen Dedu, Eugen Dedu, Loic Minier
  • Date: 2008-09-27 10:00:00 UTC
  • mfrom: (5.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20080927100000-l5k5werb6czr5b3h
Tags: 3.0.1-1
[ Eugen Dedu ]
* New version.  (Closes: #500089).
* Add our own changelog file in /usr/share/doc.
* Remove gnomemeeting transitional package.
* Discover new interfaces.  (Closes: #488199).
* Compile with dbus support.  (Closes: #467212).
* Numeric keypad inserts digits at correct position.  (Closes: #440159).
* Use libnotify upon call.  (Closes: #412604).
* Symlink identical GNOME help files, to reduce size.  (Closes: #505536).
* Explicitely build-depends on a few dev packages, even if they were
  pulled out anyway by the other dependencies.

[ Loic Minier ]
* Use clean:: instead of clean: in rules.
* Don't disable Uploaders: generation for control.in -> control generation
  in rules.
* Fix some tabs which were size 4 anyway.
* Generate a PO template during build by calling intltool-update -p in
  install; thanks Ubuntu and Martin Pitt; closes: #505535.
* Also let the -dbg depend on ${misc:Depends}.
* Cleanup rules; in particular, use dpkg-parsechangelog and honor
  distclean/clean failures, remove old clean rules, commented out stuff,
  gtk-only stuff.
* Pass -s to dh_* in binary-arch.
* Use debian/*.links and debian/*.manpages instead of symlink manually or
  passing files to dh_installman.
* Use ftp.gnome.org in copyright.
* Switch to quilt and fix target deps in the process; build-dep on quilt
  instead of dpatch; rename news.dpatch to 00_news.patch and refresh;
  replace 00list with series.
* Install autotools-dev config.guess and .sub after patching.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
/* Ekiga -- A VoIP and Video-Conferencing application
3
 
 * Copyright (C) 2000-2006 Damien Sandras
4
 
 *
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.
9
 
 *
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.
14
 
 *
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.
18
 
 *
19
 
 *
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.
26
 
 */
27
 
 
28
 
 
29
 
/*
30
 
 *                         sipendpoint.h  -  description
31
 
 *                         -----------------------------
32
 
 *   begin                : Wed 24 Nov 2004
33
 
 *   copyright            : (C) 2000-2006 by Damien Sandras
34
 
 *   description          : This file contains the SIP Endpoint class.
35
 
 *
36
 
 */
37
 
 
38
 
 
39
 
#ifndef _SIP_ENDPOINT_H_
40
 
#define _SIP_ENDPOINT_H_
41
 
 
42
 
 
43
 
#include "../../config.h"
44
 
 
45
 
#include "common.h"
46
 
 
47
 
#include "manager.h"
48
 
 
49
 
 
50
 
PDICTIONARY (msgDict, PString, PString);
51
 
 
52
 
 
53
 
/* Minimal SIP endpoint implementation */
54
 
class GMSIPEndpoint : public SIPEndPoint
55
 
{
56
 
  PCLASSINFO(GMSIPEndpoint, SIPEndPoint);
57
 
 
58
 
 public:
59
 
 
60
 
  /* DESCRIPTION  :  The constructor.
61
 
   * BEHAVIOR     :  Creates the H.323 Endpoint 
62
 
   *                 and initialises the variables
63
 
   * PRE          :  /
64
 
   */
65
 
  GMSIPEndpoint (GMManager &ep);
66
 
 
67
 
  
68
 
  /* DESCRIPTION  :  The destructor.
69
 
   * BEHAVIOR     :  /
70
 
   * PRE          :  /
71
 
   */
72
 
  ~GMSIPEndpoint ();
73
 
  
74
 
  
75
 
  /* DESCRIPTION  :  /
76
 
   * BEHAVIOR     :  Init the endpoint internal values and the various
77
 
   *                 components.
78
 
   * PRE          :  /
79
 
   */
80
 
  void Init ();
81
 
  
82
 
  
83
 
  /* DESCRIPTION  :  /
84
 
   * BEHAVIOR     :  Starts the listener thread on the port choosen 
85
 
   *                 in the options after having removed old listeners.
86
 
   *                 returns TRUE if success and FALSE in case of error.
87
 
   * PRE          :  The interface.
88
 
   */
89
 
  BOOL StartListener (PString iface,
90
 
                      WORD port);
91
 
 
92
 
  
93
 
  /* DESCRIPTION  :  /
94
 
   * BEHAVIOR     :  Set the local user name following the firstname and last 
95
 
   *                 name stored by the conf.
96
 
   * PRE          :  /
97
 
   */
98
 
  void SetUserNameAndAlias ();
99
 
 
100
 
  
101
 
  /* DESCRIPTION  :  /
102
 
   * BEHAVIOR     :  Adds the User Input Mode following the
103
 
   *                 configuration options. Only RFC2833 is supported
104
 
   *                 for now.
105
 
   * PRE          :  /
106
 
   */
107
 
  void SetUserInputMode ();
108
 
  
109
 
  
110
 
  /* DESCRIPTION  :  Called when the registration is successful. 
111
 
   * BEHAVIOR     :  Displays a message in the status bar and history. 
112
 
   * PRE          :  /
113
 
   */
114
 
  void OnRegistered (const PString &domain,
115
 
                     const PString &username,
116
 
                     BOOL wasRegistering);
117
 
  
118
 
  
119
 
  /* DESCRIPTION  :  Called when the registration fails.
120
 
   * BEHAVIOR     :  Displays a message in the status bar and history. 
121
 
   * PRE          :  /
122
 
   */
123
 
  void OnRegistrationFailed (const PString &host,
124
 
                             const PString &user,
125
 
                             SIP_PDU::StatusCodes reason,
126
 
                             BOOL wasRegistering);
127
 
  
128
 
  
129
 
  /* DESCRIPTION  :  Called when there is an incoming SIP connection.
130
 
   * BEHAVIOR     :  Checks if the connection must be rejected or forwarded
131
 
   *                 and call the manager function of the same name
132
 
   *                 to update the GUI and take the appropriate action
133
 
   *                 on the connection. If the connection is not forwarded,
134
 
   *                 or rejected, OnShowIncoming will be called on the PCSS
135
 
   *                 endpoint, allowing to auto-answer the call or do further
136
 
   *                 updates of the GUI and internal timers.
137
 
   * PRE          :  /
138
 
   */
139
 
  BOOL OnIncomingConnection (OpalConnection &connection);
140
 
 
141
 
 
142
 
  /* DESCRIPTION  :  Called when there is a MWI.
143
 
   * BEHAVIOR     :  /
144
 
   * PRE          :  /
145
 
   */
146
 
  void OnMWIReceived (const PString & remoteAddress,
147
 
                      const PString & user,
148
 
                      SIPMWISubscribe::MWIType type,
149
 
                      const PString & msgs);
150
 
 
151
 
  
152
 
  /* DESCRIPTION  :  Called when a message has been received.
153
 
   * BEHAVIOR     :  Checks if we already received the message and call
154
 
   *                 OnMessageReceived.
155
 
   * PRE          :  /
156
 
   */
157
 
  virtual void OnReceivedMESSAGE (OpalTransport & transport,
158
 
                                  SIP_PDU & pdu);
159
 
 
160
 
  
161
 
  /* DESCRIPTION  :  Called when a message has been received.
162
 
   * BEHAVIOR     :  Updates the text chat window, updates the tray icon in
163
 
   *                 flashing state if the text chat window is hidden.
164
 
   * PRE          :  /
165
 
   */
166
 
  void OnMessageReceived (const SIPURL & from,
167
 
                          const PString & body);
168
 
 
169
 
 
170
 
  /* DESCRIPTION  :  Called when sending a message fails. 
171
 
   * BEHAVIOR     :  /
172
 
   * PRE          :  /
173
 
   */
174
 
  void OnMessageFailed (const SIPURL & messageUrl,
175
 
                        SIP_PDU::StatusCodes reason);
176
 
      
177
 
 
178
 
  /* DESCRIPTION  :  / 
179
 
   * BEHAVIOR     :  Returns the number of registered accounts.
180
 
   * PRE          :  /
181
 
   */
182
 
  int GetRegisteredAccounts ();
183
 
 
184
 
 
185
 
  /* DESCRIPTION  :  / 
186
 
   * BEHAVIOR     :  Returns the account to use for outgoing PDU's.
187
 
   * PRE          :  /
188
 
   */
189
 
  SIPURL GetRegisteredPartyName (const PString & host);
190
 
 
191
 
 
192
 
  /* DESCRIPTION  :  This callback is called when the connection is 
193
 
   *                 established and everything is ok.
194
 
   * BEHAVIOR     :  Stops the timers.
195
 
   * PRE          :  /
196
 
   */
197
 
  void OnEstablished (OpalConnection &);
198
 
 
199
 
  
200
 
  /* DESCRIPTION  :  This callback is called when a connection to a remote
201
 
   *                 endpoint is cleared.
202
 
   * BEHAVIOR     :  Stops the timers.
203
 
   * PRE          :  /
204
 
   */
205
 
  void OnReleased (OpalConnection &);
206
 
  
207
 
  
208
 
 private:
209
 
  
210
 
  /* DESCRIPTION  :  Notifier called when an incoming call
211
 
   *                 has not been answered in the required time.
212
 
   * BEHAVIOR     :  Reject the call, or forward if forward on no answer is
213
 
   *                 enabled in the config database.
214
 
   * PRE          :  /
215
 
   */
216
 
  PDECLARE_NOTIFIER(PTimer, GMSIPEndpoint, OnNoAnswerTimeout);
217
 
 
218
 
  PTimer NoAnswerTimer;
219
 
 
220
 
  GMManager & endpoint;
221
 
 
222
 
  PMutex msgDataMutex;
223
 
  msgDict msgData;
224
 
};
225
 
 
226
 
#endif