Пример #1
0
        public void ProcessResponse(SipResponseEvent responseEvent)
        {
            EventAggregator.Instance.Publish(new LogEvent("<<<< [RECEIVED RESPONSE]" + SipFormatter.FormatMessageEnvelope(responseEvent.Response)));

            if (_siplistener != null)
            {
                _siplistener.ProcessResponse(responseEvent);
            }
        }
Пример #2
0
        public void ProcessResponse(SipResponseEvent responseEvent)
        {
            var statusCode = responseEvent.Response.StatusLine.StatusCode;

            if (_logger.IsDebugEnabled)
            {
                _logger.Debug("Dialog[Id={0}] received a response[StatusCode={1}]. Verifying if response is targetted to this Dialog...", GetId(), statusCode);
            }

            var match = State == DialogState.Null ? IsMatchByFirstTransaction(responseEvent) : IsMatchByDialogId(responseEvent.Response);

            if (_logger.IsDebugEnabled)
            {
                _logger.Debug("Response does {0} match.", match ? "" : "NOT");
            }

            var r = new DialogResult();

            r.InformToUser = true;

            if (match)
            {
                if (_logger.IsDebugEnabled)
                {
                    _logger.Debug("Setting the Dialog on responseEvent.");
                }

                responseEvent.Dialog = this;

                /*moved invocation out of ctx, to here. ctx now invokes ProcessResponse*/
                SetLastResponse(responseEvent.Response);

                ProcessResponseOverride(r, responseEvent);
            }

            if (r.InformToUser)
            {
                /*forward TODO: check rfc*/
                _listener.ProcessResponse(responseEvent);
            }
        }