예제 #1
0
 void transport_SIPResponseInTraceEvent(SIPEndPoint localEndPoint, SIPEndPoint fromEndPoint, SIPResponse sipResponse)
 {
     Console.WriteLine("Response In: " + localEndPoint + "<-" + fromEndPoint.ToString() + "\n" + sipResponse.ToString());
 }
예제 #2
0
 void transport_SIPResponseOutTraceEvent(SIPEndPoint localEndPoint, SIPEndPoint toEndPoint, SIPResponse sipResponse)
 {
     Console.WriteLine("Response Out: " + localEndPoint + "->" + toEndPoint.ToString() + "\n" + sipResponse.ToString());
 }
예제 #3
0
        public virtual void SendFinalResponse(SIPResponse finalResponse)
        {
            m_transactionFinalResponse = finalResponse;
            UpdateTransactionState(SIPTransactionStatesEnum.Completed);
            string viaAddress = finalResponse.Header.Vias.TopViaHeader.ReceivedFromAddress;

            if (TransactionType == SIPTransactionTypesEnum.Invite)
            {
                FireTransactionTraceMessage("Send Final Response Reliable " + LocalSIPEndPoint.ToString() + "->" + viaAddress + m_crLF + finalResponse.ToString());
                m_sipTransport.SendSIPReliable(this);
            }
            else
            {
                FireTransactionTraceMessage("Send Final Response " + LocalSIPEndPoint.ToString() + "->" + viaAddress + m_crLF + finalResponse.ToString());
                m_sipTransport.SendResponse(finalResponse);
            }
        }
예제 #4
0
        public virtual void SendInformationalResponse(SIPResponse sipResponse)
        {
            FireTransactionTraceMessage("Send Info Response " + LocalSIPEndPoint.ToString() + "->" + this.RemoteEndPoint + m_crLF + sipResponse.ToString());

            if (sipResponse.StatusCode == 100)
            {
                UpdateTransactionState(SIPTransactionStatesEnum.Trying);
            }
            else if (sipResponse.StatusCode > 100 && sipResponse.StatusCode <= 199)
            {
                UpdateTransactionState(SIPTransactionStatesEnum.Proceeding);
            }

            m_sipTransport.SendResponse(sipResponse);
        }
예제 #5
0
        public void GotResponse(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPResponse sipResponse)
        {
            if (m_transactionState == SIPTransactionStatesEnum.Completed || m_transactionState == SIPTransactionStatesEnum.Confirmed)
            {
                FireTransactionTraceMessage("Received Duplicate Response " + localSIPEndPoint.ToString() + "<-" + remoteEndPoint + m_crLF + sipResponse.ToString());

                if (sipResponse.Header.CSeqMethod == SIPMethodsEnum.INVITE)
                {
                    if (sipResponse.StatusCode >= 100 && sipResponse.StatusCode <= 199)
                    {
                        // Ignore info response on completed transaction.
                    }
                    else
                    {
                        ResendAckRequest();
                    }
                }

                TransactionDuplicateResponse?.Invoke(localSIPEndPoint, remoteEndPoint, this, sipResponse);
            }
            else
            {
                FireTransactionTraceMessage("Received Response " + localSIPEndPoint.ToString() + "<-" + remoteEndPoint + m_crLF + sipResponse.ToString());

                if (sipResponse.StatusCode >= 100 && sipResponse.StatusCode <= 199)
                {
                    UpdateTransactionState(SIPTransactionStatesEnum.Proceeding);

                    if (sipResponse.Header.CSeqMethod == SIPMethodsEnum.INVITE)
                    {
                        //ignore the respose of 100 trying
                    }
                    else
                    {
                        TransactionInformationResponseReceived?.Invoke(localSIPEndPoint, remoteEndPoint, this, sipResponse);
                    }
                }
                else
                {
                    m_transactionFinalResponse = sipResponse;
                    UpdateTransactionState(SIPTransactionStatesEnum.Completed);
                    TransactionFinalResponseReceived?.Invoke(localSIPEndPoint, remoteEndPoint, this, sipResponse);
                }
            }
        }