public IHttpActionResult RequestCall(CallRequestDTO callRequestDTO)
 {
     if (callRequestDTO == null)
     {
         return(BadRequest());
     }
     try
     {
         var response = callRequestDSL.SendCallRequest(callRequestDTO);
         return(Ok(response));
     }
     catch (Exception ex)
     {
         return(InternalServerError(ex));
     }
 }
 public CallAckDTO SendCallRequest(CallRequestDTO callRequestDTO)
 {
     try
     {
         if (callRequestDTO.UserId == null || callRequestDTO.CalleeId == null)
         {
             throw new InvalidOperationException();
         }
         Request request = new Request()
         {
             CalleeId    = callRequestDTO.CalleeId,
             UserId      = callRequestDTO.UserId,
             Image       = callRequestDTO.Image,
             Latitude    = callRequestDTO.Latitude,
             Longitude   = callRequestDTO.Longitude,
             Message     = callRequestDTO.Message,
             RequestTime = DateTime.Now,
             ID          = 0
         };
         rashedEntities.Requests.Add(request);
         rashedEntities.SaveChanges();
         return(new CallAckDTO()
         {
             Data = new CallAckDataDTO()
             {
                 CalleeId = callRequestDTO.CalleeId,
                 UserId = callRequestDTO.UserId,
                 OperationNo = request.ID
             },
             Status = new StatusDTO()
             {
                 Message = "Message Sent Successfully",
                 Type = MessageTypeEnum.Success.GetHashCode()
             }
         });
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }