D:/Storage/CVS_Head/h323plus/include/svcctrl.h

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  2007/08/07 22:25:46  shorne
00027  * update for H323_H350
00028  *
00029  * Revision 1.1  2007/08/06 20:50:50  shorne
00030  * First commit of h323plus
00031  *
00032  * Revision 1.2.2.1  2007/07/20 22:03:26  shorne
00033  * Initial H.350 Support
00034  *
00035  * Revision 1.2  2006/05/16 11:37:11  shorne
00036  * Added ability to detect type of service control
00037  *
00038  * Revision 1.1  2003/04/01 01:07:22  robertj
00039  * Split service control handlers from H.225 RAS header.
00040  *
00041  */
00042 
00043 #ifndef __OPAL_SVCCTRL_H
00044 #define __OPAL_SVCCTRL_H
00045 
00046 #ifdef P_USE_PRAGMA
00047 #pragma interface
00048 #endif
00049 
00050 
00051 class H225_ServiceControlDescriptor;
00052 class H225_ServiceControlIndication;
00053 class H225_ServiceControlResponse;
00054 
00055 class H248_SignalsDescriptor;
00056 class H248_SignalRequest;
00057 
00058 class H323EndPoint;
00059 class H323Connection;
00060 
00061 
00063 
00067 class H323ServiceControlSession : public PObject
00068 {
00069     PCLASSINFO(H323ServiceControlSession, PObject);
00070   public:
00075     H323ServiceControlSession();
00077 
00085     virtual BOOL IsValid() const = 0;
00086 
00094     virtual PString GetServiceControlType() const;
00095 
00103     virtual BOOL OnReceivedPDU(
00104       const H225_ServiceControlDescriptor & descriptor
00105     ) = 0;
00106 
00114     virtual BOOL OnSendingPDU(
00115       H225_ServiceControlDescriptor & descriptor
00116     ) const = 0;
00117 
00118     enum ChangeType {
00119       OpenSession,    // H225_ServiceControlSession_reason::e_open
00120       RefreshSession, // H225_ServiceControlSession_reason::e_refresh
00121       CloseSession    // H225_ServiceControlSession_reason::e_close
00122     };
00123 
00128     virtual void OnChange(
00129       unsigned type,
00130       unsigned sessionId,
00131       H323EndPoint & endpoint,
00132       H323Connection * connection
00133     ) const = 0;
00134 
00135     enum serviceType {
00136        e_URL,
00137        e_Signal,
00138        e_NonStandard,
00139        e_CallCredit
00140      };
00141 
00142      virtual serviceType GetType() = 0;
00144 };
00145 
00146 
00150 class H323HTTPServiceControl : public H323ServiceControlSession
00151 {
00152     PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
00153   public:
00158     H323HTTPServiceControl(
00159       const PString & url
00160     );
00161 
00164     H323HTTPServiceControl(
00165       const H225_ServiceControlDescriptor & contents
00166     );
00168 
00176     virtual BOOL IsValid() const;
00177 
00185     virtual PString GetServiceControlType() const;
00186 
00192     virtual BOOL OnReceivedPDU(
00193       const H225_ServiceControlDescriptor & contents
00194     );
00195 
00201     virtual BOOL OnSendingPDU(
00202       H225_ServiceControlDescriptor & contents
00203     ) const;
00204 
00209     virtual void OnChange(
00210       unsigned type,
00211       unsigned sessionId,
00212       H323EndPoint & endpoint,
00213       H323Connection * connection
00214     ) const;
00215 
00216     serviceType GetType() { return e_URL; };
00217 
00218     void GetValue(PString & _url) { _url = url; }
00220 
00221   protected:
00222     PString url;
00223 };
00224 
00225 
00228 class H323H248ServiceControl : public H323ServiceControlSession
00229 {
00230     PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
00231   public:
00236     H323H248ServiceControl();
00237 
00240     H323H248ServiceControl(
00241       const H225_ServiceControlDescriptor & contents
00242     );
00244 
00253     virtual BOOL OnReceivedPDU(
00254       const H225_ServiceControlDescriptor & contents
00255     );
00256 
00263     virtual BOOL OnSendingPDU(
00264       H225_ServiceControlDescriptor & contents
00265     ) const;
00266 
00273     virtual BOOL OnReceivedPDU(
00274       const H248_SignalsDescriptor & descriptor
00275     );
00276 
00283     virtual BOOL OnSendingPDU(
00284       H248_SignalsDescriptor & descriptor
00285     ) const;
00286 
00292     virtual BOOL OnReceivedPDU(
00293       const H248_SignalRequest & request
00294     ) = 0;
00295 
00301     virtual BOOL OnSendingPDU(
00302       H248_SignalRequest & request
00303     ) const = 0;
00304 
00305     serviceType GetType() { return e_Signal; };
00307 };
00308 
00309 
00312 class H323CallCreditServiceControl : public H323ServiceControlSession
00313 {
00314     PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
00315   public:
00320     H323CallCreditServiceControl(
00321       const PString & amount,
00322       BOOL mode,
00323       unsigned duration = 0
00324     );
00325 
00328     H323CallCreditServiceControl(
00329       const H225_ServiceControlDescriptor & contents
00330     );
00332 
00340     virtual BOOL IsValid() const;
00341 
00347     virtual BOOL OnReceivedPDU(
00348       const H225_ServiceControlDescriptor & contents
00349     );
00350 
00356     virtual BOOL OnSendingPDU(
00357       H225_ServiceControlDescriptor & contents
00358     ) const;
00359 
00365     virtual void OnChange(
00366       unsigned type,
00367       unsigned sessionId,
00368       H323EndPoint & endpoint,
00369       H323Connection * connection
00370     ) const;
00371 
00372     serviceType GetType() { return e_CallCredit; };
00373 
00374     void GetValue(PString & _amount,BOOL & _credit, unsigned & _time)
00375         { _amount = amount; _credit = mode; _time = durationLimit;}
00377 
00378   protected:
00379     PString  amount;
00380     BOOL     mode;
00381     unsigned durationLimit;
00382 };
00383 
00384 
00385 #ifdef H323_H350
00386 
00389 class H323H350ServiceControl : public H323ServiceControlSession
00390 {
00391     PCLASSINFO(H323H350ServiceControl, H323ServiceControlSession);
00392   public:
00397     H323H350ServiceControl(
00398       const PString & _ldapURL, 
00399           const PString & _ldapDN
00400     );
00401 
00404     H323H350ServiceControl(
00405       const H225_ServiceControlDescriptor & contents
00406     );
00408 
00416     virtual BOOL IsValid() const;
00417 
00425     virtual PString GetServiceControlType() const;
00426 
00432     virtual BOOL OnReceivedPDU(
00433       const H225_ServiceControlDescriptor & contents
00434     );
00435 
00441     virtual BOOL OnSendingPDU(
00442       H225_ServiceControlDescriptor & contents
00443     ) const;
00444 
00449     virtual void OnChange(
00450       unsigned type,
00451       unsigned sessionId,
00452       H323EndPoint & endpoint,
00453       H323Connection * connection
00454     ) const;
00455 
00456     serviceType GetType() { return e_NonStandard; };
00457 
00458     void GetValue(PString & _ldapURL,PString & _ldapDN) 
00459               { _ldapURL = ldapURL; _ldapDN = ldapDN; }
00461 
00462   protected:
00463     PString ldapURL;
00464         PString ldapDN;
00465 };
00466 
00467 #endif
00468 
00469 
00470 #endif // __OPAL_SVCCTRL_H
00471 
00472 

Generated on Thu Oct 25 13:42:37 2007 for h323plus by  doxygen 1.5.2