ClientChannel Class Reference

Channel used by client programs. More...

#include <yatecbase.h>

Inheritance diagram for ClientChannel:

Channel CallEndpoint DebugEnabler RefObject GenObject

List of all members.

Public Types

enum  Notification {
  Startup, Destroyed, Active, OnHold,
  Noticed, AddrChanged, Routed, Accepted,
  Rejected, Progressing, Ringing, Answered,
  Transfer, Conference, Unknown
}

Public Member Functions

 ClientChannel (const Message &msg, const String &peerid)
 ClientChannel (const String &target, const NamedList &params)
virtual bool msgProgress (Message &msg)
virtual bool msgRinging (Message &msg)
virtual bool msgAnswered (Message &msg)
virtual bool msgDrop (Message &msg, const char *reason)
virtual bool callRouted (Message &msg)
virtual void callAccept (Message &msg)
virtual void callRejected (const char *error, const char *reason, const Message *msg)
void callAnswer ()
const Stringparty () const
bool conference () const
const StringtransferId () const
RefObjectclientData () const
void setClientData (RefObject *obj=0)
bool setMedia (bool open=false, bool replace=false)
bool setActive (bool active, bool update=true)
void setTransfer (const String &target=String::empty())
void setConference (const String &target=String::empty())
const StringpeerOutFormat () const
const StringpeerInFormat () const
bool active () const
bool isNoticed () const
void noticed ()
int line () const
void line (int newLine)
void update (int notif, bool chan=true, bool updatePeer=true, const char *engineMsg=0, bool minimal=false, bool data=false)

Static Public Member Functions

static int lookup (const char *notif, int def=Unknown)
static const char * lookup (int notif, const char *def=0)

Static Public Attributes

static TokenDict s_notification []

Protected Member Functions

virtual void destroyed ()
virtual void disconnected (bool final, const char *reason)
bool peerHasSource (Message &msg)
void checkSilence ()

Protected Attributes

String m_party
String m_peerOutFormat
String m_peerInFormat
String m_reason
String m_peerId
bool m_noticed
int m_line
bool m_active
bool m_silence
bool m_conference
String m_transferId
RefObjectm_clientData

Friends

class ClientDriver


Detailed Description

Channel used by client programs.

This class implements a Channel used by client programs


Member Enumeration Documentation

Channel notifications


Member Function Documentation

virtual bool msgProgress ( Message msg  )  [virtual]

Notification on remote call making some progress, not enabled by default

Parameters:
msg Notification message
Returns:
True to stop processing the message, false to let it flow

Reimplemented from Channel.

virtual bool msgRinging ( Message msg  )  [virtual]

Notification on remote ringing

Parameters:
msg Notification message
Returns:
True to stop processing the message, false to let it flow

Reimplemented from Channel.

virtual bool msgAnswered ( Message msg  )  [virtual]

Notification on remote answered. Note that the answered flag will be set

Parameters:
msg Notification message
Returns:
True to stop processing the message, false to let it flow

Reimplemented from Channel.

virtual bool msgDrop ( Message msg,
const char *  reason 
) [virtual]

Notification on current call drop request

Parameters:
msg Notification message
reason Pointer to drop reason text or NULL if none provided
Returns:
True if initiated call drop, false if failed

Reimplemented from Channel.

virtual bool callRouted ( Message msg  )  [virtual]

Notification on progress of routing incoming call

Parameters:
msg Notification call.route message just after being dispatched
Returns:
True to continue with the call, false to abort the route

Reimplemented from Channel.

virtual void callAccept ( Message msg  )  [virtual]

Notification on success of incoming call

Parameters:
msg Notification call.execute message just after being dispatched

Reimplemented from Channel.

virtual void callRejected ( const char *  error,
const char *  reason,
const Message msg 
) [virtual]

Notification on failure of incoming call

Parameters:
error Standard error keyword
reason Textual failure reason
msg Pointer to message causing the rejection, if any

Reimplemented from Channel.

void callAnswer (  ) 

Answer an incoming call. Set media channels. Enqueue a clientchan.update message

const String& party (  )  const [inline]

Get the remote party of this channel

Returns:
The remote party of this channel

bool conference (  )  const [inline]

Check if this channel is in conference

Returns:
True if this channel is in conference

const String& transferId (  )  const [inline]

Get the transferred peer's id

Returns:
The transferred peer's id

RefObject* clientData (  )  const [inline]

Get the client data

Returns:
RefObject pointer or 0

void setClientData ( RefObject obj = 0  )  [inline]

Set/reset the client data. If a new client data is set its reference counter is increased

Parameters:
obj The new client data

References TelEngine::destruct().

bool setMedia ( bool  open = false,
bool  replace = false 
)

Attach/detach media channels

Parameters:
open True to open, false to close
replace True to replace media if already open. Ignored if open is false
Returns:
True on success

bool setActive ( bool  active,
bool  update = true 
)

Set/reset this channel's data source/consumer

Parameters:
active True to set active, false to set inactive (mute)
update True to enqueue an update message
Returns:
True on success

void setTransfer ( const String target = String::empty()  ) 

Set/reset the transferred peer's id. Enqueue clientchan.update if changed. Open media when reset if the channel is active and answered

Parameters:
target The transferred peer's id. Leave it blank to reset

void setConference ( const String target = String::empty()  ) 

Set/reset the conference data. Enqueue clientchan.update if changed. Open media when reset if the channel is active and answered

Parameters:
target The confeernce room's name. Leave it blank to reset

const String& peerOutFormat (  )  const [inline]

Get the peer consumer's data format

Returns:
The peer consumer's data format

const String& peerInFormat (  )  const [inline]

Get the peer source's data format

Returns:
The peer source's data format

bool active (  )  const [inline]

Check if this channel is the active one

Returns:
True if this channel is the active one

bool isNoticed (  )  const [inline]

Check if this channel was noticed

Returns:
True if this channel was noticed

void noticed (  ) 

Notice this channel. Enqueue a clientchan.update message

int line (  )  const [inline]

Get this channel's line

Returns:
This channel's line

void line ( int  newLine  ) 

Set this channel's line

Parameters:
newLine This channel's line

void update ( int  notif,
bool  chan = true,
bool  updatePeer = true,
const char *  engineMsg = 0,
bool  minimal = false,
bool  data = false 
)

Update channel. Enqueue a clientchan.update message with the given operation. Enqueue other channel status messages if required

Parameters:
notif The value of the notify parameter
chan Set the channel as message's user data
updatePeer True to update peer's data formats
engineMsg Optional message to enqueue in the engine
minimal Set to true to fill in only a minimum of engine message's parameters
data Set the channel as engine message's user data

static int lookup ( const char *  notif,
int  def = Unknown 
) [inline, static]

Lookup for a notification id

Parameters:
notif The notification's name
def Default value to return if not found
Returns:
The result

References TelEngine::lookup().

static const char* lookup ( int  notif,
const char *  def = 0 
) [inline, static]

Lookup for a notification name

Parameters:
notif The notification's id
def Default value to return if not found
Returns:
The result

References TelEngine::lookup().

virtual void destroyed (  )  [protected, virtual]

Destruct notification, performs cleanups

Reimplemented from CallEndpoint.

virtual void disconnected ( bool  final,
const char *  reason 
) [protected, virtual]

Disconnect notification method.

Parameters:
final True if this disconnect was called from the destructor.
reason Text that describes disconnect reason.

Reimplemented from Channel.


Member Data Documentation

Channel notifications dictionary


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

Generated on Mon Aug 11 16:18:52 2008 for Yate by  doxygen 1.5.6