jssip - v3.14.0
    Preparing search index...

    Type Alias Configuration

    What a UA is configured with.

    Only Configuration.uri and Configuration.sockets are mandatory. Every other parameter falls back to the default documented on it.

    const ua = new JsSIP.UA({
    uri: 'sip:alice@example.com',
    sockets: new JsSIP.WebSocketInterface('wss://sip.example.com'),
    password: 'secret',
    });
    type Configuration = {
        authorization_user: string | null;
        password: string | null;
        realm: string | null;
        ha1: string | null;
        authorization_jwt: string | null;
        display_name: string | number | null;
        uri: URI | null;
        contact_uri: URI | null;
        instance_id: string | null;
        use_preloaded_route: boolean;
        session_timers: boolean;
        session_timers_refresh_method: string;
        session_timers_force_refresher: boolean;
        no_answer_timeout: number;
        register: boolean;
        register_expires: number;
        register_from_tag_trail: string | (() => string);
        registrar_server: URI | null;
        sockets: WeightedSocket[] | null;
        connection_recovery_max_interval: number;
        connection_recovery_min_interval: number;
        extra_headers: string[] | null;
        via_host: string;
        user_agent?: string;
    }
    Index

    Properties

    authorization_user: string | null

    Username used to authenticate, when it differs from the user part of Configuration.uri.

    null

    password: string | null

    The plain SIP authentication password.

    null

    realm: string | null

    SIP authentication realm.

    null

    ha1: string | null

    HA1 hash of the credentials, for Digest authentication.

    null

    authorization_jwt: string | null

    Token used as authentication credential. Every outgoing request carries an Authorization header field with the Bearer scheme and this value.

    null

    display_name: string | number | null

    Descriptive name shown to the called party when calling or sending messages.

    null

    • It must NOT be enclosed between double quotes, even when it contains multi-byte symbols. The library always encloses it.
    • A number is accepted because a 0 is a legitimate display name, which UA turns into '0'.
    uri: URI | null

    Address of record of the UA, so its SIP address. The only mandatory parameter together with Configuration.sockets.

    null

    contact_uri: URI | null

    URI to be used in the Contact header field.

    null

    • Its host becomes Configuration.via_host. When it is not given, the Contact is built out of via_host instead.
    instance_id: string | null

    UUID identifying this UA instance when using GRUU, announced in the +sip.instance Contact parameter.

    null

    • Accepted with or without the uuid: prefix.
    • A random UUID is used when it is not given.
    use_preloaded_route: boolean

    Whether every initial request carries a Route header field with the SIP URI of the server. Some SIP outbound proxies require it.

    false

    session_timers: boolean

    Whether to run the session timers of RFC 4028, which keep a session alive by refreshing it.

    true

    session_timers_refresh_method: string

    Request method used to refresh a session, either UPDATE or INVITE.

    'UPDATE'

    session_timers_force_refresher: boolean

    Whether to force being the refresher of the session timers of outgoing calls, which adds the refresher=uac parameter to the Session-Expires header field of the initial INVITE.

    false

    no_answer_timeout: number

    Time (in seconds) after which an incoming call is rejected if not answered.

    60

    register: boolean

    Whether to register as soon as the UA starts.

    true

    register_expires: number

    How long (in seconds) a registration lasts before the UA refreshes it.

    600

    register_from_tag_trail: string | (() => string)

    Trail added to the tag of the From header field of each REGISTER request, either a static string or a function returning one.

    ''

    registrar_server: URI | null

    URI of the registrar, which must be a SIP URI without username.

    null

    sockets: WeightedSocket[] | null

    Transports the UA connects through. The only mandatory parameter together with Configuration.uri.

    null

    connection_recovery_max_interval: number

    Maximum interval (in seconds) between transport reconnection attempts.

    30

    connection_recovery_min_interval: number

    Minimum interval (in seconds) between transport reconnection attempts.

    2

    extra_headers: string[] | null

    Custom SIP header fields added to every request and response.

    null

    via_host: string

    Host announced in the sent-by of the Via header field and in the host part of the Contact.

    A random .invalid host name

    user_agent?: string

    Value of the User-Agent header field present in SIP messages. By default JsSIP followed by the code version, as Constants.USER_AGENT gives it.

    • Optional because, unlike every other parameter, it has no default. It only exists once the application configures it.