jssip - v3.14.0
    Preparing search index...

    Class IncomingMessage

    Holds a received SIP request or response.

    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.

    Methods

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

      Parameters

      Returns void

    • Get the value of the given header name at the first position, or undefined if the header field is not present.

      Parameters

      Returns string | undefined

    • 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

    • Get the header/s of the given name.

      Parameters

      • name: string

      Returns string[]

    • Verify the existence of the given header.

      Parameters

      • name: string

      Returns boolean

    • 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');
      
    • Type Parameters

      • T = unknown

      Parameters

      • name: string
      • Optionalidx: number

      Returns T | undefined

      message.s('via', 3).port;
      
    • Replace every header field of the given name by a single one with the given value.

      Parameters

      • name: string
      • value: string

      Returns void

    • Parse the body of the message as a session description and cache the result in IncomingMessage.sdp.

      Parameters

      • Optionalforce: boolean

        Parse again even if the body was already parsed.

      Returns SDP

    • The message as it arrived on the wire.

      Returns string