jssip - v3.14.0
    Preparing search index...

    Class IncomingRequest

    Holds a received SIP request.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    data: string

    The message as it arrived on the wire.

    Header fields of the message, indexed by their capitalized name. Each entry keeps the raw value and, once read, its parsed form.

    method: string

    Method of the incoming SIP message. For a response, the method of the request it answers.

    via?: ViaHeader

    Value of the topmost Via header field.

    via_branch?: string

    Branch parameter of the topmost Via header field, which identifies the transaction.

    call_id?: string

    Value of the Call-ID header field.

    cseq?: number

    Sequence number of the CSeq header field.

    Value of the From header field of the incoming SIP message.

    from_tag?: string | null

    Tag parameter of the From header field.

    Value of the To header field of the incoming SIP message.

    to_tag?: string | null

    Tag parameter of the To header field.

    body: string

    Body of the SIP message, an empty string when it carries none.

    sdp: SDP | null

    Body parsed as a session description, null until IncomingMessage.parseSDP is called.

    session_expires?: number

    Interval (in seconds) of the Session-Expires header field, only set when the message carries one.

    session_expires_refresher?: string

    Refresher parameter of the Session-Expires header field, so which side refreshes the session. Only set when the message carries one.

    refer_to?: NameAddrHeader

    Value of the Refer-To header field, only set when the message carries one.

    replaces?: ReplacesHeader

    Value of the Replaces header field, only set when the message carries one.

    event?: EventHeader

    Value of the Event header field, only set when the message carries one.

    ua: UALike

    The UA that received the request.

    ruri: URI

    Request URI of the SIP message.

    transport: Transport | null

    Transport the request arrived through, null until the UA routes it.

    server_transaction: ServerTransactionLike | null

    Server transaction the request belongs to, null until the UA creates it.

    Methods

    • Parse the given header on the given index, caching the result. Returns undefined if the header field is not present or cannot be parsed.

      Type Parameters

      • T = unknown

      Parameters

      Returns T | undefined

    • Insert a header of the given name and value into the last position of the header array.

      Parameters

      • name: string
      • value: string

      Returns void

    • Get the value of the given header name at the given position.

      Parameters

      • name: string

      Returns string | undefined

    • Parse the header field of the given name at the given position.

      Type Parameters

      • T = unknown

      Parameters

      • name: string

        Header field name.

      • idx: number = 0

        Position among the header fields of that name.

      Returns T | undefined

      undefined if the message has no such header field or it cannot be parsed.

      • The result is cached, so parsing the same header field again is cheap.
      const event = message.parseHeader<EventHeader>('event');
      
    • Replace every header field of the given name by a single one with the given value.

      Parameters

      • name: string
      • value: string

      Returns void

    • Answer the request through its server transaction, so that the response is retransmitted as the transaction requires.

      Parameters

      • code: number

        Status code of the response, between 100 and 699.

      • Optionalreason: string | null

        Reason phrase. The one Constants.REASON_PHRASE gives for the status code when not given.

      • OptionalextraHeaders: string[] | null

        Whole Name: value header field lines to add to the response.

      • Optionalbody: string | null

        Body of the response, if any.

      • OptionalonSuccess: () => void

        Called once the response has been sent.

      • OptionalonFailure: () => void

        Called if the response could not be sent.

      Returns void

      • TypeError if code is not between 100 and 699.
      request.reply(486); // Busy Here
      
    • Answer the request straight over the transport, without a server transaction, so the response is sent once and never retransmitted.

      Parameters

      • code: number | null = null

        Status code of the response, between 100 and 699.

      • reason: string | null = null

        Reason phrase. The one Constants.REASON_PHRASE gives for the status code when not given.

      Returns void

      • TypeError if code is not between 100 and 699.
      • Used for requests the UA rejects before creating a transaction for them, such as those that fail the sanity checks.