Example #1
0
void CUserProfile::callContact( const std::string& contactId )
{
	Contact* contact = getCContactList().getContactById( contactId );

	if ( contact )
	{
		//VOXOX - CJC - 2009.06.23 Fix bug not calling voxox contact
		if ( contact->getPreferredIMContact()->isIMAccountVoxOx() )
		{
			//VOXOX - JRT - 2009.09.24 - TODO: Reversed logic?  This prevents block of code prevents retrieval of SIP number for this contact.
			//								   Most of this logic already exists in makeContactCallThreadSafe(), which is called by makeContactCall()
			if ( contact->getVoxOxPhone().empty() )
			{
				makeContactCall( contactId );
			}
			else
			{
				makeCall( contact->getPreferredNumber());	//VOXOX - CJC - 2009.06.11 
			}
		}
		else if(contact->getQtIMProtocol() == QtEnumIMProtocol::IMProtocolSkype){
			makeContactCall(contactId);
		}
		else
		{
			if ( contact->getTelephones().hasValid() )
			{
				makeCall( contact->getPreferredNumber());	//VOXOX - CJC - 2009.06.11 
			}
		}
	}
}
Example #2
0
void CUserProfile::makeContactCallThreadSafe(std::string contactId) {
	Contact * contact = _cContactList.getContact(contactId);
	
	if (contact) 
	{
		//VOXOXCHANGE CJC CALL VOXOX NUMBERS
		if(contact->getIsIMAccountVoxox())
		{
			//We don't get the number if we already have it//TODO CHANGE THIS IF NUMBERS ARE CHANGED FREQUENTLY
			if(!contact->getVoxOxPhone().empty())
			{
				EnumMakeCallError::MakeCallError error = _userProfile.makeCall(*contact);
				if (error != EnumMakeCallError::NoError) 
				{
					makeCallErrorEvent(*this, error, contact->getVoxOxPhone());//VOXOX CHANGE by Rolando - 2009.05.29 - added parameter phonenumber to check what call failed
				}
			}
			else
			{
				if(_userProfile.getWsContactNumber())
				{
					WsContactNumber & wsContactNumber = *_userProfile.getWsContactNumber();
					wsContactNumber.setContactId(contact->getKey());
					wsContactNumber.contactNumberEvent +=	boost::bind(&CUserProfile::contactNumberEventHandler, this, _1, _2, _3);
					wsContactNumber.execute();
				}
			}	

		}else if(contact->getQtIMProtocol() == QtEnumIMProtocol::IMProtocolSkype){
			_userProfile.makeCall(*contact);
		}
		else
		{
			EnumMakeCallError::MakeCallError error = _userProfile.makeCall(*contact);
			if (error != EnumMakeCallError::NoError) 
			{
				makeCallErrorEvent(*this, error, contactId);//VOXOX CHANGE by Rolando - 2009.05.29 - added parameter contactId to check what call failed
			}
		}
	}
	else
	{
		makeCallErrorEvent(*this, EnumMakeCallError::ContactNotFound, contactId);//VOXOX CHANGE by Rolando - 2009.05.29 - added parameter contactId to check what call failed
	}
}