ASTCallMap Class Reference
This class administer all call maps of ActivaTSP.
More...
#include <call_map.h>
List of all members.
|
Public Member Functions |
| | ASTCallMap (ASTLogListener *pLog) |
| | ~ASTCallMap () |
| void | __WaitForMapLock () |
| void | __ReleaseMapLock () |
| void | AddXref (std::string deviceId, MonitorXref newxref) |
| bool | RemoveXref (MonitorXref xref) |
| std::string | GetDeviceFromMonitor (MonitorXref xref) |
| void | AddConnectionToCallModel (DWORD callId, std::string deviceId, csta_states deviceState) |
| csta_states | GetStateOfDevice (DWORD callId, std::string device) |
| void | RemoveConnectionFromCallModel (DWORD callId, std::string deviceId) |
| void | RemoveCallFromCallModel (DWORD callId) |
| bool | GetMonitorSetFromCallModel (DWORD callId, Set_xref &setXref) |
| AsteriskCall * | GetOrCreateCall (std::string _uniqueId) |
| AsteriskCall * | FindCallByUniqueId (std::string uniqueId) |
| AsteriskCall * | FindCallByChannel (std::string channel) |
| AsteriskCall * | FindCallByAddress (std::string address) |
| AsteriskCall * | FindCallByCallId (DWORD callId) |
| AsteriskCall * | FindCallByCallIdAndDevice (DWORD callId, std::string device) |
| AsteriskCall * | _deprecated__FindCallByCID (std::string cid, DWORD callId) |
| AsteriskCall * | GetSourceCall (AsteriskCall *pAC) |
| DWORD | GetLogicCallId (AsteriskCall *pAC) |
| void | GetSetCallIdByDevice (std::string device, Set_callId &setCallId) |
| bool | GetCIDInfoFromSourceCall (AsteriskCall *pAC, std::string &cid, std::string &cidname, std::string &userData) |
| void | GetDestinationCallSet (std::string sourceUniqueId, Set_uniqueId &setUniqueid) |
| bool | IsLocalCall (DWORD callId) |
| bool | HasDestinationCall (AsteriskCall *pAC) |
| bool | _deprecated__ExistCSTACall (DWORD callId, std::string device) |
| void | RemoveCallByUniqueId (std::string uniqueId) |
| void | GetSetDevicesFromCallId (DWORD callId, Set_deviceId &setDevices) |
| void | CleanupMaps () |
| void | DumpMaps () |
| virtual DWORD | GetNewCallId () sealed |
Static Public Member Functions |
| static std::string | CSTAState2Str (csta_states state) |
Protected Attributes |
|
Set_callId | m_callIdSet |
| | set of active callId. Used by GetNewCallId() and DropCallId(callid)
|
|
Map_deviceId2setXref | m_mapDeviceId2Xref |
| | map of deviceId (extensions) to list of references (xref).
|
|
Map_callId2setDeviceId | m_mapCallId2DeviceId |
| | map of callId to list of devices (extensions)
|
|
Map_UniqueId2AsteriskCall | m_uniqueId2Asteriskcall |
| | map of {uniqueId, AsteriskCall}
|
Detailed Description
This class administer all call maps of ActivaTSP.
It encapsulates three different callmaps:
- call-map: A {uniqueID => AsteriskCall} call map.
- address-monitor-map: An {address => monitorcrossreference} map that stores the address's list of monitor-cross-references.
- call-monitor: really a call-model that mantains calls. Uniqueid related to the addresses interested in their events.
Constructor & Destructor Documentation
Construct a map with Asterisk calls and CSTA calls
| ASTCallMap::~ASTCallMap |
( |
|
) |
|
Member Function Documentation
| void ASTCallMap::__ReleaseMapLock |
( |
|
) |
|
Leaves a critical section
| void ASTCallMap::__WaitForMapLock |
( |
|
) |
|
Enter into a critical section
| bool ASTCallMap::_deprecated__ExistCSTACall |
( |
DWORD |
callId, |
|
|
std::string |
device | |
|
) |
| | |
Search if exist an entry in CSTAMap with the specific callId and device
- Parameters:
-
- Returns:
- Retuns true or false if exist an entry in CSTAMap with the specific callId and device
| AsteriskCall * ASTCallMap::_deprecated__FindCallByCID |
( |
std::string |
cid, |
|
|
DWORD |
callid | |
|
) |
| | |
Find another call (different of callid) with the same CID
- Parameters:
-
- Returns:
- the fist AsteriskCall or null if it doesn't exist
| void ASTCallMap::AddConnectionToCallModel |
( |
DWORD |
callId, |
|
|
std::string |
deviceId, |
|
|
csta_states |
deviceState | |
|
) |
| | |
Update CSTA call map [callId] -> device -> state
- Parameters:
-
| callId | identifier of the call |
| deviceId | device |
| deviceState | The state of device: can be Initialited, Alerting, Connected, Failed, Held. |
| void ASTCallMap::AddXref |
( |
std::string |
address, |
|
|
MonitorXref |
newxref | |
|
) |
| | |
Add a new reference on m_mapDeviceId2Xref map
- Parameters:
-
| address | device or extension |
| newxref | number of monitor |
| void ASTCallMap::CleanupMaps |
( |
|
) |
|
| std::string ASTCallMap::CSTAState2Str |
( |
csta_states |
state |
) |
[static] |
Convert from csta_state to std::string
| void ASTCallMap::DumpMaps |
( |
|
) |
|
| AsteriskCall * ASTCallMap::FindCallByAddress |
( |
std::string |
address |
) |
|
| AsteriskCall * ASTCallMap::FindCallByCallId |
( |
DWORD |
callId |
) |
|
| AsteriskCall * ASTCallMap::FindCallByCallIdAndDevice |
( |
DWORD |
callId, |
|
|
std::string |
device | |
|
) |
| | |
Find an AsteriskCall with a specify callID and device.
- Parameters:
-
- Returns:
- the fist AsteriskCall or null if it doesn't exist
| AsteriskCall * ASTCallMap::FindCallByChannel |
( |
std::string |
_channel |
) |
|
| AsteriskCall * ASTCallMap::FindCallByUniqueId |
( |
std::string |
_uniqueId |
) |
|
Find an AsteriskCall with a specify uniqueId
- Parameters:
-
- Returns:
- an AsteriskCall or null if does not exist any call in m_uniqueId2Asteriskcall.
| bool ASTCallMap::GetCIDInfoFromSourceCall |
( |
AsteriskCall * |
pAC, |
|
|
std::string & |
cid, |
|
|
std::string & |
cidname, |
|
|
std::string & |
userData | |
|
) |
| | |
Extract callerID, callerIDname and userData from a call
- Parameters:
-
| pAC | |
| cid | by reference |
| cidname | by reference |
| userData | by reference |
- Returns:
- false if the AsteriskCall specify is null or if the map of Asterisk calls is too deep.
| void ASTCallMap::GetDestinationCallSet |
( |
std::string |
sourceUniqueId, |
|
|
Set_uniqueId & |
setUniqueid | |
|
) |
| | |
Looks for the set of calls (identified by its uniqueid) that have a given sourceUniqueId. Search is based on list-scan so its complexity is O(n)
- Parameters:
-
| sourceUniqueId | |
| setUniqueid | by reference |
| std::string ASTCallMap::GetDeviceFromMonitor |
( |
MonitorXref |
xref |
) |
|
Return the device of the monitor
- Parameters:
-
- Returns:
- string with device
Find the callId of the call. The first AsteriskCall contains the logic CallId.
- Parameters:
-
- Returns:
- Returns the callId of the source call.
| bool ASTCallMap::GetMonitorSetFromCallModel |
( |
DWORD |
callId, |
|
|
Set_xref & |
setXref | |
|
) |
| | |
Get a set of reference with the same callId.
- Parameters:
-
| callId | identifier of call. |
| setXref | set of reference. |
- Returns:
- true if exist any call with this callId, otherwise false
| DWORD ASTCallMap::GetNewCallId |
( |
|
) |
[sealed, virtual] |
Generate unique callID
- Returns:
- new CallID
| AsteriskCall * ASTCallMap::GetOrCreateCall |
( |
std::string |
_uniqueId |
) |
|
Get a call with uniqueId specify. Otherwise, create one with a new callID.
- Parameters:
-
- Returns:
- an AsteriskCall with call
| void ASTCallMap::GetSetCallIdByDevice |
( |
std::string |
device, |
|
|
Set_callId & |
setCallId | |
|
) |
| | |
Search all callId that one device can have got
- Parameters:
-
| device | |
| setCallId | set of callId with device specify |
| void ASTCallMap::GetSetDevicesFromCallId |
( |
DWORD |
callId, |
|
|
Set_deviceId & |
setDevices | |
|
) |
| | |
Search set devices with one callId
- Parameters:
-
| callId | |
| setDevices | by reference. |
Walks through Asterisk call map and returns the source/originator call. That call hasn't got sourceUniqueId. we cannot assert there are no oops in the walk so implementation is not recursive. walk limited to MAX_LINKED_CALLS deep by implementation.
- Parameters:
-
- Returns:
- Source AsteriskCall or null if there is one or itself is none
| csta_states ASTCallMap::GetStateOfDevice |
( |
DWORD |
callId, |
|
|
std::string |
deviceId | |
|
) |
| | |
Returns the state of device specify on CSTA call map.
- Parameters:
-
| callId | identifier of the call |
| deviceId | identifier of device |
- Returns:
- string with state of device
Scan if an AsteriskCall has a destination
- Parameters:
-
- Returns:
- true if has destination, otherwise return false
| bool ASTCallMap::IsLocalCall |
( |
DWORD |
callId |
) |
|
Find if a call specify with callId has only local channels
- Parameters:
-
- Returns:
- True if only has local channels. Otherwise return false.
| void ASTCallMap::RemoveCallByUniqueId |
( |
std::string |
uniqueId |
) |
|
Remove m_uniqueId2Asteriskcall map
- Parameters:
-
| void ASTCallMap::RemoveCallFromCallModel |
( |
DWORD |
callId |
) |
|
Removes a call from CSTA call map.
- Parameters:
-
| void ASTCallMap::RemoveConnectionFromCallModel |
( |
DWORD |
callId, |
|
|
std::string |
deviceId | |
|
) |
| | |
Removes a connection from CSTA call map.
- Parameters:
-
| callId | identifier of the call |
| deviceId | identifier of device |
| bool ASTCallMap::RemoveXref |
( |
MonitorXref |
xref |
) |
|
Removes a reference from the monitor map
- Parameters:
-
- Returns:
- true if the reference was removed correctly
The documentation for this class was generated from the following files:
- astprovider/ASTProvider/src/call_map.h
- astprovider/ASTProvider/src/call_map.cpp