UA Configuration Parameters

JsSIP.UA requires a configuration object with mandatory and optional parameters. Example:

var configuration = {
  'ws_servers':         'ws://',
  'uri':                '',
  'password':           'superpassword'

var coolPhone = new JsSIP.UA(configuration);

Full list of configuration parameters below:

Mandatory parameters


SIP URI associated to the User Agent (String). This is a SIP address given to you by your provider.

uri: ""


Set of WebSocket URIs to connect to. If not specified ports 80 and 443 are taken for non secure WebSocket connections and connections over SSL/TLS, respectively. This parameter can be expressed in multiple ways:

  • Single String to define a single WebSocket URI.
  • Array of Strings to define multiple WebSocket URIs.
  • Array of Objects to define multiple WebSocket URIs with weight. URIs with higher weight value are used prior to those with lower value.
ws_servers: "ws://"
ws_servers: "wss://"
ws_servers: [
ws_servers: [
  {ws_uri: "ws://", weight: 10},
  {ws_uri: "ws://", weight: 1}

Optional parameters


Username (String) to use when generating authentication credentials. If not defined the value in uri parameter is used.

authorization_user: "alice123"


Maximum interval (Number) in seconds between WebSocket reconnection attemps. Default value is 30.

connection_recovery_max_interval: 60


Minimum interval (Number) in seconds between WebSocket reconnection attempts. Default value is 2.

connection_recovery_min_interval: 4


Descriptive name (String) to be shown to the called party when calling or sending IM messages. It must NOT be enclosed between double quotes even if the given name contains multi-byte symbols (JsSIP will always enclose the display_name value between double quotes).

display_name: "Alice ¶€ĸøĸø"


Set a random IP address as the host value in the Contact header field and Via sent-by parameter. Useful for SIP registrars not allowing domain names in the Contact URI. Valid values are true and false (Boolean). Default value is a false.

hack_ip_in_contact: true


Set Via transport parameter in outgoing SIP requests to “TCP”. Useful when traversing SIP nodes that are not ready to parse Via headers with “WS” or “WSS” value in a Via header. Valid values are true and false (Boolean). Default value is false.

hack_via_tcp: true


When connecting to a secure WebSocket server (“wss://”) force “WS” as Via transport value instead of “WSS”. Useful when traversing HTTP/WebSocket proxies that act as TLS tunnels. Valid values are true and false (Boolean). Default value is false.

hack_via_ws: true


String indicating the UUID URI to be used as instance ID to identify the UA instance when using GRUU.

instance_id: "uuid:8f1fa16a-1165-4a96-8341-785b1ef24f12"
instance_id: "8f1fa16a-1165-4a96-8341-785b1ef24f12"


Object providing the desired log behavior.


Boolean indicating whether JsSIP should write log messages in the browser console. Default value is true.


Number or String indicating the verbose level of the JsSIP log. Valid values are 3, 2, 1, 0 or "debug", "log", "warn", "error" respectively. Default value is 2 (or log).


User defined Function which will be called everytime a log is generated, according to the enabled and level options.

The function is called with the following semantics:

  level: String representing the level of the log message ('debug', 'log', 'warn', 'error')
  category: String representing the JsSIP instance class firing the log. ie: ''
  label: String indicating the 'identifier' of the class instance when the log level is '3' (debug). ie:
  content: String representing the log message
connector(level, category, label, content);


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

no_answer_timeout: 120


SIP Authentication password (String).

password: "1234"


Indicate if JsSIP User Agent should register automatically when starting. Valid values are true and false (Boolean). Default value is true.

register: false


Registration expiry time (in seconds) (Integer). Default value is 600.

register_expires: 300


Set the SIP registrar URI. Valid value is a SIP URI without username. Default value is null which means that the registrar URI is taken from the uri parameter (by removing the username).

registrar_server: ''


String or Array of Strings indicating the STUN server(s) to use for IP address discovery. Values must include “stun:” or “stuns:” schema. Default value is [""].

stun_servers: ""
stun_servers: ["", ""]
stun_servers: [""]


Indicate whether incoming and outgoing SIP request/responses must be logged in the browser console (Boolean). Default value is false.

trace_sip: true


Object or Array of Objects indicating the TURN server(s) and corresponding username and password to be used for media relay (in case no peer-to-peer media is possible). ‘urls’ (a String or an Array of String) can include “turn:” or “turns” schema. No TURN server is set by default.

turn_servers: { urls:"", username:"turnuser", credential:"turnpassword"}
turn_servers: { urls:["", ""], username:"turnuser", credential:"turnpassword"}
turn_servers: [{ urls:"", username:"turnuser", credential:"turnpassword"}]
turn_servers: [
  { urls:"", username:"turnuser", credential:"turnpassword" },
  { urls:"", username:"turnuser2", credential:"turnpassword2"}


If set to true every SIP initial request sent by JsSIP includes a Route header with the SIP URI associated to the WebSocket server as value. Some SIP Outbound Proxies require such a header. Valid values are true and false (Boolean). Default value is false.

ws_servers: "ws://"
use_preloaded_route: true

The Route header will look like Route: <;lr;transport=ws>

ws_servers: "wss://"
use_preloaded_route: true

The Route header will look like Route: <;lr;transport=ws>