Пример #1
0
        /// <summary>
        /// Creates an identical copy of the SIP Request for the caller.
        /// </summary>
        /// <returns>New copy of the SIPRequest.</returns>
        public SIPRequest Copy()
        {
            SIPRequest copy = new SIPRequest();

            copy.SIPVersion = SIPVersion;
            //copy.SIPMajorVersion = m_sipMajorVersion;
            //copy.SIPMinorVersion = m_sipMinorVersion;
            copy.Method        = Method;
            copy.UnknownMethod = UnknownMethod;
            copy.URI           = URI?.CopyOf();
            copy.Header        = Header?.Copy();
            copy.Body          = Body;

            if (ReceivedRoute != null)
            {
                copy.ReceivedRoute = new SIPRoute(ReceivedRoute.URI, !ReceivedRoute.IsStrictRouter);
            }

            copy.Created                  = Created;
            copy.LocalSIPEndPoint         = LocalSIPEndPoint?.CopyOf();
            copy.RemoteSIPEndPoint        = RemoteSIPEndPoint?.CopyOf();
            copy.SendFromHintChannelID    = SendFromHintChannelID;
            copy.SendFromHintConnectionID = SendFromHintConnectionID;

            return(copy);
        }
Пример #2
0
        /// <summary>
        /// Creates an identical copy of the SIP Request for the caller.
        /// </summary>
        /// <returns>New copy of the SIPRequest.</returns>
        public SIPRequest Copy()
        {
            SIPRequest copy = new SIPRequest();

            copy.SIPVersion    = SIPVersion;
            copy.Method        = Method;
            copy.UnknownMethod = UnknownMethod;
            copy.URI           = URI?.CopyOf();
            copy.Header        = Header?.Copy();

            if (_body != null && _body.Length > 0)
            {
                copy._body = new byte[_body.Length];
                Buffer.BlockCopy(copy._body, 0, copy._body, 0, copy._body.Length);
            }

            if (ReceivedRoute != null)
            {
                copy.ReceivedRoute = new SIPRoute(ReceivedRoute.URI, !ReceivedRoute.IsStrictRouter);
            }

            copy.Created                  = Created;
            copy.LocalSIPEndPoint         = LocalSIPEndPoint?.CopyOf();
            copy.RemoteSIPEndPoint        = RemoteSIPEndPoint?.CopyOf();
            copy.SendFromHintChannelID    = SendFromHintChannelID;
            copy.SendFromHintConnectionID = SendFromHintConnectionID;

            return(copy);
        }
Пример #3
0
        /// <summary>
        /// Creates an identical copy of the SIP Response for the caller.
        /// </summary>
        /// <returns>New copy of the SIPResponse.</returns>
        public SIPResponse Copy()
        {
            SIPResponse copy = new SIPResponse();

            copy.SIPVersion      = SIPVersion;
            copy.Status          = Status;
            copy.StatusCode      = StatusCode;
            copy.ReasonPhrase    = ReasonPhrase;
            copy.Header          = Header?.Copy();
            copy.SIPEncoding     = SIPEncoding;
            copy.SIPBodyEncoding = SIPBodyEncoding;

            if (_body != null && _body.Length > 0)
            {
                copy._body = new byte[_body.Length];
                Buffer.BlockCopy(copy._body, 0, copy._body, 0, copy._body.Length);
            }

            copy.Created                  = Created;
            copy.LocalSIPEndPoint         = LocalSIPEndPoint?.CopyOf();
            copy.RemoteSIPEndPoint        = RemoteSIPEndPoint?.CopyOf();
            copy.SendFromHintChannelID    = SendFromHintChannelID;
            copy.SendFromHintConnectionID = SendFromHintConnectionID;

            return(copy);
        }
Пример #4
0
        /// <summary>
        /// Creates an identical copy of the SIP Response for the caller.
        /// </summary>
        /// <returns>New copy of the SIPResponse.</returns>
        public SIPResponse Copy()
        {
            SIPResponse copy = new SIPResponse();

            copy.SIPVersion               = SIPVersion;
            copy.Status                   = Status;
            copy.StatusCode               = StatusCode;
            copy.ReasonPhrase             = ReasonPhrase;
            copy.Header                   = Header?.Copy();
            copy.Body                     = Body;
            copy.Created                  = Created;
            copy.LocalSIPEndPoint         = LocalSIPEndPoint?.CopyOf();
            copy.RemoteSIPEndPoint        = RemoteSIPEndPoint?.CopyOf();
            copy.SendFromHintChannelID    = SendFromHintChannelID;
            copy.SendFromHintConnectionID = SendFromHintConnectionID;

            return(copy);
        }