edgeport - v1.0.3
    Preparing search index...

    Interface SipSession

    A live SIP user agent bound to one TCP/TLS connection.

    Obtain one from connect. A background pump reads messages, matches responses to requests, routes inbound requests, and answers keep-alive pings. It is an AsyncDisposable.

    1.0.3

    interface SipSession {
        localUri: string;
        "[asyncDispose]"(): PromiseLike<void>;
        close(): Promise<void>;
        invite(target: string): Promise<SipChat>;
        message(
            to: string,
            body: string,
            opts?: { contentType?: string; headers?: Record<string, string> },
        ): Promise<SipResponse>;
        messages(): AsyncIterable<SipInboundMessage>;
        options(target?: string): Promise<OptionsResult>;
        register(opts?: { expiresSeconds?: number }): Promise<void>;
        subscribePresence(
            target: string,
            opts?: { expiresSeconds?: number },
        ): Promise<PresenceSubscription>;
        unregister(): Promise<void>;
    }

    Hierarchy

    • AsyncDisposable
      • SipSession
    Index
    localUri: string

    Our address-of-record, sip:username@domain.

    • Returns PromiseLike<void>

    • Unregisters (best-effort) and closes the connection.

      Returns Promise<void>

    • Places an INVITE offering an MSRP message session, and on answer opens the MSRP chat.

      Parameters

      • target: string

        The callee URI.

      Returns Promise<SipChat>

      The established chat.

      If the callee declines or offers no MSRP answer.

    • Sends a pager-mode MESSAGE (RFC 3428) to a target AOR.

      Parameters

      • to: string

        The recipient (sip:bob@domain or a bare bob).

      • body: string

        The message text.

      • Optionalopts: { contentType?: string; headers?: Record<string, string> }

        Optional content type (default text/plain) and extra headers.

      Returns Promise<SipResponse>

      The final response (200/202 on success).

      If the credentials are rejected.

      On a non-2xx result.

    • Probes a target's capabilities with OPTIONS.

      Parameters

      • Optionaltarget: string

        The target URI, or the server itself when omitted.

      Returns Promise<OptionsResult>

      The status and advertised Allow/Accept sets.

    • Registers the AOR with RFC 5626 outbound so inbound requests arrive on this connection, authenticating if challenged, and keeps it refreshed until unregister / close.

      Parameters

      • Optionalopts: { expiresSeconds?: number }

        Optional expiry override.

      Returns Promise<void>

      Resolves once the registrar returns 200.

      If the credentials are rejected.

      On a non-2xx registration failure.

    • Subscribes to a target's presence (SUBSCRIBE + NOTIFY, PIDF).

      Parameters

      • target: string

        The presentity URI.

      • Optionalopts: { expiresSeconds?: number }

        Optional expiry.

      Returns Promise<PresenceSubscription>

      A subscription whose iterator yields notifications.

    • Removes the registration (REGISTER with Expires: 0).

      Returns Promise<void>

      Resolves once the registrar acknowledges.