OPAL  Version 3.14.3
svcctrl.h
Go to the documentation of this file.
1 /*
2  * svcctrl.h
3  *
4  * H.225 Service Control protocol handler
5  *
6  * Open H323 Library
7  *
8  * Copyright (c) 2003 Equivalence Pty. Ltd.
9  *
10  * The contents of this file are subject to the Mozilla Public License
11  * Version 1.0 (the "License"); you may not use this file except in
12  * compliance with the License. You may obtain a copy of the License at
13  * http://www.mozilla.org/MPL/
14  *
15  * Software distributed under the License is distributed on an "AS IS"
16  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
17  * the License for the specific language governing rights and limitations
18  * under the License.
19  *
20  * The Original Code is Open H323 Library.
21  *
22  * The Initial Developer of the Original Code is Equivalence Pty. Ltd.
23  * Contributor(s): ______________________________________.
24  *
25  * $Revision: 29536 $
26  * $Author: rjongbloed $
27  * $Date: 2013-04-19 18:55:15 +1000 (Fri, 19 Apr 2013) $
28  */
29 
30 #ifndef OPAL_H323_SVCCTRL_H
31 #define OPAL_H323_SVCCTRL_H
32 
33 #ifdef P_USE_PRAGMA
34 #pragma interface
35 #endif
36 
37 #include <opal_config.h>
38 
39 #if OPAL_H323
40 
41 class H225_ServiceControlDescriptor;
42 class H225_ServiceControlIndication;
43 class H225_ServiceControlResponse;
44 
45 class H248_SignalsDescriptor;
46 class H248_SignalRequest;
47 
48 class H323EndPoint;
49 class H323Connection;
50 
51 
53 
57 class H323ServiceControlSession : public PObject
58 {
59  PCLASSINFO(H323ServiceControlSession, PObject);
60  public:
67 
75  virtual PBoolean IsValid() const = 0;
76 
84  virtual PString GetServiceControlType() const;
85 
93  virtual PBoolean OnReceivedPDU(
94  const H225_ServiceControlDescriptor & descriptor
95  ) = 0;
96 
104  virtual PBoolean OnSendingPDU(
105  H225_ServiceControlDescriptor & descriptor
106  ) const = 0;
107 
108  enum ChangeType {
109  OpenSession, // H225_ServiceControlSession_reason::e_open
110  RefreshSession, // H225_ServiceControlSession_reason::e_refresh
111  CloseSession // H225_ServiceControlSession_reason::e_close
112  };
113 
118  virtual void OnChange(
119  unsigned type,
120  unsigned sessionId,
121  H323EndPoint & endpoint,
122  H323Connection * connection
123  ) const = 0;
125 };
126 
127 
132 {
134  public:
140  const PString & url
141  );
142 
146  const H225_ServiceControlDescriptor & contents
147  );
149 
157  virtual PBoolean IsValid() const;
158 
166  virtual PString GetServiceControlType() const;
167 
173  virtual PBoolean OnReceivedPDU(
174  const H225_ServiceControlDescriptor & contents
175  );
176 
182  virtual PBoolean OnSendingPDU(
183  H225_ServiceControlDescriptor & contents
184  ) const;
185 
190  virtual void OnChange(
191  unsigned type,
192  unsigned sessionId,
193  H323EndPoint & endpoint,
194  H323Connection * connection
195  ) const;
197 
198  protected:
199  PString url;
200 };
201 
202 
206 {
208  public:
214 
218  const H225_ServiceControlDescriptor & contents
219  );
221 
230  virtual PBoolean OnReceivedPDU(
231  const H225_ServiceControlDescriptor & contents
232  );
233 
240  virtual PBoolean OnSendingPDU(
241  H225_ServiceControlDescriptor & contents
242  ) const;
243 
250  virtual PBoolean OnReceivedPDU(
251  const H248_SignalsDescriptor & descriptor
252  );
253 
260  virtual PBoolean OnSendingPDU(
261  H248_SignalsDescriptor & descriptor
262  ) const;
263 
269  virtual PBoolean OnReceivedPDU(
270  const H248_SignalRequest & request
271  ) = 0;
272 
278  virtual PBoolean OnSendingPDU(
279  H248_SignalRequest & request
280  ) const = 0;
282 };
283 
284 
288 {
290  public:
296  const PString & amount,
297  PBoolean mode,
298  unsigned duration = 0
299  );
300 
304  const H225_ServiceControlDescriptor & contents
305  );
307 
315  virtual PBoolean IsValid() const;
316 
322  virtual PBoolean OnReceivedPDU(
323  const H225_ServiceControlDescriptor & contents
324  );
325 
331  virtual PBoolean OnSendingPDU(
332  H225_ServiceControlDescriptor & contents
333  ) const;
334 
340  virtual void OnChange(
341  unsigned type,
342  unsigned sessionId,
343  H323EndPoint & endpoint,
344  H323Connection * connection
345  ) const;
347 
350 
351  const PString & GetAmount() const { return amount; }
352 
354  bool GetMode() const { return mode; }
355 
357  unsigned GetDurationLimit() const { return durationLimit; }
359 
360  protected:
361  PString amount;
362  bool mode;
363  unsigned durationLimit;
364 };
365 
366 
367 #endif // OPAL_H323
368 
369 #endif // OPAL_H323_SVCCTRL_H
370 
371