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  * $Log: svcctrl.h,v $
00026  * Revision 2.1  2004/02/19 10:46:44  rjongbloed
00027  * Merged OpenH323 version 1.13.1 changes.
00028  *
00029  * Revision 1.1  2003/04/01 01:07:22  robertj
00030  * Split service control handlers from H.225 RAS header.
00031  *
00032  */
00033 
00034 #ifndef __OPAL_SVCCTRL_H
00035 #define __OPAL_SVCCTRL_H
00036 
00037 #ifdef P_USE_PRAGMA
00038 #pragma interface
00039 #endif
00040 
00041 
00042 class H225_ServiceControlDescriptor;
00043 class H225_ServiceControlIndication;
00044 class H225_ServiceControlResponse;
00045 
00046 class H248_SignalsDescriptor;
00047 class H248_SignalRequest;
00048 
00049 class H323EndPoint;
00050 class H323Connection;
00051 
00052 
00054 
00058 class H323ServiceControlSession : public PObject
00059 {
00060     PCLASSINFO(H323ServiceControlSession, PObject);
00061   public:
00066     H323ServiceControlSession();
00068 
00076     virtual BOOL IsValid() const = 0;
00077 
00085     virtual PString GetServiceControlType() const;
00086 
00094     virtual BOOL OnReceivedPDU(
00095       const H225_ServiceControlDescriptor & descriptor
00096     ) = 0;
00097 
00105     virtual BOOL OnSendingPDU(
00106       H225_ServiceControlDescriptor & descriptor
00107     ) const = 0;
00108 
00109     enum ChangeType {
00110       OpenSession,    // H225_ServiceControlSession_reason::e_open
00111       RefreshSession, // H225_ServiceControlSession_reason::e_refresh
00112       CloseSession    // H225_ServiceControlSession_reason::e_close
00113     };
00114 
00119     virtual void OnChange(
00120       unsigned type,
00121       unsigned sessionId,
00122       H323EndPoint & endpoint,
00123       H323Connection * connection
00124     ) const = 0;
00126 };
00127 
00128 
00132 class H323HTTPServiceControl : public H323ServiceControlSession
00133 {
00134     PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00135   public:
00140     H323HTTPServiceControl(
00141       const PString & url
00142     );
00143 
00146     H323HTTPServiceControl(
00147       const H225_ServiceControlDescriptor & contents
00148     );
00150 
00158     virtual BOOL IsValid() const;
00159 
00167     virtual PString GetServiceControlType() const;
00168 
00174     virtual BOOL OnReceivedPDU(
00175       const H225_ServiceControlDescriptor & contents
00176     );
00177 
00183     virtual BOOL OnSendingPDU(
00184       H225_ServiceControlDescriptor & contents
00185     ) const;
00186 
00191     virtual void OnChange(
00192       unsigned type,
00193       unsigned sessionId,
00194       H323EndPoint & endpoint,
00195       H323Connection * connection
00196     ) const;
00198 
00199   protected:
00200     PString url;
00201 };
00202 
00203 
00206 class H323H248ServiceControl : public H323ServiceControlSession
00207 {
00208     PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00209   public:
00214     H323H248ServiceControl();
00215 
00218     H323H248ServiceControl(
00219       const H225_ServiceControlDescriptor & contents
00220     );
00222 
00231     virtual BOOL OnReceivedPDU(
00232       const H225_ServiceControlDescriptor & contents
00233     );
00234 
00241     virtual BOOL OnSendingPDU(
00242       H225_ServiceControlDescriptor & contents
00243     ) const;
00244 
00251     virtual BOOL OnReceivedPDU(
00252       const H248_SignalsDescriptor & descriptor
00253     );
00254 
00261     virtual BOOL OnSendingPDU(
00262       H248_SignalsDescriptor & descriptor
00263     ) const;
00264 
00270     virtual BOOL OnReceivedPDU(
00271       const H248_SignalRequest & request
00272     ) = 0;
00273 
00279     virtual BOOL OnSendingPDU(
00280       H248_SignalRequest & request
00281     ) const = 0;
00283 };
00284 
00285 
00288 class H323CallCreditServiceControl : public H323ServiceControlSession
00289 {
00290     PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00291   public:
00296     H323CallCreditServiceControl(
00297       const PString & amount,
00298       BOOL mode,
00299       unsigned duration = 0
00300     );
00301 
00304     H323CallCreditServiceControl(
00305       const H225_ServiceControlDescriptor & contents
00306     );
00308 
00316     virtual BOOL IsValid() const;
00317 
00323     virtual BOOL OnReceivedPDU(
00324       const H225_ServiceControlDescriptor & contents
00325     );
00326 
00332     virtual BOOL OnSendingPDU(
00333       H225_ServiceControlDescriptor & contents
00334     ) const;
00335 
00341     virtual void OnChange(
00342       unsigned type,
00343       unsigned sessionId,
00344       H323EndPoint & endpoint,
00345       H323Connection * connection
00346     ) const;
00348 
00349   protected:
00350     PString  amount;
00351     BOOL     mode;
00352     unsigned durationLimit;
00353 };
00354 
00355 
00356 #endif // __OPAL_SVCCTRL_H
00357 
00358 

Generated on Fri Mar 7 06:33:41 2008 for OPAL by  doxygen 1.5.1