OpenH323 1.18.0
|
00001 /* 00002 * svcctrl.h 00003 * 00004 * H.225 Service Control protocol handler 00005 * 00006 * Open H323 Library 00007 * 00008 * Copyright (c) 2003 Equivalence Pty. Ltd. 00009 * 00010 * The contents of this file are subject to the Mozilla Public License 00011 * Version 1.0 (the "License"); you may not use this file except in 00012 * compliance with the License. You may obtain a copy of the License at 00013 * http://www.mozilla.org/MPL/ 00014 * 00015 * Software distributed under the License is distributed on an "AS IS" 00016 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00017 * the License for the specific language governing rights and limitations 00018 * under the License. 00019 * 00020 * The Original Code is Open H323 Library. 00021 * 00022 * The Initial Developer of the Original Code is Equivalence Pty. Ltd. 00023 * Contributor(s): ______________________________________. 00024 * 00025 * $Log: svcctrl.h,v $ 00026 * Revision 1.1 2003/04/01 01:07:22 robertj 00027 * Split service control handlers from H.225 RAS header. 00028 * 00029 */ 00030 00031 #ifndef __OPAL_SVCCTRL_H 00032 #define __OPAL_SVCCTRL_H 00033 00034 #ifdef P_USE_PRAGMA 00035 #pragma interface 00036 #endif 00037 00038 00039 class H225_ServiceControlDescriptor; 00040 class H225_ServiceControlIndication; 00041 class H225_ServiceControlResponse; 00042 00043 class H248_SignalsDescriptor; 00044 class H248_SignalRequest; 00045 00046 class H323EndPoint; 00047 class H323Connection; 00048 00049 00051 00055 class H323ServiceControlSession : public PObject 00056 { 00057 PCLASSINFO(H323ServiceControlSession, PObject); 00058 public: 00063 H323ServiceControlSession(); 00065 00073 virtual BOOL IsValid() const = 0; 00074 00082 virtual PString GetServiceControlType() const; 00083 00091 virtual BOOL OnReceivedPDU( 00092 const H225_ServiceControlDescriptor & descriptor 00093 ) = 0; 00094 00102 virtual BOOL OnSendingPDU( 00103 H225_ServiceControlDescriptor & descriptor 00104 ) const = 0; 00105 00106 enum ChangeType { 00107 OpenSession, // H225_ServiceControlSession_reason::e_open 00108 RefreshSession, // H225_ServiceControlSession_reason::e_refresh 00109 CloseSession // H225_ServiceControlSession_reason::e_close 00110 }; 00111 00116 virtual void OnChange( 00117 unsigned type, 00118 unsigned sessionId, 00119 H323EndPoint & endpoint, 00120 H323Connection * connection 00121 ) const = 0; 00123 }; 00124 00125 00129 class H323HTTPServiceControl : public H323ServiceControlSession 00130 { 00131 PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession); 00132 public: 00137 H323HTTPServiceControl( 00138 const PString & url 00139 ); 00140 00143 H323HTTPServiceControl( 00144 const H225_ServiceControlDescriptor & contents 00145 ); 00147 00155 virtual BOOL IsValid() const; 00156 00164 virtual PString GetServiceControlType() const; 00165 00171 virtual BOOL OnReceivedPDU( 00172 const H225_ServiceControlDescriptor & contents 00173 ); 00174 00180 virtual BOOL OnSendingPDU( 00181 H225_ServiceControlDescriptor & contents 00182 ) const; 00183 00188 virtual void OnChange( 00189 unsigned type, 00190 unsigned sessionId, 00191 H323EndPoint & endpoint, 00192 H323Connection * connection 00193 ) const; 00195 00196 protected: 00197 PString url; 00198 }; 00199 00200 00203 class H323H248ServiceControl : public H323ServiceControlSession 00204 { 00205 PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession); 00206 public: 00211 H323H248ServiceControl(); 00212 00215 H323H248ServiceControl( 00216 const H225_ServiceControlDescriptor & contents 00217 ); 00219 00228 virtual BOOL OnReceivedPDU( 00229 const H225_ServiceControlDescriptor & contents 00230 ); 00231 00238 virtual BOOL OnSendingPDU( 00239 H225_ServiceControlDescriptor & contents 00240 ) const; 00241 00248 virtual BOOL OnReceivedPDU( 00249 const H248_SignalsDescriptor & descriptor 00250 ); 00251 00258 virtual BOOL OnSendingPDU( 00259 H248_SignalsDescriptor & descriptor 00260 ) const; 00261 00267 virtual BOOL OnReceivedPDU( 00268 const H248_SignalRequest & request 00269 ) = 0; 00270 00276 virtual BOOL OnSendingPDU( 00277 H248_SignalRequest & request 00278 ) const = 0; 00280 }; 00281 00282 00285 class H323CallCreditServiceControl : public H323ServiceControlSession 00286 { 00287 PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession); 00288 public: 00293 H323CallCreditServiceControl( 00294 const PString & amount, 00295 BOOL mode, 00296 unsigned duration = 0 00297 ); 00298 00301 H323CallCreditServiceControl( 00302 const H225_ServiceControlDescriptor & contents 00303 ); 00305 00313 virtual BOOL IsValid() const; 00314 00320 virtual BOOL OnReceivedPDU( 00321 const H225_ServiceControlDescriptor & contents 00322 ); 00323 00329 virtual BOOL OnSendingPDU( 00330 H225_ServiceControlDescriptor & contents 00331 ) const; 00332 00338 virtual void OnChange( 00339 unsigned type, 00340 unsigned sessionId, 00341 H323EndPoint & endpoint, 00342 H323Connection * connection 00343 ) const; 00345 00346 protected: 00347 PString amount; 00348 BOOL mode; 00349 unsigned durationLimit; 00350 }; 00351 00352 00353 #endif // __OPAL_SVCCTRL_H 00354 00355