Example #1
0
 /// <summary>
 /// Constuctor.
 /// </summary>
 /// <param name="dialog">The <see cref="SipDialog" />.</param>
 /// <param name="transaction">The <see cref="SipTransaction" /> associated with the event (or <c>null</c>).</param>
 /// <param name="core">The <see cref="SipCore" /> that raised the event.</param>
 /// <param name="clientRequest">Pass the <see cref="SipRequest" /> received for server side dialog creation (or <c>null</c>).</param>
 /// <param name="serverResult">The <see cref="SipResult" /> returned by the server, completing its side of the dialog creation (or <c>null</c>).</param>
 internal SipDialogEventArgs(SipDialog dialog, SipTransaction transaction, SipCore core, SipRequest clientRequest, SipResult serverResult)
 {
     this.Dialog        = dialog;
     this.Transaction   = transaction;
     this.Core          = core;
     this.ClientRequest = clientRequest;
     this.ServerResult  = serverResult;
     this.Response      = null;
 }
Example #2
0
        private NetworkBinding remoteEP;                    // The message source endpoint

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="isRequest"><c>true</c> if the message is a SIP request, false for a response</param>
        /// <param name="sipVersion">The SIP version string (or <c>null</c>).</param>
        internal SipMessage(bool isRequest, string sipVersion)
        {
            this.isRequest         = isRequest;
            this.sipVersion        = sipVersion == null ? "SIP/2.0" : sipVersion.ToUpper();
            this.headers           = new SipHeaderCollection();
            this.contents          = emptyPayload;
            this.sourceTransaction = null;
            this.sourceTransport   = null;
            this.remoteEP          = null;
        }
Example #3
0
        /// <summary>
        /// Performs a deep copy of the internal properties of the message passed
        /// to this instance.
        /// </summary>
        /// <param name="message">The message to be copied.</param>
        internal void CopyFrom(SipMessage message)
        {
            this.isRequest         = message.isRequest;
            this.sipVersion        = message.sipVersion;
            this.sourceTransaction = null;
            this.sourceTransport   = message.sourceTransport;
            this.remoteEP          = message.remoteEP;

            this.contents = null;
            if (message.contents != null)
            {
                this.contents = new byte[message.contents.Length];
                Array.Copy(message.contents, this.contents, message.contents.Length);
            }

            foreach (SipHeader header in message.headers.Values)
            {
                this.headers.Add(header.Name, header.Clone());
            }
        }