Yate
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
CallEndpoint Class Reference

An abstract call endpoint. More...

#include <yatephone.h>

Inheritance diagram for CallEndpoint:
RefObject GenObject Channel ClientChannel

Public Member Functions

virtual void destroyed ()
 
virtual void * getObject (const String &name) const
 
virtual const StringtoString () const
 
const Stringid () const
 
CallEndpointgetPeer () const
 
bool getPeerId (String &id) const
 
String getPeerId () const
 
bool getLastPeerId (String &id) const
 
void setLastPeerId ()
 
Mutexmutex () const
 
bool connect (CallEndpoint *peer, const char *reason=0, bool notify=true)
 
bool disconnect (const char *reason=0, bool notify=true, const NamedList *params=0)
 
bool disconnect (const char *reason, const NamedList &params)
 
DataEndpointgetEndpoint (const String &type=CallEndpoint::audioType()) const
 
DataEndpointsetEndpoint (const String &type=CallEndpoint::audioType())
 
void clearEndpoint (const String &type=String::empty())
 
void setSource (DataSource *source=0, const String &type=CallEndpoint::audioType())
 
DataSourcegetSource (const String &type=CallEndpoint::audioType()) const
 
void setConsumer (DataConsumer *consumer=0, const String &type=CallEndpoint::audioType())
 
DataConsumergetConsumer (const String &type=CallEndpoint::audioType()) const
 
bool clearData (DataNode *node, const String &type=CallEndpoint::audioType())
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Static Public Member Functions

static MutexcommonMutex ()
 
static const StringaudioType ()
 
- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 

Protected Member Functions

 CallEndpoint (const char *id=0)
 
virtual void connected (const char *reason)
 
virtual void disconnected (bool final, const char *reason)
 
virtual void setDisconnect (const NamedList *params)
 
void setPeer (CallEndpoint *peer, const char *reason=0, bool notify=true, const NamedList *params=0)
 
void setEndpoint (DataEndpoint *endPoint)
 
virtual void setId (const char *newId)
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 

Protected Attributes

ObjList m_data
 
Mutexm_mutex
 

Friends

class DataEndpoint
 

Detailed Description

An abstract call endpoint.

A class that holds common call control and data related features

Constructor & Destructor Documentation

CallEndpoint ( const char *  id = 0)
protected

Constructor

Member Function Documentation

static const String& audioType ( )
static

Return the defaul audio type "audio"

Returns
Return a string naming the "audio" type
bool clearData ( DataNode node,
const String type = CallEndpoint::audioType() 
)

Clear a data node from any slot of a DataEndpoint of this object

Parameters
nodePointer to DataSource or DataConsumer to clear
typeType of data node: "audio", "video", "text"
Returns
True if the node was removed from at least one slot
void clearEndpoint ( const String type = String::empty())

Clear one or all data endpoints of this object

Parameters
typeType of data endpoint: "audio", "video", "text", NULL to clear all
static Mutex& commonMutex ( )
static

Get the big mutex that serializes access to all call endpoints

Returns
A reference to the mutex
bool connect ( CallEndpoint peer,
const char *  reason = 0,
bool  notify = true 
)

Connect the call endpoint to a peer.

Parameters
peerPointer to the peer call endpoint.
reasonText that describes connect reason.
notifyCall disconnected() notification method on old peer
Returns
True if connected, false if an error occured.
virtual void connected ( const char *  reason)
inlineprotectedvirtual

Connect notification method.

Parameters
reasonText that describes connect reason.

Reimplemented in ClientChannel, and Channel.

virtual void destroyed ( )
virtual

Destruct notification, performs cleanups

Reimplemented from RefObject.

Reimplemented in ClientChannel.

bool disconnect ( const char *  reason = 0,
bool  notify = true,
const NamedList params = 0 
)
inline

Disconnect from the connected peer call endpoint.

Parameters
reasonText that describes disconnect reason.
notifyCall disconnected() notification method on old peer
paramsOptional pointer to extra parameters for disconnect cause
Returns
True if the object was deleted, false if it still exists

Referenced by CallEndpoint::disconnect().

bool disconnect ( const char *  reason,
const NamedList params 
)
inline

Disconnect from the connected peer call endpoint and notify old peer.

Parameters
reasonText that describes disconnect reason.
paramsExtra parameters for disconnect cause
Returns
True if the object was deleted, false if it still exists

References CallEndpoint::disconnect().

virtual void disconnected ( bool  final,
const char *  reason 
)
inlineprotectedvirtual

Disconnect notification method.

Parameters
finalTrue if this disconnect was called from the destructor.
reasonText that describes disconnect reason.

Reimplemented in ClientChannel, and Channel.

DataConsumer* getConsumer ( const String type = CallEndpoint::audioType()) const

Get the data consumer of this object

Parameters
typeType of data node: "audio", "video", "text"
Returns
A pointer to the DataConsumer object or NULL
DataEndpoint* getEndpoint ( const String type = CallEndpoint::audioType()) const

Get a data endpoint of this object

Parameters
typeType of data endpoint: "audio", "video", "text"
Returns
A pointer to the DataEndpoint object or NULL if not found
bool getLastPeerId ( String id) const

Get the last connected peer call id in a caller supplied String

Parameters
idString to fill in
Returns
True if the call endpoint ever had a peer
virtual void* getObject ( const String name) const
virtual

Get a pointer to a derived class given that class name

Parameters
nameName of the class we are asking for
Returns
Pointer to the requested class or NULL if this object doesn't implement it

Reimplemented from RefObject.

Reimplemented in Channel.

CallEndpoint* getPeer ( ) const
inline

Get the connected peer call

Returns
Pointer to connected peer call or NULL
bool getPeerId ( String id) const

Get the connected peer call id in a caller supplied String

Parameters
idString to fill in
Returns
True if the call endpoint has a peer
String getPeerId ( ) const

Get the connected peer call id

Returns
Connected peer call id or empty string
DataSource* getSource ( const String type = CallEndpoint::audioType()) const

Get a data source of this object

Parameters
typeType of data node: "audio", "video", "text"
Returns
A pointer to the DataSource object or NULL
const String& id ( ) const
inline

Get the unique channel identifier

Returns
A String holding the unique channel id
Mutex* mutex ( ) const
inline

Get the mutex that serializes access to this call endpoint, if any

Returns
Pointer to the call's mutex object or NULL
void setConsumer ( DataConsumer consumer = 0,
const String type = CallEndpoint::audioType() 
)

Set the data consumer of this object

Parameters
consumerA pointer to the new consumer or NULL
typeType of data node: "audio", "video", "text"
virtual void setDisconnect ( const NamedList params)
inlineprotectedvirtual

Set disconnect parameters

Parameters
paramsPointer to disconnect cause parameters, NULL to reset them

Reimplemented in Channel.

DataEndpoint* setEndpoint ( const String type = CallEndpoint::audioType())

Get a data endpoint of this object, create if required

Parameters
typeType of data endpoint: "audio", "video", "text"
Returns
A pointer to the DataEndpoint object or NULL if an error occured
void setEndpoint ( DataEndpoint endPoint)
protected

Set a foreign data endpoint in this object

Parameters
endPointData endpoint to set, will replace one with same type
virtual void setId ( const char *  newId)
protectedvirtual

Set a new ID for this call endpoint

Parameters
newIdNew ID to set to this call

Reimplemented in Channel.

void setLastPeerId ( )

Copy the current peer ID as the last connected peer ID, does nothing if not connected

void setPeer ( CallEndpoint peer,
const char *  reason = 0,
bool  notify = true,
const NamedList params = 0 
)
protected

Set the peer call endpoint pointer.

Parameters
peerA pointer to the new peer or NULL.
reasonText describing the reason in case of disconnect.
notifyCall notification methods - connected() or disconnected()
paramsOptional pointer to extra parameters for disconnect cause
void setSource ( DataSource source = 0,
const String type = CallEndpoint::audioType() 
)

Set a data source of this object

Parameters
sourceA pointer to the new source or NULL
typeType of data node: "audio", "video", "text"
virtual const String& toString ( ) const
inlinevirtual

Get a string representation of this channel

Returns
A reference to the name of this object

Reimplemented from GenObject.


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