svcctrl.h
Go to the documentation of this file.
/*
* svcctrl.h
*
* H.225 Service Control protocol handler
*
* Open H323 Library
*
* Copyright (c) 2003 Equivalence Pty. Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS"
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
* the License for the specific language governing rights and limitations
* under the License.
*
* The Original Code is Open H323 Library.
*
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
* Contributor(s): ______________________________________.
*
* $Revision: 24178 $
* $Author: rjongbloed $
* $Date: 2010-04-05 19:10:56 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef OPAL_H323_SVCCTRL_H
#define OPAL_H323_SVCCTRL_H
#ifdef P_USE_PRAGMA
#pragma interface
#endif
#include <opal/buildopts.h>
#if OPAL_H323
class H225_ServiceControlDescriptor;
class H225_ServiceControlIndication;
class H225_ServiceControlResponse;
class H248_SignalsDescriptor;
class H248_SignalRequest;
class H323EndPoint;
class H323Connection;
class H323ServiceControlSession : public PObject
{
PCLASSINFO(H323ServiceControlSession, PObject);
public:
H323ServiceControlSession();
virtual PBoolean IsValid() const = 0;
virtual PString GetServiceControlType() const;
virtual PBoolean OnReceivedPDU(
const H225_ServiceControlDescriptor & descriptor
) = 0;
virtual PBoolean OnSendingPDU(
H225_ServiceControlDescriptor & descriptor
) const = 0;
enum ChangeType {
OpenSession, // H225_ServiceControlSession_reason::e_open
RefreshSession, // H225_ServiceControlSession_reason::e_refresh
CloseSession // H225_ServiceControlSession_reason::e_close
};
virtual void OnChange(
unsigned type,
unsigned sessionId,
H323EndPoint & endpoint,
H323Connection * connection
) const = 0;
};
class H323HTTPServiceControl : public H323ServiceControlSession
{
PCLASSINFO(H323HTTPServiceControl, H323ServiceControlSession);
public:
H323HTTPServiceControl(
const PString & url
);
H323HTTPServiceControl(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean IsValid() const;
virtual PString GetServiceControlType() const;
virtual PBoolean OnReceivedPDU(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean OnSendingPDU(
H225_ServiceControlDescriptor & contents
) const;
virtual void OnChange(
unsigned type,
unsigned sessionId,
H323EndPoint & endpoint,
H323Connection * connection
) const;
protected:
PString url;
};
class H323H248ServiceControl : public H323ServiceControlSession
{
PCLASSINFO(H323H248ServiceControl, H323ServiceControlSession);
public:
H323H248ServiceControl();
H323H248ServiceControl(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean OnReceivedPDU(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean OnSendingPDU(
H225_ServiceControlDescriptor & contents
) const;
virtual PBoolean OnReceivedPDU(
const H248_SignalsDescriptor & descriptor
);
virtual PBoolean OnSendingPDU(
H248_SignalsDescriptor & descriptor
) const;
virtual PBoolean OnReceivedPDU(
const H248_SignalRequest & request
) = 0;
virtual PBoolean OnSendingPDU(
H248_SignalRequest & request
) const = 0;
};
class H323CallCreditServiceControl : public H323ServiceControlSession
{
PCLASSINFO(H323CallCreditServiceControl, H323ServiceControlSession);
public:
H323CallCreditServiceControl(
const PString & amount,
PBoolean mode,
unsigned duration = 0
);
H323CallCreditServiceControl(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean IsValid() const;
virtual PBoolean OnReceivedPDU(
const H225_ServiceControlDescriptor & contents
);
virtual PBoolean OnSendingPDU(
H225_ServiceControlDescriptor & contents
) const;
virtual void OnChange(
unsigned type,
unsigned sessionId,
H323EndPoint & endpoint,
H323Connection * connection
) const;
const PString & GetAmount() const { return amount; }
bool GetMode() const { return mode; }
unsigned GetDurationLimit() const { return durationLimit; }
protected:
PString amount;
bool mode;
unsigned durationLimit;
};
#endif // OPAL_H323
#endif // OPAL_H323_SVCCTRL_H
H323CallCreditServiceControl::OnReceivedPDU
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
H323H248ServiceControl
Definition: svcctrl.h:205
H323HTTPServiceControl::OnChange
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const
H323ServiceControlSession::ChangeType
ChangeType
Definition: svcctrl.h:108
buildopts.h
H323CallCreditServiceControl::amount
PString amount
Definition: svcctrl.h:361
H323HTTPServiceControl::GetServiceControlType
virtual PString GetServiceControlType() const
H323CallCreditServiceControl::H323CallCreditServiceControl
H323CallCreditServiceControl(const PString &amount, PBoolean mode, unsigned duration=0)
H323H248ServiceControl::OnReceivedPDU
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
H323HTTPServiceControl::OnSendingPDU
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
H323HTTPServiceControl::H323HTTPServiceControl
H323HTTPServiceControl(const PString &url)
H323HTTPServiceControl::url
PString url
Definition: svcctrl.h:199
H323H248ServiceControl::H323H248ServiceControl
H323H248ServiceControl()
H323ServiceControlSession::GetServiceControlType
virtual PString GetServiceControlType() const
H323CallCreditServiceControl::mode
bool mode
Definition: svcctrl.h:362
H323H248ServiceControl::OnSendingPDU
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
H323CallCreditServiceControl::GetMode
bool GetMode() const
Return the mode of operation.
Definition: svcctrl.h:354
H323CallCreditServiceControl::IsValid
virtual PBoolean IsValid() const
H323CallCreditServiceControl::OnChange
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const
H323ServiceControlSession::IsValid
virtual PBoolean IsValid() const =0
H323ServiceControlSession::OnReceivedPDU
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &descriptor)=0
H323ServiceControlSession::RefreshSession
Definition: svcctrl.h:110
H323ServiceControlSession
Definition: svcctrl.h:57
H323CallCreditServiceControl::GetAmount
const PString & GetAmount() const
Return the amount string.
Definition: svcctrl.h:351
H323Connection
Definition: h323con.h:130
H323ServiceControlSession::OpenSession
Definition: svcctrl.h:109
H323ServiceControlSession::H323ServiceControlSession
H323ServiceControlSession()
H323CallCreditServiceControl::durationLimit
unsigned durationLimit
Definition: svcctrl.h:363
H323ServiceControlSession::CloseSession
Definition: svcctrl.h:111
H323ServiceControlSession::OnSendingPDU
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &descriptor) const =0
H323CallCreditServiceControl::GetDurationLimit
unsigned GetDurationLimit() const
Return the duration limit.
Definition: svcctrl.h:357
H323HTTPServiceControl::OnReceivedPDU
virtual PBoolean OnReceivedPDU(const H225_ServiceControlDescriptor &contents)
H323HTTPServiceControl
Definition: svcctrl.h:131
H323CallCreditServiceControl
Definition: svcctrl.h:287
H323CallCreditServiceControl::OnSendingPDU
virtual PBoolean OnSendingPDU(H225_ServiceControlDescriptor &contents) const
H323EndPoint
Definition: h323ep.h:85
H323HTTPServiceControl::IsValid
virtual PBoolean IsValid() const
H323ServiceControlSession::OnChange
virtual void OnChange(unsigned type, unsigned sessionId, H323EndPoint &endpoint, H323Connection *connection) const =0