OPAL  Version 3.12.9
OpalContext Class Reference

#include <opal.h>

Public Member Functions

 OpalContext ()
 Construct an unintialised OPAL context. More...
 
virtual ~OpalContext ()
 Destroy the OPAL context, calls ShutDown(). More...
 
unsigned Initialise (const char *options, unsigned version=OPAL_C_API_VERSION)
 
bool IsInitialised () const
 Indicate if the OPAL context has been initialised. More...
 
void ShutDown ()
 Calls OpalShutDown() to dispose of the OPAL context. More...
 
bool GetMessage (OpalMessagePtr &message, unsigned timeout=0)
 Calls OpalGetMessage() to get next message from the OPAL context. More...
 
bool SendMessage (const OpalMessagePtr &message, OpalMessagePtr &response)
 Calls OpalSendMessage() to send a message to the OPAL context. More...
 
bool SetUpCall (OpalMessagePtr &response, const char *partyB, const char *partyA=NULL, const char *alertingType=NULL)
 Execute OpalSendMessage() using OpalCmdSetUpCall. More...
 
bool AnswerCall (const char *callToken)
 Answer a call using OpalCmdAnswerCall via OpalSendMessage() More...
 
bool ClearCall (const char *callToken, OpalCallEndReason reason=OpalCallEndedByLocalUser)
 Clear a call using OpalCmdClearCall via OpalSendMessage() More...
 
bool SendUserInput (const char *callToken, const char *userInput, unsigned duration=0)
 Send user input using OpalCmdUserInput via OpalSendMessage() More...
 

Protected Attributes

OpalHandle m_handle
 

Detailed Description

This class is a wrapper around the "C" API.

It may seem odd to have a C++ wrapper around a "C" API which is itself a wrapper around a C++ API, but sometimes a C++ programmer may wish to access the OPAL system via this simplified API instead of the quite complex one in the base OPAL library.

Constructor & Destructor Documentation

OpalContext::OpalContext ( )

Construct an unintialised OPAL context.

virtual OpalContext::~OpalContext ( )
virtual

Destroy the OPAL context, calls ShutDown().

Member Function Documentation

bool OpalContext::AnswerCall ( const char *  callToken)

Answer a call using OpalCmdAnswerCall via OpalSendMessage()

Parameters
callTokenCall token for call being answered.
bool OpalContext::ClearCall ( const char *  callToken,
OpalCallEndReason  reason = OpalCallEndedByLocalUser 
)

Clear a call using OpalCmdClearCall via OpalSendMessage()

Parameters
callTokenCall token for call being cleared.
reasonCode for the call termination, see OpalCmdClearCall.
bool OpalContext::GetMessage ( OpalMessagePtr message,
unsigned  timeout = 0 
)

Calls OpalGetMessage() to get next message from the OPAL context.

unsigned OpalContext::Initialise ( const char *  options,
unsigned  version = OPAL_C_API_VERSION 
)

Calls OpalIntialise() to initialise the OPAL context. Returns version of API supported by library, zero if error.

Parameters
optionsList of options to pass to OpalIntialise()
versionVersion expected by application
bool OpalContext::IsInitialised ( ) const
inline

Indicate if the OPAL context has been initialised.

References m_handle.

bool OpalContext::SendMessage ( const OpalMessagePtr message,
OpalMessagePtr response 
)

Calls OpalSendMessage() to send a message to the OPAL context.

Parameters
messageMessage to send to OPAL.
responseResponse from OPAL.
bool OpalContext::SendUserInput ( const char *  callToken,
const char *  userInput,
unsigned  duration = 0 
)

Send user input using OpalCmdUserInput via OpalSendMessage()

Parameters
callTokenCall token for the call, see OpalCmdUserInput.
userInputUser input string, e.g. "#", see OpalCmdUserInput.
durationDuration in milliseconds for tone, see OpalCmdUserInput.
bool OpalContext::SetUpCall ( OpalMessagePtr response,
const char *  partyB,
const char *  partyA = NULL,
const char *  alertingType = NULL 
)

Execute OpalSendMessage() using OpalCmdSetUpCall.

Parameters
responseResponse from OPAL context on initiating call.
partyBDestination address, see OpalCmdSetUpCall.
partyACalling sub-system, see OpalCmdSetUpCall.
alertingTypeAlerting type code, see OpalCmdSetUpCall.
void OpalContext::ShutDown ( )

Calls OpalShutDown() to dispose of the OPAL context.

Field Documentation

OpalHandle OpalContext::m_handle
protected

Referenced by IsInitialised().


The documentation for this class was generated from the following file: