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 1.2  2006/05/16 11:37:11  shorne
00027  * Added ability to detect type of service control
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;
00125 
00126     enum serviceType {
00127        e_URL,
00128        e_Signal,
00129        e_NonStandard,
00130        e_CallCredit
00131      };
00132 
00133      virtual serviceType GetType() = 0;
00135 };
00136 
00137 
00141 class H323HTTPServiceControl : public H323ServiceControlSession
00142 {
00143     PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00144   public:
00149     H323HTTPServiceControl(
00150       const PString & url
00151     );
00152 
00155     H323HTTPServiceControl(
00156       const H225_ServiceControlDescriptor & contents
00157     );
00159 
00167     virtual BOOL IsValid() const;
00168 
00176     virtual PString GetServiceControlType() const;
00177 
00183     virtual BOOL OnReceivedPDU(
00184       const H225_ServiceControlDescriptor & contents
00185     );
00186 
00192     virtual BOOL OnSendingPDU(
00193       H225_ServiceControlDescriptor & contents
00194     ) const;
00195 
00200     virtual void OnChange(
00201       unsigned type,
00202       unsigned sessionId,
00203       H323EndPoint & endpoint,
00204       H323Connection * connection
00205     ) const;
00206 
00207     serviceType GetType() { return e_URL; };
00208 
00209     void GetValue(PString & _url) { _url = url; }
00211 
00212   protected:
00213     PString url;
00214 };
00215 
00216 
00219 class H323H248ServiceControl : public H323ServiceControlSession
00220 {
00221     PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00222   public:
00227     H323H248ServiceControl();
00228 
00231     H323H248ServiceControl(
00232       const H225_ServiceControlDescriptor & contents
00233     );
00235 
00244     virtual BOOL OnReceivedPDU(
00245       const H225_ServiceControlDescriptor & contents
00246     );
00247 
00254     virtual BOOL OnSendingPDU(
00255       H225_ServiceControlDescriptor & contents
00256     ) const;
00257 
00264     virtual BOOL OnReceivedPDU(
00265       const H248_SignalsDescriptor & descriptor
00266     );
00267 
00274     virtual BOOL OnSendingPDU(
00275       H248_SignalsDescriptor & descriptor
00276     ) const;
00277 
00283     virtual BOOL OnReceivedPDU(
00284       const H248_SignalRequest & request
00285     ) = 0;
00286 
00292     virtual BOOL OnSendingPDU(
00293       H248_SignalRequest & request
00294     ) const = 0;
00295 
00296     serviceType GetType() { return e_Signal; };
00298 };
00299 
00300 
00303 class H323CallCreditServiceControl : public H323ServiceControlSession
00304 {
00305     PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00306   public:
00311     H323CallCreditServiceControl(
00312       const PString & amount,
00313       BOOL mode,
00314       unsigned duration = 0
00315     );
00316 
00319     H323CallCreditServiceControl(
00320       const H225_ServiceControlDescriptor & contents
00321     );
00323 
00331     virtual BOOL IsValid() const;
00332 
00338     virtual BOOL OnReceivedPDU(
00339       const H225_ServiceControlDescriptor & contents
00340     );
00341 
00347     virtual BOOL OnSendingPDU(
00348       H225_ServiceControlDescriptor & contents
00349     ) const;
00350 
00356     virtual void OnChange(
00357       unsigned type,
00358       unsigned sessionId,
00359       H323EndPoint & endpoint,
00360       H323Connection * connection
00361     ) const;
00362 
00363     serviceType GetType() { return e_CallCredit; };
00364 
00365     void GetValue(PString & _amount,BOOL & _credit, unsigned & _time)
00366         { _amount = amount; _credit = mode; _time = durationLimit;}
00368 
00369   protected:
00370     PString  amount;
00371     BOOL     mode;
00372     unsigned durationLimit;
00373 };
00374 
00375 
00376 #endif // __OPAL_SVCCTRL_H
00377 
00378 

Generated on Wed Feb 6 09:02:45 2008 for OpenH323 by  doxygen 1.5.4