OPAL Version 3.10.4

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- File List
- Globals

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: 24178 $
26 * $Author: rjongbloed $
27 * $Date: 2010-04-05 19:10:56 -0500 (Mon, 05 Apr 2010) $
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/buildopts.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:
65 H323ServiceControlSession();
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
131 class H323HTTPServiceControl : public H323ServiceControlSession
132 {
133 PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
134 public:
139 H323HTTPServiceControl(
140 const PString & url
141 );
142
145 H323HTTPServiceControl(
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
205 class H323H248ServiceControl : public H323ServiceControlSession
206 {
207 PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
208 public:
213 H323H248ServiceControl();
214
217 H323H248ServiceControl(
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
287 class H323CallCreditServiceControl : public H323ServiceControlSession
288 {
289 PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
290 public:
295 H323CallCreditServiceControl(
296 const PString & amount,
297 PBoolean mode,
298 unsigned duration = 0
299 );
300
303 H323CallCreditServiceControl(
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