AsteriskCall Class Reference

Internal representation of asterisk calls. More...

#include <astinterface.h>

List of all members.

Public Member Functions

 ~AsteriskCall ()
 Destruct an asterisk call.
std::string GetUniqueId ()
 gets uniqueid attribute
void SetAddress (std::string address)
std::string GetAddress ()
void SetCallerId (std::string callerid)
 set AsteriskCall callerId
std::string GetCallerId ()
 sets callerId
bool HasCallerId ()
void SetCallerIdName (std::string calleridname)
 set AsteriskCall callerIdName
std::string GetCallerIdName ()
 sets callerIdName
std::string GetConnectedLineNum ()
 sets connectedLineId
void SetConnectedLineNum (std::string connectedLineNum)
 set AsteriskCall connectedLineId
std::string GetConnectedLineName ()
 sets connectedLineId
void SetConnectedLineName (std::string connectedLineName)
 set AsteriskCall connectedLineId
bool HasCallerIdName ()
std::string GetChannel ()
 gets associated asterisk channel name (ie: local/201)
void SetChannel (std::string newChannel)
 sets associated asterisk channel name (ie: local/201)
activa_call_state GetState ()
 gets state
std::string GetStateString ()
 gets state string
void SetState (std::string newState)
 sets state
void Link (AsteriskCall *pDestCall)
 links this call to a destination call
void Unlink ()
 unlinks this call from a destination call
void LinkCSTACall (std::string cstaUniqueId)
 links two different CSTA Calls
bool HasCSTALink ()
 return true if exist a CSTA link
void SetUserData (std::string userData)
 set userData
std::string GetUserData ()
 Get userData.
bool HasSourceUniqueId ()
std::string GetSourceUniqueId ()
 gets reference to source call
std::string GetLastRedirectionDevice ()
 get device of the last redirection
void SetLastRedirectionDevice (std::string redirecting)
 set device of the last redirection
bool IsLocalChannel ()
 Is local channel?
bool IsLocalMasterChannel ()
 Is local master leg? of the form local/xxx@yyy,1.
bool IsLocalOutboundChannel ()
 Is local outbound leg? of the form local/xxx@yyy,2.
void SetCallId (DWORD newCallId)
 set a new callid to call
DWORD GetCallId ()
 return callId
void Dump (ASTLogger &log)
std::string DumpToString ()
std::string GetTypeChannel ()
bool IsPredictiveCall ()
 return true if call is predictive
void SetPredictiveCall ()
 set the call as predictive
call_cause GetCause ()
 return the cause of call
void SetCause (call_cause cause)
 set any cause to call

Static Public Member Functions

static AsteriskCallCreate (std::string uniqueId, std::string callerId, DWORD callId, std::string userData)
 factory method
static std::string GetAddressFromChannel (std::string channel)
 Gets address from channel specification.
static std::string GetDialableNumberFromChannel (std::string channel)
 Gets dialable number from Channel.
static std::string getMasterChannelFromOutboundChannel (std::string channel)
 getMasterChannelFromOutboundChannel
static std::string getOutboundChannelFromMasterChannel (std::string channel)
 getOutboundChannelFromMasterChannel
static std::string GetCIDNamePrefix (std::string calleridname)
 parses cidname and if it has the form xxx:yyyyyy it returns xxx
static bool IsUnknown (std::string device)
 true if device is void or equal to <unknown>


Detailed Description

Internal representation of asterisk calls.

Member Function Documentation

AsteriskCall * AsteriskCall::Create ( std::string  _uniqueId,
std::string  _callerId,
DWORD  _callId,
std::string  _userData 
) [static]

factory method

create new AsteriskCall with uniqueId and callerId for this connection

Parameters:
_uniqueId identifier of AsteriskCall
_callerId 
_callId identifier of call
_userData 
Returns:
a new AsteriskCall

void AsteriskCall::Dump ( ASTLogger &  log  ) 

Dump AsteriskCall

Parameters:
log 

std::string AsteriskCall::DumpToString (  ) 

Converts an AsteriskCall to String

Returns:
string with the AsterisCall atributes

std::string AsteriskCall::GetAddress (  )  [inline]

gets associated address. We differentiate between address and callerid since callerid may change. Usually read 'address' parsing the channel description.

std::string AsteriskCall::GetAddressFromChannel ( std::string  channel  )  [static]

Gets address from channel specification.

Gets extension from channel specification

  • HEADER: channel DATA: Local/311@default-3d4a,2 => 311
  • HEADER: channel DATA: SIP/311-f260 => SIP/311
  • HEADER: channel DATA: mISDN/1-1 => mISDN/1-1
  • HEADER: channel DATA: AsyncGoto/SIP/311-fw60 => SIP/311
  • HEADER: channel DATA: CAPI/ISDN1/319-2 => CAPI/ISDN1/319
  • HEADER: channel DATA: Transfered/SIP/419-08269c40 => SIP/419
  • other generic formats decoded as XXX/address-XXX => XXX/address

Parameters:
channel A pure address can also be passed.
Returns:
string with the address

std::string AsteriskCall::GetCIDNamePrefix ( std::string  calleridname  )  [static]

parses cidname and if it has the form xxx:yyyyyy it returns xxx

Return CallerIdName prefix CIDName prefix has to be separated by ':' i.e.: 111: => callerIdName prefix is 111

Parameters:
calleridname 
Returns:
string with CIDNamePrefix

std::string AsteriskCall::GetDialableNumberFromChannel ( std::string  channel  )  [static]

Gets dialable number from Channel.

Gets extension from channel specification

  • HEADER: channel DATA: Local/311@default-3d4a,2 => 311
  • HEADER: channel DATA: SIP/311-f260 => 311
  • HEADER: channel DATA: mISDN/1-1 => mISDN/1-1
  • HEADER: channel DATA: AsyncGoto/SIP/311-fw60 => SIP/311
  • HEADER: channel DATA: CAPI/ISDN1/319-2 => 319
  • HEADER: channel DATA: Transfered/SIP/419-08269c40 => SIP/419
  • other generic formats decoded as XXX/address-XXX => address

Parameters:
channel A pure address can also be passed.
Returns:
string with the address

std::string AsteriskCall::getMasterChannelFromOutboundChannel ( std::string  channel  )  [static]

getMasterChannelFromOutboundChannel

Return getMasterChannelFromOutboundChannel ( ast14 ->",2 =>,1" ; ast16->";2 =>;1" ) i.e.: Local/320@from-internal-6f9b,2 -> Local/320@from-internal-6f9b,1

Returns:
getMasterChannelFromOutboundChannel, otherwise ""

std::string AsteriskCall::getOutboundChannelFromMasterChannel ( std::string  channel  )  [static]

getOutboundChannelFromMasterChannel

Return getOutboundChannelFromMasterChannel ( ast14 ->",1 =>,2" ; ast16->";1 =>;2" ) i.e.: Local/320@from-internal-6f9b,1 -> Local/320@from-internal-6f9b,2

Returns:
getOutboundChannelFromMasterChannel, otherwise ""

std::string AsteriskCall::GetTypeChannel (  ) 

Returns type of channel. Recognise types:

  • Local
  • Sip
  • misdn
  • asyncgoto
  • capi
  • transfered
  • generic types
    Returns:
    string type of channel

bool AsteriskCall::HasCallerId (  )  [inline]

That function is currently not used return true if callerid attribute is different than ""

bool AsteriskCall::HasCallerIdName (  )  [inline]

That function is currently not used. return true if calleridname attribute is different than ""

bool AsteriskCall::HasCSTALink (  ) 

return true if exist a CSTA link

This link is only used when exist two differents CSTA Calls that are the same audio link

Returns:
true if sourceUniqueId has the prefix CSTA

bool AsteriskCall::HasSourceUniqueId (  )  [inline]

Returns:
true if AsteriskCall has a source call

bool AsteriskCall::IsLocalChannel (  ) 

Is local channel?

Return true if channel is Local i.e.: Local/320@from-internal-6f9

Returns:
true if channel is local, otherwise false

bool AsteriskCall::IsLocalMasterChannel (  ) 

Is local master leg? of the form local/xxx@yyy,1.

Return true if channel is localMaster i.e.: Local/320@from-internal-6f9b,1

Returns:
true if is a master channel, otherwise false

bool AsteriskCall::IsLocalOutboundChannel (  ) 

Is local outbound leg? of the form local/xxx@yyy,2.

Return true if channel is localOutbound i.e.: Local/320@from-internal-6f9b,2

Returns:
true if the channel is an Outbound channel, otherwise false

bool AsteriskCall::IsUnknown ( std::string  device  )  [static]

true if device is void or equal to <unknown>

Return true if device is <unknown> or ""

Parameters:
device 
Returns:
true if device is unknown, otherwise false

void AsteriskCall::Link ( AsteriskCall pSourceCall  ) 

links this call to a destination call

links to destCall

Parameters:
pSourceCall FIX: AsteriskCall::link makes an inverted link

void AsteriskCall::SetAddress ( std::string  address  )  [inline]

Sets associated address. We differentiate between address and callerid since callerid may change. Usually read 'address' parsing the channel description.

void AsteriskCall::SetChannel ( std::string  newChannel  ) 

sets associated asterisk channel name (ie: local/201)

Set a Channel and address in AsteriskCall

Parameters:
newChannel 


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

Generated on Mon Jul 25 09:08:52 2011 for Activa Framework by  doxygen 1.5.9