jssip - v3.14.0
    Preparing search index...

    Class OutgoingRequest

    Holds a SIP request to be sent.

    Hierarchy (View Summary)

    Index

    Constructors

    • Parameters

      • method: string

        Request method, such as INVITE or BYE.

      • ruri: URI

        Request-URI, so the address the request is sent to.

      • ua: UALike

        The UA that sends the request.

      • Optionalparams: OutgoingRequestParams | null

        Values that take priority over the ones the UA is configured with.

      • OptionalextraHeaders: string[] | null

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

      • Optionalbody: string

        Body of the request, if any.

      Returns OutgoingRequest

      • TypeError if method, ruri or ua is not given.

    Properties

    ua: UALike

    The UA that sends the request.

    headers: Record<string, OutgoingHeaderValue[]>

    Header fields set by the library, indexed by their capitalized name. A header field may appear several times, hence the array.

    method: string

    Request method, such as INVITE or BYE.

    ruri: URI

    The request target URI.

    body?: string

    Body of the request, undefined when it carries none.

    extraHeaders: string[]

    Header fields the application added through the extraHeaders option, each a whole Name: value line written as given.

    Value of the To header field.

    Value of the From header field.

    call_id: string

    Value of the Call-ID header field.

    cseq: number

    The CSeq number.

    sdp?: SDP

    declare makes TypeScript generate no field declaration for these, so they do not become own properties set to undefined on every instance, which is what useDefineForClassFields would otherwise do. sdp is created by parseSDP() and transaction is assigned by Transactions when the request is sent.

    transaction?: ClientTransactionLike | null

    Client transaction the request is sent over, assigned once it is sent.

    Methods

    • Replace the given header field by the given value.

      Parameters

      • name: string

        Header field name, which gets capitalized as it is written in SIP messages.

      • value: OutgoingHeaderValue | OutgoingHeaderValue[]

        A single value or several of them, one per header field line.

      Returns void

      • Any header field of the same name previously added through the extraHeaders option is removed first.
    • Get the value of the first header field of the given name.

      Parameters

      • name: string

      Returns OutgoingHeaderValue | undefined

      undefined if the request has no such header field.

      • Looks in extraHeaders too when the library did not set the header field itself.
    • Whether the request carries a header field of the given name.

      Parameters

      • name: string

      Returns boolean

    • Parse the body of the request as a session description and cache the result in OutgoingRequest.sdp.

      Parameters

      • Optionalforce: boolean

        Parse again even if the body was already parsed.

      Returns SDP

    • The request as it travels on the wire.

      Returns string