public VoipPhone BuyNumber(string number) { if (!CRMSecurity.IsAdmin) { throw CRMSecurity.CreateSecurityException(); } var newPhone = VoipProvider.BuyNumber(number); VoipProvider.CreateQueue(newPhone); SetDefaultAudio(newPhone); VoipProvider.UpdateSettings(newPhone); return(DaoFactory.VoipDao.SaveOrUpdateNumber(newPhone)); }
public VoipPhone LinkNumber(string id) { if (!CRMSecurity.IsAdmin) { throw CRMSecurity.CreateSecurityException(); } var newPhone = VoipProvider.GetPhone(id); VoipProvider.CreateQueue(newPhone); SetDefaultAudio(newPhone); VoipProvider.UpdateSettings(newPhone); return(DaoFactory.GetVoipDao().SaveOrUpdateNumber(newPhone)); }