# 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: 24178 $
    00026  * $Author: rjongbloed $
    00027  * $Date: 2010-04-05 19:10:56 -0500 (Mon, 05 Apr 2010) $
    00028  */
    00029
    00030 #ifndef OPAL_H323_SVCCTRL_H
    00031 #define OPAL_H323_SVCCTRL_H
    00032
    00033 #ifdef P_USE_PRAGMA
    00034 #pragma interface
    00035 #endif
    00036
    00037 #include <opal/buildopts.h>
    00038
    00039 #if OPAL_H323
    00040
    00041 class H225_ServiceControlDescriptor;
    00042 class H225_ServiceControlIndication;
    00043 class H225_ServiceControlResponse;
    00044
    00045 class H248_SignalsDescriptor;
    00046 class H248_SignalRequest;
    00047
    00048 class H323EndPoint;
    00049 class H323Connection;
    00050
    00051
    00053
    00057 class H323ServiceControlSession : public PObject
    00058 {
    00059     PCLASSINFO(H323ServiceControlSession, PObject);
    00060   public:
    00065     H323ServiceControlSession();
    00067
    00075     virtual PBoolean IsValid() const = 0;
    00076
    00084     virtual PString GetServiceControlType() const;
    00085
    00093     virtual PBoolean OnReceivedPDU(
    00094       const H225_ServiceControlDescriptor & descriptor
    00095     ) = 0;
    00096
    00104     virtual PBoolean OnSendingPDU(
    00105       H225_ServiceControlDescriptor & descriptor
    00106     ) const = 0;
    00107
    00108     enum ChangeType {
    00109       OpenSession,    // H225_ServiceControlSession_reason::e_open
    00110       RefreshSession, // H225_ServiceControlSession_reason::e_refresh
    00111       CloseSession    // H225_ServiceControlSession_reason::e_close
    00112     };
    00113
    00118     virtual void OnChange(
    00119       unsigned type,
    00120       unsigned sessionId,
    00121       H323EndPoint & endpoint,
    00122       H323Connection * connection
    00123     ) const = 0;
    00125 };
    00126
    00127
    00131 class H323HTTPServiceControl : public H323ServiceControlSession
    00132 {
    00133     PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
    00134   public:
    00139     H323HTTPServiceControl(
    00140       const PString & url
    00141     );
    00142
    00145     H323HTTPServiceControl(
    00146       const H225_ServiceControlDescriptor & contents
    00147     );
    00149
    00157     virtual PBoolean IsValid() const;
    00158
    00166     virtual PString GetServiceControlType() const;
    00167
    00173     virtual PBoolean OnReceivedPDU(
    00174       const H225_ServiceControlDescriptor & contents
    00175     );
    00176
    00182     virtual PBoolean OnSendingPDU(
    00183       H225_ServiceControlDescriptor & contents
    00184     ) const;
    00185
    00190     virtual void OnChange(
    00191       unsigned type,
    00192       unsigned sessionId,
    00193       H323EndPoint & endpoint,
    00194       H323Connection * connection
    00195     ) const;
    00197
    00198   protected:
    00199     PString url;
    00200 };
    00201
    00202
    00205 class H323H248ServiceControl : public H323ServiceControlSession
    00206 {
    00207     PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
    00208   public:
    00213     H323H248ServiceControl();
    00214
    00217     H323H248ServiceControl(
    00218       const H225_ServiceControlDescriptor & contents
    00219     );
    00221
    00230     virtual PBoolean OnReceivedPDU(
    00231       const H225_ServiceControlDescriptor & contents
    00232     );
    00233
    00240     virtual PBoolean OnSendingPDU(
    00241       H225_ServiceControlDescriptor & contents
    00242     ) const;
    00243
    00250     virtual PBoolean OnReceivedPDU(
    00251       const H248_SignalsDescriptor & descriptor
    00252     );
    00253
    00260     virtual PBoolean OnSendingPDU(
    00261       H248_SignalsDescriptor & descriptor
    00262     ) const;
    00263
    00269     virtual PBoolean OnReceivedPDU(
    00270       const H248_SignalRequest & request
    00271     ) = 0;
    00272
    00278     virtual PBoolean OnSendingPDU(
    00279       H248_SignalRequest & request
    00280     ) const = 0;
    00282 };
    00283
    00284
    00287 class H323CallCreditServiceControl : public H323ServiceControlSession
    00288 {
    00289     PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
    00290   public:
    00295     H323CallCreditServiceControl(
    00296       const PString & amount,
    00297       PBoolean mode,
    00298       unsigned duration = 0
    00299     );
    00300
    00303     H323CallCreditServiceControl(
    00304       const H225_ServiceControlDescriptor & contents
    00305     );
    00307
    00315     virtual PBoolean IsValid() const;
    00316
    00322     virtual PBoolean OnReceivedPDU(
    00323       const H225_ServiceControlDescriptor & contents
    00324     );
    00325
    00331     virtual PBoolean OnSendingPDU(
    00332       H225_ServiceControlDescriptor & contents
    00333     ) const;
    00334
    00340     virtual void OnChange(
    00341       unsigned type,
    00342       unsigned sessionId,
    00343       H323EndPoint & endpoint,
    00344       H323Connection * connection
    00345     ) const;
    00347
    00350
    00351     const PString & GetAmount() const { return amount; }
    00352
    00354     bool GetMode() const { return mode; }
    00355
    00357     unsigned GetDurationLimit() const { return durationLimit; }
    00359
    00360   protected:
    00361     PString  amount;
    00362     bool     mode;
    00363     unsigned durationLimit;
    00364 };
    00365
    00366
    00367 #endif // OPAL_H323
    00368
    00369 #endif // OPAL_H323_SVCCTRL_H
    00370
    00371