/// <summary>
     /// Конструктор 'contact' для отправки объекта с полями информации о вызывающем абоненте АТС
     /// </summary>
     /// <param name="entity">сущность 'contact'</param>
     /// <param name="callId">ID звонка</param>
     /// <param name="callDate">Дата события звонка</param>
     /// <param name="userShortNumber">Короткий номер пользователя</param>
     /// <returns>объект с полями информации о вызывающем абоненте АТС</returns>
     private CallerHepler GetCaller(Entity entity, string callId, DateTime callDate, string userShortNumber, Guid phoneCallId)
     {
         CallerHepler callerEntity = new CallerHepler();
         callerEntity.UserShortNumber = userShortNumber;
         callerEntity.CallId = callId;
         callerEntity.DateOfCall = callDate;
         callerEntity.PhoneCallId = phoneCallId;
         callerEntity.ContactId = entity.Id;
         callerEntity.FullName = entity.GetAttributeValue<string>("fullname");
         DateTime birthDateForCheck = entity.GetAttributeValue<DateTime>("birthdate");
         callerEntity.DateOfBirth = birthDateForCheck.Equals(DateTime.MinValue) ? null : birthDateForCheck.ToShortDateString();
         callerEntity.PhoneOfCaller = entity.GetAttributeValue<string>("telephone1");
         callerEntity.Code = 200;
         return callerEntity;
 }
 /// <summary>
 /// Получение сущностей 'contact', 'systemuser', вызов метода cоздания сущности 'Звонок', конструктор для 'contact'
 /// </summary>
 /// <param name="callId">ID звонка</param>
 /// <param name="callDate">Дата события звонка</param>
 /// <param name="caller">№Телефона вызывающего абонента от АТС</param>
 /// <param name="userShortNumber">Короткий номер пользователя, который вызывают от АТС</param>
 /// <returns>сущность 'contact', вызывающего абонента</returns>
 public CallerHepler CreatePhoneCall(string callId, DateTime callDate, string caller, string userShortNumber)
 {
     ResponseHelper response = new ResponseHelper();
     CallerHepler callerEntity = null;
     try
     {
         IOrganizationService service = ConnectToCRM();
         Entity CallerEntites = GetEntities(service, "contact", "telephone1", caller).Entities.FirstOrDefault();
         Entity SystemUserEntites = GetEntities(service, "systemuser", "new_shortnumber", userShortNumber).Entities.FirstOrDefault();
         Guid phoneCallId = CreateActivityEntityPhoneCall(service, callId, callDate, caller, CallerEntites, SystemUserEntites);
         callerEntity = GetCaller(CallerEntites, callId, callDate, userShortNumber, phoneCallId);
         return callerEntity;
     }
     catch (Exception e)
     {
         callerEntity.Code = 500;
         callerEntity.ErrorMessage = e.Message;
         return callerEntity;
     }
 }