class Channel

An abstract communication channel. More...

Full nameTelEngine::Channel
Definition#include <yatephone.h>
InheritsTelEngine::CallEndpoint [public ], TelEngine::DebugEnabler [public ]
Inherited byClientChannel
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Public Static Methods

Protected Methods

Protected Members


Detailed Description

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

String m_status

m_status

[protected]

String m_address

m_address

[protected]

String m_targetid

m_targetid

[protected]

String m_billid

m_billid

[protected]

bool m_answered

m_answered

[protected]

 ~Channel ()

~Channel

[virtual]

Destructor

void*  getObject (const String& name)

getObject

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

void  complete (Message& msg, bool minimal = false)

complete

[const virtual]

Put channel variables into a message

Parameters:
msgMessage to fill in
minimalTrue to fill in only a minimum of parameters

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

message

Create a filled notification message

Parameters:
nameName of the message to create
minimalSet to true to fill in only a minimum of parameters
dataSet the channel as message data

Returns: A new allocated and parameter filled message

Message*  message (const char* name, const NamedList* original, const char* params = 0, bool minimal = false, bool data = false)

message

Create a filled notification message, copy some parameters from another message

Parameters:
nameName of the message to create
originalParameters to copy from, can be NULL
paramsComma separated list of parameters to copy, if NULL will be taken from the "copyparams" parameter of original
minimalSet to true to fill in only a minimum of parameters
dataSet the channel as message data

Returns: A new allocated and parameter filled message

inline Message*  message (const char* name, const NamedList& original, const char* params = 0, bool minimal = false, bool data = false)

message

Create a filled notification message, copy some parameters from another message

Parameters:
nameName of the message to create
originalParameters to copy from
paramsComma separated list of parameters to copy, if NULL will be taken from the "copyparams" parameter of original
minimalSet to true to fill in only a minimum of parameters
dataSet the channel as message data

Returns: A new allocated and parameter filled message

bool  msgProgress (Message& msg)

msgProgress

[virtual]

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

Parameters:
msgNotification message

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

bool  msgRinging (Message& msg)

msgRinging

[virtual]

Notification on remote ringing

Parameters:
msgNotification message

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

bool  msgAnswered (Message& msg)

msgAnswered

[virtual]

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

Parameters:
msgNotification message

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

bool  msgTone (Message& msg, const char* tone)

msgTone

[virtual]

Notification on remote tone(s)

Parameters:
msgNotification message
tonePointer to the received tone(s)

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

bool  msgText (Message& msg, const char* text)

msgText

[virtual]

Notification on remote text messaging (sms)

Parameters:
msgNotification message
textPointer to the received text

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

bool  msgDrop (Message& msg, const char* reason)

msgDrop

[virtual]

Notification on current call drop request

Parameters:
msgNotification message
reasonPointer to drop reason text or NULL if none provided

Returns: True if initiated call drop, false if failed

bool  msgTransfer (Message& msg)

msgTransfer

[virtual]

Notification on native transfer request

Parameters:
msgNotification message

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

bool  msgUpdate (Message& msg)

msgUpdate

[virtual]

Notification on call parameters update request

Parameters:
msgNotification message

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

bool  msgMasquerade (Message& msg)

msgMasquerade

[virtual]

Notification on message masquerade as channel request

Parameters:
msgMessage already modified to masquerade as this channel

Returns: True to stop processing the message, false to masquerade it

void  msgStatus (Message& msg)

msgStatus

[virtual]

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

Parameters:
msgStatus message

void  checkTimers (Message& msg, const Time& tmr)

checkTimers

[virtual]

Timer check method, by default handles channel timeouts

Parameters:
msgTimer message
tmrCurrent time against which timers are compared

bool  callPrerouted (Message& msg, bool handled)

callPrerouted

[virtual]

Notification on progress of prerouting incoming call

Parameters:
msgNotification call.preroute message just after being dispatched
handledTrue if a handler claimed having handled prerouting

Returns: True to continue with the call, false to abort the route

bool  callRouted (Message& msg)

callRouted

[virtual]

Notification on progress of routing incoming call

Parameters:
msgNotification call.route message just after being dispatched

Returns: True to continue with the call, false to abort the route

void  callAccept (Message& msg)

callAccept

[virtual]

Notification on success of incoming call

Parameters:
msgNotification call.execute message just after being dispatched

void  callRejected (const char* error, const char* reason = 0, const Message* msg = 0)

callRejected

[virtual]

Notification on failure of incoming call

Parameters:
errorStandard error keyword
reasonTextual failure reason
msgPointer to message causing the rejection, if any

void  callConnect (Message& msg)

callConnect

[virtual]

Common processing after connecting the outgoing call, should be called from Driver's msgExecute()

Parameters:
msgNotification call.execute message while being dispatched

bool  setDebug (Message& msg)

setDebug

[virtual]

Set the local debugging level

Parameters:
msgDebug setting message

inline const String&  status ()

status

[const]

Get the current status of the channel

Returns: The current status as String

inline const String&  address ()

address

[const]

Get the current link address of the channel

Returns: The protocol dependent address as String

inline bool  isOutgoing ()

isOutgoing

[const]

Get the direction of the channel

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

inline bool  isIncoming ()

isIncoming

[const]

Get the direction of the channel

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

inline bool  isAnswered ()

isAnswered

[const]

Check if the call was answered or not

Returns: True if the call was answered

const char*  direction ()

direction

[const]

Get the direction of the channel as string

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

inline Driver*  driver ()

driver

[const]

Get the driver of this channel

Returns: Pointer to this channel's driver

inline u_int64_t  timeout ()

timeout

[const]

Get the time this channel will time out

Returns: Timeout time or zero if no timeout

inline void  timeout (u_int64_t tout)

timeout

Set the time this channel will time out

Parameters:
toutNew timeout time or zero to disable

inline u_int64_t  maxcall ()

maxcall

[const]

Get the time this channel will time out on outgoing calls

Returns: Timeout time or zero if no timeout

inline void  maxcall (u_int64_t tout)

maxcall

Set the time this channel will time out on outgoing calls

Parameters:
toutNew timeout time or zero to disable

inline void  setMaxcall (const Message& msg)

setMaxcall

Set the time this channel will time out on outgoing calls

Parameters:
msgReference of message possibly holding "maxcall" parameter

void  setMaxcall (const Message* msg)

setMaxcall

Set the time this channel will time out on outgoing calls

Parameters:
msgPointer to message possibly holding "maxcall" parameter

inline const String&  targetid ()

targetid

[const]

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.

inline const String&  billid ()

billid

[const]

Get the billing identifier.

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

bool  startRouter (Message* msg)

startRouter

Start a routing thread for this channel, dereference dynamic channels

Parameters:
msgPointer 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

unsigned int  allocId ()

allocId

[static]

Allocate an unique (per engine run) call ID

Returns: Unique call ID number

void  filterDebug (const String& item)

filterDebug

Enable or disable debugging according to driver's filter rules

Parameters:
itemValue of the item to match

 Channel (Driver* driver, const char* id = 0, bool outgoing = false)

Channel

[protected]

Constructor

 Channel (Driver& driver, const char* id = 0, bool outgoing = false)

Channel

[protected]

Alternate constructor provided for convenience

void  cleanup ()

cleanup

[protected]

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

void  dropChan ()

dropChan

[protected]

Remove the channel from the parent driver list

void  zeroRefs ()

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.

void  connected (const char* reason)

connected

[protected virtual]

Connect notification method.

Parameters:
reasonText that describes connect reason.

Reimplemented from CallEndpoint.

void  disconnected (bool final, const char* reason)

disconnected

[protected virtual]

Disconnect notification method.

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

Reimplemented from CallEndpoint.

void  setId (const char* newId)

setId

[protected virtual]

Set a new ID for this channel

Parameters:
newIdNew ID to set to this channel

Reimplemented from CallEndpoint.

void  status (const char* newstat)

status

[protected]

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

Parameters:
newstatThe new status as String

void  statusParams (String& str)

statusParams

[protected virtual]

Build the parameter reporting part of the status answer

Parameters:
strString variable to fill up

inline void  setOutgoing (bool outgoing = true)

setOutgoing

[protected]

Set the current direction of the channel

Parameters:
outgoingTrue if this is an outgoing call channel

bool  dtmfInband (const char* tone)

dtmfInband

[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:
tonePointer to the tone sequence to send

Returns: True on success

bool  toneDetect (const char* sniffer = 0)

toneDetect

[protected]

Attempt to install a data sniffer to detect inband tones Needs a tone detector module capable of attaching sniffer consumers.

Parameters:
snifferName of the sniffer to install, default will detect all tones

Returns: True on success


Generated by: root on dragoshel on Sat Apr 14 01:50:50 2007, using kdoc 2.0a54.