public async static Task<LG.Data.Models.Clinical.AudioCallList> GetCallAssociatedWithConsultation(Int32 consultationId) { var result = new LG.Data.Models.Clinical.AudioCallList(); var client = ClientConnection.GetIVRAudio_Connection(); try { client.Open(); var response = await client.GetCallsAssociatedWithConsultationAsync(new GetCallsAssociatedWithConsultationRequest() { MessageGuid = Guid.NewGuid(), ConsultationID = consultationId }); result.ListOfCalls = response.ListOfCallInfo.ToList();result.IsError = response.ReturnStatus.IsError; } catch (Exception ex) { client.Abort(); result.IsError = true; result.Message = ex.ToString(); } finally { if (client.State != CommunicationState.Closed) { client.Close(); } } return result; }
public async static Task <LG.Data.Models.Clinical.AudioCallList> GetCallAssociatedWithConsultation(Int32 consultationId) { var result = new LG.Data.Models.Clinical.AudioCallList(); var client = ClientConnection.GetIVRAudio_Connection(); try { client.Open(); var response = await client.GetCallsAssociatedWithConsultationAsync(new GetCallsAssociatedWithConsultationRequest() { MessageGuid = Guid.NewGuid(), ConsultationID = consultationId }); result.ListOfCalls = response.ListOfCallInfo.ToList(); result.IsError = response.ReturnStatus.IsError; } catch (Exception ex) { client.Abort(); result.IsError = true; result.Message = ex.ToString(); } finally { if (client.State != CommunicationState.Closed) { client.Close(); } } return(result); }