private IPAddress localSubnet; // IP subnet mask for the active network adapter /// <summary> /// Constructor. /// </summary> /// <param name="core">The associated <see cref="SipCore" />.</param> /// <param name="settings">The gateway's <see cref="SipMssGatewaySettings" />.</param> public SipMssGateway(SipCore core, SipMssGatewaySettings settings) { this.core = core; this.settings = settings; this.isRunning = false; this.isUsed = false; }
/// <summary> /// Constructs B2BUA event arguments. /// </summary> /// <param name="core">The <see cref="SipCore" /> that raised the event.</param> /// <param name="b2bUserAgent">The <see cref="SipB2BUserAgent{TState}" /> that raised the event.</param> /// <param name="session">The <see cref="SipB2BUASession{TState}" /> associated with the event.</param> internal SipB2BUAEventArgs(SipCore core, SipB2BUserAgent <TState> b2bUserAgent, SipB2BUASession <TState> session) { this.Core = core; this.B2BUserAgent = b2bUserAgent; this.Session = session; }
/// <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; }
/// <summary> /// Constuctor. /// </summary> /// <param name="status">The <see cref="SipStatus" />.</param> /// <param name="response">The received <see cref="SipResponse" /> (or <c>null</c>).</param> /// <param name="transaction">The <see cref="SipClientTransaction" />.</param> /// <param name="dialog">The associated <see cref="SipDialog" /> (or <c>null</c>).</param> /// <param name="agent">The <see cref="SipClientAgent" /> that processed the response.</param> /// <param name="core">The <see cref="SipCore" /> that raised the event.</param> internal SipResponseEventArgs(SipStatus status, SipResponse response, SipClientTransaction transaction, SipDialog dialog, SipClientAgent agent, SipCore core) { this.Status = status; this.Response = response; this.Transaction = transaction; this.Dialog = dialog; this.Agent = agent; this.Core = core; }
/// <summary> /// Constuctor. /// </summary> /// <param name="request">The received <see cref="SipRequest" />.</param> /// <param name="transaction">The associated <see cref="SipServerTransaction" />.</param> /// <param name="dialog">The associated <see cref="SipDialog" /> (or <c>null</c>).</param> /// <param name="agent">The <see cref="SipServerAgent" /> that processed the request.</param> /// <param name="core">The <see cref="SipCore" /> that raised the event.</param> /// <param name="inviteRequest">The original INVITE <see cref="SipRequest" />.</param> internal SipRequestEventArgs(SipRequest request, SipServerTransaction transaction, SipDialog dialog, SipServerAgent agent, SipCore core, SipRequest inviteRequest) { this.Request = request; this.Transaction = transaction; this.Dialog = dialog; this.Agent = agent; this.Core = core; this.InviteRequest = inviteRequest; }
/// <summary> /// Constructs B2BUA event arguments for a received <see cref="SipResponse" />. /// </summary> /// <param name="core">The <see cref="SipCore" /> that raised the event.</param> /// <param name="b2bUserAgent">The <see cref="SipB2BUserAgent{TState}" /> that raised the event.</param> /// <param name="session">The <see cref="SipB2BUASession{TState}" /> associated with the event.</param> /// <param name="receivedResponse">The received <see cref="SipResponse" />.</param> /// <param name="response">The proposed <see cref="SipResponse" /> to be forwarded.</param> internal SipB2BUAEventArgs(SipCore core, SipB2BUserAgent <TState> b2bUserAgent, SipB2BUASession <TState> session, SipResponse receivedResponse, SipResponse response) { Assertion.Test(receivedResponse != null); Assertion.Test(response != null); this.Core = core; this.B2BUserAgent = b2bUserAgent; this.Session = session; this.ReceivedResponse = receivedResponse; this.Response = response; }
/// <summary> /// Initializes a <see cref="SipDialog" /> instance. /// </summary> /// <param name="core">The <see cref="SipCore" /> that owns this dialog.</param> /// <param name="inviteRequest">The INVITE <see cref="SipRequest" /> received by the accepting dialog or being sent by the initiating dialog.</param> /// <param name="localContact">The <see cref="SipContactValue" /> for the local side of the dialog.</param> /// <param name="acceptingTransaction"> /// The initial transaction for INVITE requests received by accepting dialogs or <c>null</c> for /// initiating dialogs. /// </param> /// <param name="state">Derived class specific state (or <c>null</c>).</param> /// <remarks> /// <para> /// Derived classes can override this method to intialize any internal state using information /// from the derived class specific <paramref name="state" /> parameter. /// </para> /// <para> /// For accepting dialog requests, this method expects the <paramref name="inviteRequest" /> to already /// have reasonable <b>Call-ID</b>, <b>To</b>, <b>From</b>, and <b>CSeq</b> headers and the /// <b>From</b> header must have a <b>tag</b> parameter. /// </para> /// <para> /// For initiating dialog requests,this method expects the <paramref name="inviteRequest" /> to already /// have reasonable <b>To</b>, <b>From</b> and headers but the method will generate and assign /// the <b>From</b> header's <b>tag</b> parameter. The method will set a <b>Call-ID</b> header /// if necessary and will always set a new <b>CSeq</b> header. /// </para> /// <para> /// <paramref name="acceptingTransaction"/> must be passed as the server transaction the INVITE /// was received on for accepting dialogs. This will be passed as <c>null</c> for initiating /// dialogs (note that the <see cref="SipClientAgent" /> will eventually set the <see cref="SipDialog.InitiatingTransaction" /> /// property to the initial <see cref="SipClientTransaction" /> just before the transaction /// is started). /// </para> /// <note> /// The derived class MUST call the base <see cref="Initialize" /> method passing the parameters /// before returning. /// </note> /// </remarks> public override void Initialize(SipCore core, SipRequest inviteRequest, SipContactValue localContact, SipServerTransaction acceptingTransaction, object state) { base.Initialize(core, inviteRequest, localContact, acceptingTransaction, state); // $hack(jeff.lill): // // This is a bit of a hack that initializes the downstream dialog to the // server's Session property and also initializes the session's ServerDialog // property. I'm relying on the fact that state is passed as non-null // only when the B2BUA creates the downstream dialog. SipB2BUASession <TState> session = state as SipB2BUASession <TState>; if (session != null) { this.session = session; session.ServerDialog = this; } }
/// <summary> /// Constructor. /// </summary> /// <param name="core">The SIP core that owns this agent.</param> /// <param name="router">The <see cref="ISipMessageRouter" />.</param> public SipClientAgent(SipCore core, ISipMessageRouter router) { this.core = core; this.router = router; }