OPAL  Version 3.18.8
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 
26 #ifndef OPAL_H323_SVCCTRL_H
27 #define OPAL_H323_SVCCTRL_H
28 
29 #ifdef P_USE_PRAGMA
30 #pragma interface
31 #endif
32 
33 #include <opal_config.h>
34 
35 #if OPAL_H323
36 
37 class H225_ServiceControlDescriptor;
38 class H225_ServiceControlIndication;
39 class H225_ServiceControlResponse;
40 
41 class H248_SignalsDescriptor;
42 class H248_SignalRequest;
43 
44 class H323EndPoint;
45 class H323Connection;
46 
47 
49 
53 class H323ServiceControlSession : public PObject
54 {
55  PCLASSINFO(H323ServiceControlSession, PObject);
56  public:
63 
71  virtual PBoolean IsValid() const = 0;
72 
80  virtual PString GetServiceControlType() const;
81 
89  virtual PBoolean OnReceivedPDU(
90  const H225_ServiceControlDescriptor & descriptor
91  ) = 0;
92 
100  virtual PBoolean OnSendingPDU(
101  H225_ServiceControlDescriptor & descriptor
102  ) const = 0;
103 
104  enum ChangeType {
105  OpenSession, // H225_ServiceControlSession_reason::e_open
106  RefreshSession, // H225_ServiceControlSession_reason::e_refresh
107  CloseSession // H225_ServiceControlSession_reason::e_close
108  };
109 
114  virtual void OnChange(
115  unsigned type,
116  unsigned sessionId,
117  H323EndPoint & endpoint,
118  H323Connection * connection
119  ) const = 0;
121 };
122 
123 
128 {
130  public:
136  const PString & url
137  );
138 
142  const H225_ServiceControlDescriptor & contents
143  );
145 
153  virtual PBoolean IsValid() const;
154 
162  virtual PString GetServiceControlType() const;
163 
169  virtual PBoolean OnReceivedPDU(
170  const H225_ServiceControlDescriptor & contents
171  );
172 
178  virtual PBoolean OnSendingPDU(
179  H225_ServiceControlDescriptor & contents
180  ) const;
181 
186  virtual void OnChange(
187  unsigned type,
188  unsigned sessionId,
189  H323EndPoint & endpoint,
190  H323Connection * connection
191  ) const;
193 
194  protected:
195  PString url;
196 };
197 
198 
202 {
204  public:
210 
214  const H225_ServiceControlDescriptor & contents
215  );
217 
226  virtual PBoolean OnReceivedPDU(
227  const H225_ServiceControlDescriptor & contents
228  );
229 
236  virtual PBoolean OnSendingPDU(
237  H225_ServiceControlDescriptor & contents
238  ) const;
239 
246  virtual PBoolean OnReceivedPDU(
247  const H248_SignalsDescriptor & descriptor
248  );
249 
256  virtual PBoolean OnSendingPDU(
257  H248_SignalsDescriptor & descriptor
258  ) const;
259 
265  virtual PBoolean OnReceivedPDU(
266  const H248_SignalRequest & request
267  ) = 0;
268 
274  virtual PBoolean OnSendingPDU(
275  H248_SignalRequest & request
276  ) const = 0;
278 };
279 
280 
284 {
286  public:
292  const PString & amount,
293  PBoolean mode,
294  unsigned duration = 0
295  );
296 
300  const H225_ServiceControlDescriptor & contents
301  );
303 
311  virtual PBoolean IsValid() const;
312 
318  virtual PBoolean OnReceivedPDU(
319  const H225_ServiceControlDescriptor & contents
320  );
321 
327  virtual PBoolean OnSendingPDU(
328  H225_ServiceControlDescriptor & contents
329  ) const;
330 
336  virtual void OnChange(
337  unsigned type,
338  unsigned sessionId,
339  H323EndPoint & endpoint,
340  H323Connection * connection
341  ) const;
343 
346  const PString & GetAmount() const { return amount; }
348 
350  bool GetMode() const { return mode; }
351 
353  unsigned GetDurationLimit() const { return durationLimit; }
355 
356  protected:
357  PString amount;
358  bool mode;
359  unsigned durationLimit;
360 };
361 
362 
363 #endif // OPAL_H323
364 
365 #endif // OPAL_H323_SVCCTRL_H
366 
367 
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
Definition: svcctrl.h:201
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const
ChangeType
Definition: svcctrl.h:104
PString amount
Definition: svcctrl.h:357
virtual PString GetServiceControlType() const
H323CallCreditServiceControl(const PString &amount, PBoolean mode, unsigned duration=0)
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
H323HTTPServiceControl(const PString &url)
PString url
Definition: svcctrl.h:195
virtual PString GetServiceControlType() const
bool mode
Definition: svcctrl.h:358
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
bool GetMode() const
Return the mode of operation.
Definition: svcctrl.h:350
virtual PBoolean IsValid() const
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const
virtual PBoolean IsValid() const =0
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &descriptor)=0
Definition: svcctrl.h:53
const PString & GetAmount() const
Return the amount string.
Definition: svcctrl.h:347
Definition: h323con.h:137
unsigned durationLimit
Definition: svcctrl.h:359
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &descriptor) const =0
unsigned GetDurationLimit() const
Return the duration limit.
Definition: svcctrl.h:353
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
Definition: svcctrl.h:127
Definition: svcctrl.h:283
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
Definition: h323ep.h:82
virtual PBoolean IsValid() const
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const =0