svcctrl.h

Go to the documentation of this file.
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  * $Revision: 19279 $
00026  * $Author: rjongbloed $
00027  * $Date: 2008-01-17 04:08:34 +0000 (Thu, 17 Jan 2008) $
00028  */
00029 
00030 #ifndef __OPAL_SVCCTRL_H
00031 #define __OPAL_SVCCTRL_H
00032 
00033 #ifdef P_USE_PRAGMA
00034 #pragma interface
00035 #endif
00036 
00037 
00038 class H225_ServiceControlDescriptor;
00039 class H225_ServiceControlIndication;
00040 class H225_ServiceControlResponse;
00041 
00042 class H248_SignalsDescriptor;
00043 class H248_SignalRequest;
00044 
00045 class H323EndPoint;
00046 class H323Connection;
00047 
00048 
00050 
00054 class H323ServiceControlSession : public PObject
00055 {
00056     PCLASSINFO(H323ServiceControlSession, PObject);
00057   public:
00062     H323ServiceControlSession();
00064 
00072     virtual PBoolean IsValid() const = 0;
00073 
00081     virtual PString GetServiceControlType() const;
00082 
00090     virtual PBoolean OnReceivedPDU(
00091       const H225_ServiceControlDescriptor & descriptor
00092     ) = 0;
00093 
00101     virtual PBoolean OnSendingPDU(
00102       H225_ServiceControlDescriptor & descriptor
00103     ) const = 0;
00104 
00105     enum ChangeType {
00106       OpenSession,    // H225_ServiceControlSession_reason::e_open
00107       RefreshSession, // H225_ServiceControlSession_reason::e_refresh
00108       CloseSession    // H225_ServiceControlSession_reason::e_close
00109     };
00110 
00115     virtual void OnChange(
00116       unsigned type,
00117       unsigned sessionId,
00118       H323EndPoint & endpoint,
00119       H323Connection * connection
00120     ) const = 0;
00122 };
00123 
00124 
00128 class H323HTTPServiceControl : public H323ServiceControlSession
00129 {
00130     PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00131   public:
00136     H323HTTPServiceControl(
00137       const PString & url
00138     );
00139 
00142     H323HTTPServiceControl(
00143       const H225_ServiceControlDescriptor & contents
00144     );
00146 
00154     virtual PBoolean IsValid() const;
00155 
00163     virtual PString GetServiceControlType() const;
00164 
00170     virtual PBoolean OnReceivedPDU(
00171       const H225_ServiceControlDescriptor & contents
00172     );
00173 
00179     virtual PBoolean OnSendingPDU(
00180       H225_ServiceControlDescriptor & contents
00181     ) const;
00182 
00187     virtual void OnChange(
00188       unsigned type,
00189       unsigned sessionId,
00190       H323EndPoint & endpoint,
00191       H323Connection * connection
00192     ) const;
00194 
00195   protected:
00196     PString url;
00197 };
00198 
00199 
00202 class H323H248ServiceControl : public H323ServiceControlSession
00203 {
00204     PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00205   public:
00210     H323H248ServiceControl();
00211 
00214     H323H248ServiceControl(
00215       const H225_ServiceControlDescriptor & contents
00216     );
00218 
00227     virtual PBoolean OnReceivedPDU(
00228       const H225_ServiceControlDescriptor & contents
00229     );
00230 
00237     virtual PBoolean OnSendingPDU(
00238       H225_ServiceControlDescriptor & contents
00239     ) const;
00240 
00247     virtual PBoolean OnReceivedPDU(
00248       const H248_SignalsDescriptor & descriptor
00249     );
00250 
00257     virtual PBoolean OnSendingPDU(
00258       H248_SignalsDescriptor & descriptor
00259     ) const;
00260 
00266     virtual PBoolean OnReceivedPDU(
00267       const H248_SignalRequest & request
00268     ) = 0;
00269 
00275     virtual PBoolean OnSendingPDU(
00276       H248_SignalRequest & request
00277     ) const = 0;
00279 };
00280 
00281 
00284 class H323CallCreditServiceControl : public H323ServiceControlSession
00285 {
00286     PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00287   public:
00292     H323CallCreditServiceControl(
00293       const PString & amount,
00294       PBoolean mode,
00295       unsigned duration = 0
00296     );
00297 
00300     H323CallCreditServiceControl(
00301       const H225_ServiceControlDescriptor & contents
00302     );
00304 
00312     virtual PBoolean IsValid() const;
00313 
00319     virtual PBoolean OnReceivedPDU(
00320       const H225_ServiceControlDescriptor & contents
00321     );
00322 
00328     virtual PBoolean OnSendingPDU(
00329       H225_ServiceControlDescriptor & contents
00330     ) const;
00331 
00337     virtual void OnChange(
00338       unsigned type,
00339       unsigned sessionId,
00340       H323EndPoint & endpoint,
00341       H323Connection * connection
00342     ) const;
00344 
00345   protected:
00346     PString  amount;
00347     PBoolean     mode;
00348     unsigned durationLimit;
00349 };
00350 
00351 
00352 #endif // __OPAL_SVCCTRL_H
00353 
00354 

Generated on Mon Sep 15 11:49:15 2008 for OPAL by  doxygen 1.5.1