Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members

Channel Class Reference

An abstract communication channel. More...

#include <yatephone.h>

Inheritance diagram for Channel:

CallEndpoint DebugEnabler RefObject GenObject ClientChannel List of all members.

Public Member Functions

virtual ~Channel ()
virtual void * getObject (const String &name) const
virtual void complete (Message &msg, bool minimal=false) const
Messagemessage (const char *name, bool minimal=false, bool data=false)
virtual bool msgProgress (Message &msg)
virtual bool msgRinging (Message &msg)
virtual bool msgAnswered (Message &msg)
virtual bool msgTone (Message &msg, const char *tone)
virtual bool msgText (Message &msg, const char *text)
virtual bool msgDrop (Message &msg, const char *reason)
virtual bool msgTransfer (Message &msg)
virtual bool msgUpdate (Message &msg)
virtual void msgStatus (Message &msg)
virtual void checkTimers (Message &msg, const Time &tmr)
virtual bool callPrerouted (Message &msg, bool handled)
virtual bool callRouted (Message &msg)
virtual void callAccept (Message &msg)
virtual void callRejected (const char *error, const char *reason=0, const Message *msg=0)
virtual bool setDebug (Message &msg)
const Stringstatus () const
const Stringaddress () const
bool isOutgoing () const
bool isIncoming () const
bool isAnswered () const
const char * direction () const
Driverdriver () const
u_int64_t timeout () const
void timeout (u_int64_t tout)
u_int64_t maxcall () const
void maxcall (u_int64_t tout)
void setMaxcall (const Message &msg)
void setMaxcall (const Message *msg)
const Stringtargetid () const
const Stringbillid () const
bool startRouter (Message *msg)
void filterDebug (const String &item)

Static Public Member Functions

static unsigned int allocId ()

Protected Member Functions

 Channel (Driver *driver, const char *id=0, bool outgoing=false)
 Channel (Driver &driver, const char *id=0, bool outgoing=false)
void cleanup ()
void dropChan ()
virtual void zeroRefs ()
virtual void connected (const char *reason)
virtual void disconnected (bool final, const char *reason)
virtual void setId (const char *newId)
void status (const char *newstat)
virtual void statusParams (String &str)
void setOutgoing (bool outgoing=true)
bool dtmfInband (const char *tone)

Protected Attributes

String m_status
String m_address
String m_targetid
String m_billid
bool m_answered

Friends

class Driver
class Router

Detailed Description

An abstract communication channel.

A class that holds common channel related features (a.k.a. call leg)


Constructor & Destructor Documentation

virtual ~Channel  )  [virtual]
 

Destructor

Channel Driver driver,
const char *  id = 0,
bool  outgoing = false
[protected]
 

Constructor

Channel Driver driver,
const char *  id = 0,
bool  outgoing = false
[protected]
 

Alternate constructor provided for convenience


Member Function Documentation

const String& address  )  const [inline]
 

Get the current link address of the channel

Returns:
The protocol dependent address as String

static unsigned int allocId  )  [static]
 

Allocate an unique (per engine run) call ID

Returns:
Unique call ID number

const String& billid  )  const [inline]
 

Get the billing identifier.

Returns:
An identifier of the call or account that will be billed for calls made by this channel.

virtual void callAccept Message msg  )  [virtual]
 

Notification on success of incoming call

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

Reimplemented in ClientChannel.

virtual bool callPrerouted Message msg,
bool  handled
[virtual]
 

Notification on progress of prerouting incoming call

Parameters:
msg Notification call.preroute message just after being dispatched
handled True if a handler claimed having handled prerouting
Returns:
True to continue with the call, false to abort the route

virtual void callRejected const char *  error,
const char *  reason = 0,
const Message msg = 0
[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 in ClientChannel.

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 in ClientChannel.

virtual void checkTimers Message msg,
const Time tmr
[virtual]
 

Timer check method, by default handles channel timeouts

Parameters:
msg Timer message
tmr Current time against which timers are compared

void cleanup  )  [protected]
 

Perform destruction time cleanup. You can call this method earlier if destruction is to be postponed.

virtual void complete Message msg,
bool  minimal = false
const [virtual]
 

Put channel variables into a message

Parameters:
msg Message to fill in
minimal True to fill in only a minimum of parameters

virtual void connected const char *  reason  )  [protected, virtual]
 

Connect notification method.

Parameters:
reason Text that describes connect reason.

Reimplemented from CallEndpoint.

const char* direction  )  const
 

Get the direction of the channel as string

Returns:
"incoming" or "outgoing" according to the direction

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 CallEndpoint.

Driver* driver  )  const [inline]
 

Get the driver of this channel

Returns:
Pointer to this channel's driver

void dropChan  )  [protected]
 

Remove the channel from the parent driver list

bool dtmfInband const char *  tone  )  [protected]
 

Attempt to install an override data source to send DTMF inband. Needs a tone generator module capable to override with "tone/dtmfstr/xyz"

Parameters:
tone Pointer to the tone sequence to send
Returns:
True on success

void filterDebug const String item  ) 
 

Enable or disable debugging according to driver's filter rules

Parameters:
item Value of the item to match

virtual void* getObject const String name  )  const [virtual]
 

Get a pointer to a derived class given that class name

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

Reimplemented from CallEndpoint.

bool isAnswered  )  const [inline]
 

Check if the call was answered or not

Returns:
True if the call was answered

bool isIncoming  )  const [inline]
 

Get the direction of the channel

Returns:
True if the channel is an incoming call (generated remotely)

bool isOutgoing  )  const [inline]
 

Get the direction of the channel

Returns:
True if the channel is an outgoing call (generated locally)

void maxcall u_int64_t  tout  )  [inline]
 

Set the time this channel will time out on outgoing calls

Parameters:
tout New timeout time or zero to disable

u_int64_t maxcall  )  const [inline]
 

Get the time this channel will time out on outgoing calls

Returns:
Timeout time or zero if no timeout

Message* message const char *  name,
bool  minimal = false,
bool  data = false
 

Create a filled notification message

Parameters:
name Name of the message to create
minimal Set to true to fill in only a minimum of parameters
data Set the channel as message data
Returns:
A new allocated and parameter filled message

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 in ClientChannel.

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

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 in ClientChannel.

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 in ClientChannel.

virtual void msgStatus Message msg  )  [virtual]
 

Status message handler that is invoked only for messages to this channel

Parameters:
msg Status message

virtual bool msgText Message msg,
const char *  text
[virtual]
 

Notification on remote text messaging (sms)

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

virtual bool msgTone Message msg,
const char *  tone
[virtual]
 

Notification on remote tone(s)

Parameters:
msg Notification message
tone Pointer to the received tone(s)
Returns:
True to stop processing the message, false to let it flow

virtual bool msgTransfer Message msg  )  [virtual]
 

Notification on native transfer request

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

virtual bool msgUpdate Message msg  )  [virtual]
 

Notification on call parameters update request

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

virtual bool setDebug Message msg  )  [virtual]
 

Set the local debugging level

Parameters:
msg Debug setting message

virtual void setId const char *  newId  )  [protected, virtual]
 

Set a new ID for this channel

Parameters:
newId New ID to set to this channel

Reimplemented from CallEndpoint.

void setMaxcall const Message msg  ) 
 

Set the time this channel will time out on outgoing calls

Parameters:
msg Pointer to message possibly holding "maxcall" parameter

void setMaxcall const Message msg  )  [inline]
 

Set the time this channel will time out on outgoing calls

Parameters:
msg Reference of message possibly holding "maxcall" parameter

void setOutgoing bool  outgoing = true  )  [inline, protected]
 

Set the current direction of the channel

Parameters:
outgoing True if this is an outgoing call channel

bool startRouter Message msg  ) 
 

Start a routing thread for this channel, dereference dynamic channels

Parameters:
msg Pointer to message to route, typically a "call.route", will be destroyed after routing fails or completes
Returns:
True if routing thread started successfully, false if failed

void status const char *  newstat  )  [protected]
 

Set the current status of the channel. Note that a value of "answered" will set the answered flag

Parameters:
newstat The new status as String

const String& status  )  const [inline]
 

Get the current status of the channel

Returns:
The current status as String

virtual void statusParams String str  )  [protected, virtual]
 

Build the parameter reporting part of the status answer

Parameters:
str String variable to fill up

const String& targetid  )  const [inline]
 

Get the connected channel identifier.

Returns:
A String holding the unique channel id of the target or an empty string if this channel is not connected to a target.

void timeout u_int64_t  tout  )  [inline]
 

Set the time this channel will time out

Parameters:
tout New timeout time or zero to disable

u_int64_t timeout  )  const [inline]
 

Get the time this channel will time out

Returns:
Timeout time or zero if no timeout

virtual void zeroRefs  )  [protected, virtual]
 

This method is overriden to safely remove the channel from the parent driver list before actually destroying the channel.

Reimplemented from RefObject.


The documentation for this class was generated from the following file:
Generated on Fri Jul 7 03:11:38 2006 for Yate by  doxygen 1.4.4