michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "CSFLog.h" michael@0: michael@0: #include "CC_Common.h" michael@0: michael@0: #include "CC_SIPCCDeviceInfo.h" michael@0: #include "CC_SIPCCFeatureInfo.h" michael@0: #include "CC_SIPCCCallServerInfo.h" michael@0: #include "CC_SIPCCCall.h" michael@0: #include "CC_SIPCCLine.h" michael@0: michael@0: #include "csf_common.h" michael@0: michael@0: extern "C" michael@0: { michael@0: #include "cpr_types.h" michael@0: #include "ccapi_device.h" michael@0: #include "ccapi_device_info.h" michael@0: } michael@0: michael@0: using namespace std; michael@0: using namespace CSF; michael@0: michael@0: #define MAX_SUPPORTED_NUM_CALLS 100 michael@0: #define MAX_SUPPORTED_NUM_LINES 100 michael@0: #define MAX_SUPPORTED_NUM_FEATURES 100 michael@0: #define MAX_SUPPORTED_NUM_CALL_SERVERS 100 michael@0: michael@0: michael@0: CSF_IMPLEMENT_WRAP(CC_SIPCCDeviceInfo, cc_deviceinfo_ref_t); michael@0: michael@0: CC_SIPCCDeviceInfo::CC_SIPCCDeviceInfo (cc_deviceinfo_ref_t deviceinfo) michael@0: : deviceinfo_ref(deviceinfo) michael@0: { michael@0: CCAPI_Device_retainDeviceInfo(deviceinfo_ref); michael@0: } michael@0: michael@0: CC_SIPCCDeviceInfo::~CC_SIPCCDeviceInfo() michael@0: { michael@0: CCAPI_Device_releaseDeviceInfo(deviceinfo_ref); michael@0: } michael@0: michael@0: string CC_SIPCCDeviceInfo::getDeviceName() michael@0: { michael@0: return CCAPI_DeviceInfo_getDeviceName(deviceinfo_ref); michael@0: } michael@0: michael@0: vector CC_SIPCCDeviceInfo::getCalls () michael@0: { michael@0: vector callsVector; michael@0: michael@0: cc_call_handle_t handles[MAX_SUPPORTED_NUM_CALLS] = {}; michael@0: cc_uint16_t numHandles = csf_countof(handles); michael@0: michael@0: CCAPI_DeviceInfo_getCalls(deviceinfo_ref, handles, &numHandles) ; michael@0: michael@0: for (int i=0; i CC_SIPCCDeviceInfo::getLines () michael@0: { michael@0: vector linesVector; michael@0: michael@0: cc_lineid_t lines[MAX_SUPPORTED_NUM_LINES] = {}; michael@0: cc_uint16_t numLines = csf_countof(lines); michael@0: michael@0: CCAPI_DeviceInfo_getLines(deviceinfo_ref, lines, &numLines) ; michael@0: michael@0: for (int i=0; i CC_SIPCCDeviceInfo::getFeatures () michael@0: { michael@0: vector featuresVector; michael@0: michael@0: cc_featureinfo_ref_t features[MAX_SUPPORTED_NUM_FEATURES] = {}; michael@0: cc_uint16_t numFeatureInfos = csf_countof(features); michael@0: michael@0: CCAPI_DeviceInfo_getFeatures(deviceinfo_ref, features, &numFeatureInfos); michael@0: michael@0: for (int i=0; i CC_SIPCCDeviceInfo::getCallServers () michael@0: { michael@0: vector callServersVector; michael@0: michael@0: cc_callserver_ref_t callServers[MAX_SUPPORTED_NUM_CALL_SERVERS] = {}; michael@0: cc_uint16_t numCallServerInfos = csf_countof(callServers); michael@0: michael@0: CCAPI_DeviceInfo_getCallServers(deviceinfo_ref, callServers, &numCallServerInfos); michael@0: michael@0: for (int i=0; i