Ejemplo n.º 1
0
        public void SendSIPRequest(SIPRequest sipRequest, string dstSocket)
        {
            //ResetSIPResponse();

            if (sipRequest.Method == SIPMethodsEnum.INVITE)
            {
                //m_inviteRequest = sipRequest;
                UACInviteTransaction inviteTransaction = m_sipTransport.CreateUACTransaction(sipRequest, IPSocket.GetIPEndPoint(dstSocket), m_sipTransport.GetTransportContact(null), SIPProtocolsEnum.UDP);
                inviteTransaction.UACInviteTransactionInformationResponseReceived += new SIPTransactionResponseReceivedDelegate(TransactionInformationResponseReceived);
                inviteTransaction.UACInviteTransactionFinalResponseReceived       += new SIPTransactionResponseReceivedDelegate(TransactionFinalResponseReceived);
                m_sipTransport.SendSIPReliable(inviteTransaction);
            }
            else
            {
                SIPNonInviteTransaction sipTransaction = m_sipTransport.CreateNonInviteTransaction(sipRequest, IPSocket.GetIPEndPoint(dstSocket), m_sipTransport.GetTransportContact(null), SIPProtocolsEnum.UDP);
                sipTransaction.NonInviteTransactionFinalResponseReceived += new SIPTransactionResponseReceivedDelegate(TransactionFinalResponseReceived);
                m_sipTransport.SendSIPReliable(sipTransaction);
            }
        }