public async Task <Call> CreateIncomingCall(string from, string to, string url, string method)
        {
            var call = new Call()
            {
                AccountSid     = AccountRepository.GetAccountSid(),
                DateCreated    = DateTime.UtcNow,
                DateUpdated    = DateTime.UtcNow,
                Direction      = "inbound",
                From           = from,
                PhoneNumberSid = await AccountRepository.GetPhoneNumberSid(to),
                Sid            = TwilioUtils.CreateSid("CA"),
                Status         = "ringing",
                To             = to
            };
            await CallRepository.CreateCall(call);

            CallCudOperation?.Invoke(this, new ResourceCudOperationEventArgs <Call>(call, ResourceCudOperation.Create));
            CallHandler(url, method, call.Sid);
            return(call);
        }
Exemple #2
0
        public ActionResult <int> CreateCall(Call call)
        {
            int numberOfAffectedRows = _repository.CreateCall(call);

            return(Ok(numberOfAffectedRows));
        }