示例#1
0
        public KamailioMessageHandlerResult CloseCall(KamailioDialogMessage sipMessage)
        {
            log.Debug("Closing call with id:\"{0}\", hash id:\"{1}\", hash entry:\"{2}\"", sipMessage.CallId, sipMessage.HashId, sipMessage.HashEntry);

            try
            {
                CallInfo call = _callRepository.GetCallInfo(sipMessage.CallId, sipMessage.HashId, sipMessage.HashEntry);

                if (call == null)
                {
                    log.Warn("Unable to find call with call id: {0}, hash id:{1}, hash entry:{2}", sipMessage.CallId, sipMessage.HashId, sipMessage.HashEntry);
                    return(NothingChangedResult);
                }

                if (call.Closed)
                {
                    log.Warn("Call with call id: {0} already closed", sipMessage.CallId);
                    return(NothingChangedResult);
                }

                _callRepository.CloseCall(call.Id);
                return(SipMessageResult(KamailioMessageChangeStatus.CallClosed, call.Id));
            }
            catch (Exception ex)
            {
                log.Error(ex, "Error while closing call with call id: {0}", sipMessage.CallId);
                return(NothingChangedResult);
            }
        }
示例#2
0
        public ActionResult DeleteCall(DeleteCallViewModel model)
        {
            if (model.CallId != Guid.Empty && model.IHaveChecked && model.ImSure)
            {
                _callRepository.CloseCall(model.CallId);
            }

            return(RedirectToAction("Index", "Home"));
        }
示例#3
0
 public void CloseCall(Guid callId)
 {
     _internalRepository.CloseCall(callId);
     // Some registered codecs may have changed state. Reload cache.
     _lazyCache.ClearRegisteredSips();
 }
示例#4
0
 public void CloseCall(Guid callId)
 {
     _internalRepository.CloseCall(callId);
     _lazyCache.ClearOngoingCalls();
 }