1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/media/webrtc/signaling/src/callcontrol/PhoneDetailsImpl.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,76 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#include "PhoneDetailsImpl.h" 1.9 + 1.10 +#include "csf_common.h" 1.11 + 1.12 +namespace CSF 1.13 +{ 1.14 + 1.15 +PhoneDetailsImpl::PhoneDetailsImpl() 1.16 +: model(-1), 1.17 + state(ServiceStateType::eUnknown) 1.18 +{ 1.19 +} 1.20 + 1.21 +PhoneDetailsImpl::~PhoneDetailsImpl() 1.22 +{ 1.23 +} 1.24 + 1.25 +static const char * _softphoneSupportedModelNames[] = { "Cisco Unified Client Services Framework", 1.26 + "Client Services Framework", 1.27 + "Client Services Core" }; 1.28 + 1.29 +bool PhoneDetailsImpl::isSoftPhone() 1.30 +{ 1.31 + if(model == -1 && modelDescription != "") 1.32 + { 1.33 + // Evaluate based on model description. 1.34 + for(int i = 0; i < (int) csf_countof(_softphoneSupportedModelNames); i++) 1.35 + { 1.36 + if(modelDescription == _softphoneSupportedModelNames[i]) 1.37 + return true; 1.38 + } 1.39 + return false; 1.40 + } 1.41 + else 1.42 + { 1.43 + } 1.44 + return false; 1.45 +} 1.46 + 1.47 +void PhoneDetailsImpl::setName(const std::string& name) 1.48 +{ 1.49 + this->name = name; 1.50 +} 1.51 +void PhoneDetailsImpl::setDescription(const std::string& description) 1.52 +{ 1.53 + this->description = description; 1.54 +} 1.55 +// Note that setting model and model description are mutually exclusive. 1.56 +void PhoneDetailsImpl::setModel(int model) 1.57 +{ 1.58 + this->model = model; 1.59 + this->modelDescription = ""; 1.60 +} 1.61 +void PhoneDetailsImpl::setModelDescription(const std::string& description) 1.62 +{ 1.63 + this->model = -1; 1.64 + this->modelDescription = description; 1.65 +} 1.66 +void PhoneDetailsImpl::setLineDNs(const std::vector<std::string> & lineDNs) 1.67 +{ 1.68 + this->lineDNs.assign(lineDNs.begin(), lineDNs.end()); 1.69 +} 1.70 +void PhoneDetailsImpl::setServiceState(ServiceStateType::ServiceState state) 1.71 +{ 1.72 + this->state = state; 1.73 +} 1.74 +void PhoneDetailsImpl::setConfig(const std::string& config) 1.75 +{ 1.76 + this->config = config; 1.77 +} 1.78 + 1.79 +}