public IHttpActionResult PostCallLine(int contactId, CallLine callLine)
        {
            if (!ModelState.IsValid)
                return BadRequest(ModelState);

            var result = _contactService.AddCallLine(contactId, callLine);

            if (result == null)
                return BadRequest();

            return Ok(new
            {
                data = result
            });
        }
        public override void EndCall(
            int siteId, int? contactId, int? leadPersonId, int? occupiedId, string initial, string url, IList<ScriptAction> actions)
        {
            if (string.IsNullOrEmpty(initial))
                throw new Exception("Unable to register a call line due to invalid initial");

            var contact = UnitOfWork.ContactRepository.Get(contactId);
            if (contact != null)
            {
                var today = DateTime.Now;
                var callLine = new CallLine
                {
                    Initial = initial,
                    TimeCreated = today,
                    LastContact = today
                };

                contact.CallLines.Add(callLine);
            }

            base.EndCall(siteId, contactId, leadPersonId, occupiedId, initial, url, actions);
        }