private void InDialogueTransactionInfoResponseReceived(SIPEndPoint localSIPEndPoint, SIPEndPoint remoteEndPoint, SIPTransaction sipTransaction, SIPResponse sipResponse)
{
SIPDialogue dialogue = GetDialogue(sipResponse.Header.CallId, sipResponse.Header.From.FromTag, sipResponse.Header.To.ToTag);
string owner = (dialogue != null) ? dialogue.Owner : null;
try
{
// Lookup the originating transaction.
SIPTransaction originTransaction = m_sipTransport.GetTransaction(m_inDialogueTransactions[sipTransaction.TransactionId]);
SIPResponse response = sipResponse.Copy();
response.Header.Vias = originTransaction.TransactionRequest.Header.Vias;
response.Header.To = originTransaction.TransactionRequest.Header.To;
response.Header.From = originTransaction.TransactionRequest.Header.From;
response.Header.CallId = originTransaction.TransactionRequest.Header.CallId;
response.Header.CSeq = originTransaction.TransactionRequest.Header.CSeq;
response.Header.Contact = SIPContactHeader.CreateSIPContactList(new SIPURI(originTransaction.TransactionRequest.URI.Scheme, localSIPEndPoint));
response.Header.RecordRoutes = null; // Can't change route set within a dialogue.
response.Header.UserAgent = m_userAgentString;
Log_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.DialPlan, "Forwarding in dialogue response from " + remoteEndPoint + " " + sipResponse.Header.CSeqMethod + " " + sipResponse.StatusCode + " " + sipResponse.ReasonPhrase + " to " + response.Header.Vias.TopViaHeader.ReceivedFromAddress + ".", owner));
// Forward the response back to the requester.
originTransaction.SendInformationalResponse(response);
}
catch (Exception excp)
{
Log_External(new SIPMonitorConsoleEvent(SIPMonitorServerTypesEnum.AppServer, SIPMonitorEventTypesEnum.Error, "Exception processing in dialogue " + sipResponse.Header.CSeqMethod + " info response. " + excp.Message, owner));
}
}