.. _account-xml:
===========
Account XML
===========
SIP Accounts are specified in an XML format, where SIP credentials and various other options are specified. Below is the
description of the recognized XML nodes and their possible values.
.. contents::
:local:
Credentials
-----------
``title``
=========
.. code-block:: xml
Account Title
:Default: empty
:Description: The title of the account. It is shown at various places in the GUI and it must have a non-empty value.
It is normally populated from Cloud Softphone portal or filled-in by user in the edit account forms. In
case you set the value via provisioning, make sure it's not empty, otherwise the account validation will
fail and the account won't be saved.
``username``
============
.. code-block:: xml
johndoe
:Default: No default value
:Description: SIP user name
``password``
============
.. code-block:: xml
secretPhrase
:Default: No default value
:Description: SIP password
``cloud_username`` and ``cloud_password``
=========================================
.. code-block:: xml
johndoe@company.orgsecretPhrase2
:Default: No default value
:Description: Many providers prefer to use different credentials to log in to the app than for the SIP credentials.
If you return values for these, they can be used for authorizing external provisioning requests or other web service request as described here
:ref: `client-api-intro`.
``userDisplayName``
===================
.. code-block:: xml
John Doe
:Default: empty string
:Description: SIP display user name, comes quoted in front of SIP uri.
``authUsername``
================
.. code-block:: xml
johndoe
:Default: empty string
:Description: Username used in SIP authorization headers. If left empty, the username is used.
``host``
========
.. code-block:: xml
sip.example.com[:port]
:Default: No default value.
:Description: SIP domain, used in SIP URIs as ``username@host``. The SIP domain is also used as a SIP server to connect
to, in case ```` is not specified. If no port is specified, 5060 is the default for non-encrypted
transports, 5061 for tls transports.
``transport``
=============
.. code-block:: xml
udp
:Default: ``udp``
:Valid values: ``udp``, ``tcp``, ``tls`` and ``tls+sip:``
:Description: The transport protocol to use when communicating with SIP server. Transport ``tls`` uses sips: URIs in
headers and the traffic is protected by TLS. ``tls+sip:`` is also TLS-protected, but uses sip: URIs.
``userCallerId``
================
.. code-block:: xml
John Doe
:Default: empty string
:Description: If set, this value will be sent in the ``From:`` field in outgoing ``INVITE`` requests. In case it's left
empty, username will be used.
``expires``
===========
.. code-block:: xml
600
:Default: 600
:Valid values: integer larger or equal to 30
:Description: value for the Expires: header in SIP REGISTER packet.
.. note::
Servers may reject registration with too low value in Expires: header and negotiate a higher value.
.. warning::
If you're using Acrobits Cloud solution for incoming calls, the Acrobits' Sipis servers may reject/ban instances that require
an expiration interval shorter than ``300`` seconds.
Ask an Acrobits representative about the option of hosting your own Sipis servers in case your deployment requires a more frequent registration refresh.
``subscriptionExpires``
===========
.. code-block:: xml
300
:Default: 300
:Valid values: integer larger or equal to 30
:Description: value for the Expires: header in SUBSCRIBE packets.
``allowMessage``
================
.. code-block:: xml
1
:Default: ``0``
:Valid values: ``0`` and ``1``
:Description: When set, ``MESSAGE`` will be added to the ``Allow:`` list in ``SIP REGISTER`` packets.
SIP/SIMPLE messaging won't work without this set.
SIPIS
-----
``sipisHost``
=============
.. code-block:: xml
sipis.example.com
:Default: ``sipis.acrobits.cz``
:Valid values: domain name or IP address
:Description: Specifies the SIPIS server which the app should connect to.
``sipisRegServer``
==================
.. code-block:: xml
sipis.example.com
:Default: ``reg.acrobits.cz``
:Valid values: domain name or IP address
:Description: Specifies the server which the app will use to transfer the account credentials to SIPIS. Typically it
will be the same address as in ``sipisHost``
``sipisHostPrefixLength``
=========================
.. code-block:: xml
0
:Default: ``1``
:Valid values: nonnegative integer values
:Description: Used for load-balancing of SIPIS servers. In case it's greater than zero, the actual ``sipisHost`` value is
constructed by prefixing ``s-X.`` to address in ``sipisHost``. The X is taken from account selector, which is
SHA1(username:password:host). The value in sipisHostPrefixLength specifies how many letters from the
hex-digit representation of selector to use. For example, with sipisHostPrefixLength=1, the app will use
servers ``s-0.sipis.example.com`` - ``s-F.sipis.example.com``. You will need to set up the DNS and deploy
multiple SIPIS servers to make load balancing work.
.. note::
Note that the default value is ``1``. If you want to use a single SIPIS server (which is OK for
up to 20,000 users on any reasonable machine), you will need to set this explicitly to ``0``.
Proxies
-------
``proxy``
=========
.. code-block:: xml
proxy.example.com[:port]
:Default: empty string
:Description: Address of SIP proxy server to connect to. If no port is specified, 5060 is used.
``outboundProxy_enabled``
=========================
.. code-block:: xml
0
:Default: empty string
:Description: when set to 1, all SIP traffic is routed through ``outboundProxy_host`` using ``outboundProxy_transport``
``outboundProxy_host``
======================
.. code-block:: xml
proxy.example.com[:port]
:Default: empty string
:Description: Address through which all SIP traffic is routed. If no port is specified, 5060 is used. outboundProxy_enabled
needs to be set to ``1`` for this option to take effect.
``outboundProxy_transport``
===========================
.. code-block:: xml
udp
:Default: udp
:Description: Transport to use for outboud proxy. All values described in ``transport`` field may be used.
outboundProxy_enabled needs to be set to ``1`` for this option to take effect.
.. note::
The final address of the SIP server is determined as follows:
- **if** outbound proxy is enabled and its host is filled it, all traffic is routed through it
- **if** ```` is empty, ``address = ``, otherwise ``address = ``
- **if** address is not numeric (a.b.c.d) and port is not specified in address, do a SRV DNS resolution for
``_sip._udp.address`` (or ``_sip._tcp.address``, depending on the transport used)
- **if** SRV record exists, ``address = DNSResultAddress:DNSResultPort``
- **else** use address
Voicemail
---------
``voiceMailNumber``
===================
.. code-block:: xml
*69
:Default: empty string
:Description: The number which is dialed when the "voice mail" button is pressed.
``subscribeForVoicemail``
=========================
.. code-block:: xml
1
:Default: ``0``
:Valid values: ``1`` or ``0``
:Description: Set to send ``SUBSCRIBE`` for voice mail
``pushVoicemail``
=========================
.. code-block:: xml
1
:Default: ``0``
:Valid values: ``1`` or ``0``
:Description: Set to 1 if you want new voicemails reported to SIPIS to trigger a push notification to the device.
Audio Codecs
------------
``codecOrder``
==============
.. code-block:: xml
103,9,0,8,18,102,3
:Default: 103,9,0,8,18,102,3
:Valid values: comma separated list of codec numbers.
:Description: The order of codecs, as it will be offered in SDP for calls made over Wifi network.
Supported codecs are:
::
0 : G711 μ-law
3 : GSM
8 : G711 a-law
9 : G722 wideband codec
102 : iLBC
18 : G729
103 : Opus
``codecOrder3G``
================
.. code-block:: xml
18,103,102,3,9,0,8
:Default: 18,103,102,3,9,0,8
:Valid values: comma separated list of codec numbers.
:Description: The order of codecs, as it will be offered in SDP for calls made over cellular network. See the
`codecOrder`_ field above for the list of valid codec payloads.
``honorTheirCodecListWiFi``
===========================
.. code-block:: xml
0
:Default: ``1``
:Valid values: ``0`` or ``1``
:Description: Forces the application to use the first codec offered by the remote side for calls over Wifi
``honorTheirCodecList3G``
=========================
.. code-block:: xml
0
:Default: ``0``
:Valid values: ``0`` or ``1``
:Description: Forces the application to use the first codec offered by the remote side for calls over 3G
.. warning::
It's not recommended to change `honorTheirCodecList3G`_ and `honorTheirCodecListWiFi`_ defaults.
.. note::
Consider an incoming INVITE with codecs "0,18" in SDP. SIP account is configured with `codecOrder`_ set to
"0,18" and `codecOrder3G`_ "18,0".
If we're on cellular network, it makes sense to ignore the remote's preference of codec "0" (μ-law), because
we know our bandwidth is limited. This is why `honorTheirCodecList3G`_ if ``0`` by default - with this
setting, we pick the first codec on our list, which is also supported by the remote side ("18"-G.729)
On the other hand, when on wifi connection, we assume that we have enough bandwidth to honor the remote's
preference, therefore the default value is ``1``.
``ptime``
=========
.. code-block:: xml
20
:Default: 20
:Description: packet time in milliseconds, to be used with WiFi codec set.
``ptime3G``
===========
.. code-block:: xml
30
:Default: 30
:Description: packet time in milliseconds, to be used with 3G codec set.
``forcePtime``
==============
.. code-block:: xml
0
:Default: ``0``
:Valid values: ``0`` or ``1``
:Description: If set to ``1``, the `ptime`_ parameter will be used even if the remote side requests a different value.
``forcePtime3G``
================
.. code-block:: xml
0
:Default: ``0``
:Valid values: ``0`` or ``1``
:Description: If set to ``1``, the `ptime3G`_ parameter will be used even if the remote side requests a different value.
Opus codec options
------------------
Opus codec parameters may be fine-tuned via several keys. The keys start either with `opusOptions.` or `opusOptions3G.` for WiFi or cellular calling respectively.
You can either just set the `opusOptions.class`_ which can be ``nb`` for narrowband, ``wb`` for wideband, or ``fb`` for fullband.
Alternatively you can finetune all the opus parameters.
In this case the `opusOptions.class`_ parameter need to be set to the empty string. Then you can set `opusOptions.bandwidth`_, `opusOptions.complexity`_, `opusOptions.bitrate`_, `opusOptions.fec`_, `opusOptions.vbr`_, `opusOptions.dtx`_, and `opusOptions.expectedPacketLoss`_.
Example:
.. code-block:: xml
nb
or
fb5300000100
``opusOptions.class``
================================================
.. code-block:: xml
wbnb
:Default: ``wb``
:Valid values: ``nb``, ``wb``, ``fb`` or empty string
:Description: If set to ``nb``, it's equivalent to setting:
- `opusOptions.bandwidth`_ to ``nb``
- `opusOptions.complexity`_ to empty string
- `opusOptions.bitrate`_ to ``15500``
- `opusOptions.fec`_ to ``1``
- `opusOptions.dtx`_ to ``1``
- `opusOptions.vbr`_ to ``1``
- `opusOptions.expectedPacketLoss`_ to ``5``
If set to ``wb``, it's equivalent to setting:
- `opusOptions.bandwidth`_ to ``wb``
- `opusOptions.complexity`_ to empty string
- `opusOptions.bitrate`_ to ``24000``
- `opusOptions.fec`_ to ``1``
- `opusOptions.dtx`_ to ``1``
- `opusOptions.vbr`_ to ``1``
- `opusOptions.expectedPacketLoss`_ to ``5``
If set to ``fb``, it's equivalent to setting:
- `opusOptions.bandwidth`_ to ``fb``
- `opusOptions.complexity`_ to empty string
- `opusOptions.bitrate`_ to ``64000``
- `opusOptions.fec`_ to ``1``
- `opusOptions.dtx`_ to ``1``
- `opusOptions.vbr`_ to ``1``
- `opusOptions.expectedPacketLoss`_ to ``5``
If set to empty string, you need to set other options yourself
``opusOptions.bandwidth``
=========================
.. code-block:: xml
wbnb
:Default: ``wb``
:Valid values: ``nb``, ``wb``, ``fb``
:Description: Limits the band width of the codec.
- ``nb`` for narrowband i.e. 8kHz
- ``wb`` for wideband i.e. 16kHz
- ``fb`` for fullband i.e. 48kHz
- any other value is treated as ``wb``
The hertz value will be signalled in SDP as ``maxplaybackrate``. Encoder will be set to the minimum of this setting and the value received in the SDP.
``opusOptions.complexity``
==========================
.. code-block:: xml
5
:Default: empty string
:Valid values: 0 to 10 or empty string
:Description: Configures the encoder's computational complexity. The supported range is 0-10 inclusive with 10
representing the highest complexity. When not specified, use Opus default.
``opusOptions.bitrate``
=======================
.. code-block:: xml
2050015500
:Default: empty string
:Valid values: integers between ``6000`` and ``510000``, empty string value, ``-1000``, or ``-1``
:Description: Desired encoder bitrate in bits per second.
Values between ``6000`` and ``510000`` are meaningful. Empty string or ``-1000`` means automatic bitrate. Value ``-1`` means maximum bitrate.
This value will be signalled in SDP. If received in SDP as ``maxaveragebitrate``, the value from SDP will be used for encoder.
``opusOptions.fec``
===================
.. code-block:: xml
11
:Default: ``0``
:Valid values: ``1`` or ``0``
:Description: Forward error correction. When enabled, encoder transmits redundant information which makes it possible
to reconstruct lost packets on the received side. If enabled ``useinbandfec=1`` is signalled in SDP. The FEC for the encoder is enabled only if ``useinbandfec=1`` is received in SDP. Otherwise it is disabled.
``opusOptions.dtx``
===================
.. code-block:: xml
11
:Default: ``0``
:Valid values: ``1`` or ``0``
:Description: Enables discontinuous transmission (DTX). If enabled ``usedtx=1`` is signalled in SDP. The DTX for the encoder is enabled only if ``usedtx=1`` is received in SDP. Otherwise it is disabled.
``opusOptions.vbr``
===================
.. code-block:: xml
11
:Default: ``1``
:Valid values: ``1`` or ``0``
:Description: Enables variable bit rate. Note it's not recommended to use VBR for secure calls. If disabled ``cbr=1`` is signalled in SDP. The VBR for the encoder is disabled if ``cbr=1`` is received in SDP. Otherwise it is enabled.
``opusOptions.expectedPacketLoss``
==================================
.. code-block:: xml
55
:Default: ``0``
:Valid values: 0 - 100
:Description: Specifies the expected percentage of packet loss. Higher values will allocate more of the bit rate for
redundant data to be used to reconstruct lost packets, which may degrade quality in the loss-less case
(but will provide better quality in situations with lost packets)
Video Codecs
------------
``allowVideo``
===================
.. code-block:: xml
1
:Default: ``1``
:Valid values: ``1`` or ``0``
:Description: Value ``1`` enables video calls in the application, ``0`` disables video calls.
``videoCodecOrder``
===================
.. code-block:: xml
108,99
:Default: ``108,99``
:Valid values: comma separated list of codec numbers
:Description: The order of video codecs, as it will be offered in SDP for calls made with Wifi codec set.
Supported codecs are::
108 : VP8
99 : H264
``videoCodecOrder3G``
=====================
.. code-block:: xml
108,99
:Default: ``108,99``
:Valid values: comma separated list of codec numbers
:Description: The order of video codecs, as it will be offered in SDP for calls made with 3G codec set.
``videoMinKbpsWifi`` and ``videoMaxKbpsWifi``
=============================================
.. code-block:: xml
64384
:Default: 64 - 384
:Description: The values are in kilobits per second. Bandwidth range for video in case it's being sent over wifi.
The encoder is initially configured to produce bitrate in the middle of the given range and adjusts the
bitrate adaptively towards either end of the range depending on the network conditions.
``videoMinKbps3G`` and ``videoMaxKbps3G``
=========================================
.. code-block:: xml
64384
:Default: 64 - 192
:Description: The values are in kilobits per second. Bandwidth range for video in case it's being sent over cellular
network. See `videoMinKbpsWifi and videoMaxKbpsWifi`_ for more details.
``videoDimsWifi``
=================
.. code-block:: xml
qcif
:Default: qcif
:Description: Specifies video resolution to be sent over wifi
:Valid values: one of the resolution names, specified in table below:
+-------------------+-----------------------+
| resolution name | frame dimensions |
+===================+=======================+
| qcif | 176 × 144 |
+-------------------+-----------------------+
| cif | 352 × 288 |
+-------------------+-----------------------+
| vga | 640 x 480 |
+-------------------+-----------------------+
| cif4 | 704 × 576 |
+-------------------+-----------------------+
| cif16 | 1408 × 1152 |
+-------------------+-----------------------+
| 720p | 1280 × 720 |
+-------------------+-----------------------+
| 1080p | 1920 x 1080 |
+-------------------+-----------------------+
.. note::
H264 and VP8 support all resolutions and in case the device changes orientation from landscape to portrait or
vice-versa, the resolution is automatically transposed.
``videoDims3G``
===============
.. code-block:: xml
qcif
:Default: qcif
:Description: Specifies video resolution to be sent over cellular networks
:Valid values: same as for `videoDimsWifi`_
``videoFPSWifi``
================
.. code-block:: xml
15
:Default: empty string
:Description: Frame rate in frames-per-second which the video encoder should use to encode video streams transferred
over Wifi.
.. note:: When left empty, the library chooses the pre-defined value for the current device, which will be 20 FPS on all modern devices.
``videoFPS3G``
==============
.. code-block:: xml
15
:Default: empty string
:Description: Frame rate in frames-per-second which the video encoder should use to encode video streams transferred
over cellular networks.
``autoSendVideoWifi``
=====================
.. code-block:: xml
1
:Default: empty string
:Valid values: ``0``, ``1`` or empty string
:Description: when set to empty string, the outgoing video stream is added to the call based on global app settings.
Specifying ``0`` or ``1`` will override these settings for this particular account. When set to ``1``,
video stream will be added into SDP when making general call (dialAction: "autoCall") over wifi network
or when answering incoming call without explicitly specifying media type (for example, by clicking on
notification about incoming call)
.. note::
You can always explicitly request a video call by using "videoCall" dialAction, or voice-only call by "voiceCall" dialAction. Also note that even if the call is started without video, it can be added later.
``autoSendVideo3G``
===================
.. code-block:: xml
1
:Default: empty string
:Valid values: ``0``, ``1`` or empty string
:Description: Automatically add outgoing video stream into SDP when making call over cellular network.
See `autoSendVideoWifi`_ for more details.
``autoReceiveVideoWifi``
========================
.. code-block:: xml
1
:Default: empty string
:Valid values: ``0``, ``1`` or empty string
:Description: Automatically allow incoming video stream when for calls over wifi. See `autoSendVideoWifi`_
for more details.
``autoReceiveVideo3G``
======================
.. code-block:: xml
1
:Default: empty string
:Valid values: ``0``, ``1`` or empty string
:Description: Automatically allow incoming video stream when for calls over cellular networks. See `autoSendVideoWifi`_
for more details.
DTMF
----
``dtmfOrder``
=============
.. code-block:: xml
rfc2833,info,audio
:Default: ``rfc2833,info,audio``
:Valid values: comma separated list of: rfc2833, info and audio.
:Description: The methods to use when generating DTMF events. The methods are tried in the order specified here.
RFC 2833 method is only used when the remote side supports telephone-event RTP payload.
.. note::
To disable a method, simply don't put it on the list. The list may have only a single item.
``dtmfAll``
===========
.. code-block:: xml
0
:Default: ``0``
:Valid values: ``0`` and ``1``
:Description: When set, all supported DTMF modes will be sent together. Not recommended.
``rfc2833NegotiateOnly8kHzClockRate``
=====================================
.. code-block:: xml
1
:Default: ``1``
:Valid values: ``0`` and ``1``
:Description: In theory, the RFC 2833 DTMF RTP packets should use the same clock rate
as the selected audio codec:
"DTMF digits and named telephone events are carried as part of the
audio stream, and MUST use the same sequence number and time-stamp
base as the regular audio channel to simplify the generation of audio
waveforms at a gateway."
-- RFC 2833
This means that if an application offers audio codecs with distinct
clock rates (e.g. PCMU/8000 and opus/48000/2), it should also offer
*multiple telephone-event payload types, each with a corresponding
distinct clock rate* (e.g. telephone-event/8000 and telephone-event/48000).
And depending on the final outcome of the audio codec negotiation,
the application should then use proper payload number, corresponding
to either telephone-event/8000 or telephone-event/48000 when generating
RFC 2833 DTMF RTP packets.
In practice, however, many systems cannot deal with anything else
than "telephone-event/8000" regardless of the selected audio codec
and its clock rate.
This option therefore allows switching between RFC 2833 conforming mode
(value ``0``), in which the application offers multiple telephone-event
payload types, and legacy mode (value ``1``) in which only "telephone-event/8000"
is offered and recognized.
``rfc2833EnforceDurationIn8KHzTimestampUnits``
==============================================
.. code-block:: xml
0
:Default: ``0``
:Valid values: ``0`` and ``1``
:Description: In case the `rfc2833NegotiateOnly8kHzClockRate`_ option is enabled
and the clock rate of the negotiated audio codec differs from 8 kHz,
the app can populate the duration field of RFC 2833 DTMF RTP packets
with either unmodified timestamp units corresponding to the audio codec
clock rate (value ``0``), or it can adjust the timestamp units
to correspond to 8 kHz clock rate (value ``1``).
NAT Traversal
-------------
``STUN``
========
.. code-block:: xml
stun.example.com:[port]
:Default: empty string
:Description: STUN server to use. When empty, libsoftphone will use ``stun.acrobits.cz``.
If no port is specified, 3478 is used.
``STUNUsername``
================
.. code-block:: xml
user
:Default: empty string
:Description: Username for STUN/TURN server. If filled in, we'll consider the STUN server TURN-capable.
``STUNPassword``
================
.. code-block:: xml
password
:Default: empty
:Description: Password for STUN/TURN server.
``natTraversal``
================
.. code-block:: xml
auto
:Default: auto
:Valid values: off, auto, stunOnly, turnAlways, ice
:Description: Specifies the NAT traversal mode to use. This setting controls which addresses will be put into SDP. The options are described in detail below:
:off: will always send local/private IP address detected from local network interface. No public address resolution is done.
:auto: will do a STUN query for a public address. If symmetric NAT is not detected, the global address is used. In case of symmetric NAT, TURN server is used if STUNUsername is filled in, otherwise private/local address is used.
:stun: will do a STUN query and always use the obtained public address (unless symmetric NAT is detected or if `ignoreSymmetricNat`_ is set to 1)
:turnAlways: will always use TURN server
:ice: will use the ICE process to choose the best address
``ignoreSymmetricNat``
======================
.. code-block:: xml
1
:Default: ``0``
:Valid values: ``0`` and ``1``
:Description: if set, it will not check for symmetric NAT and will use the public IP if instructed so even when on
symmetric NAT. Setting it to 1 is not recommended, since the IP:port detected will most likely not be accessible
from outside, but sometimes it may be necessary to send the public IP even though the port is wrong.
``iceDefaultCandidateOrder``
============================
.. code-block:: xml
relay,srflx,host
:Default: relay,srflx,host
:Valid values: comma-separated list of "relay","srflx","host"
:Description: You can prioritise one default ICE candidate over others.
For example to prefer server reflexive address over relay address, set it to srflx,host,relay. To prefer host
address, set it to host,srflx,relay.
``contactIP``
=============
.. code-block:: xml
internal
:Default: internal
:Valid values: internal, external, static
:Description: Specifies which address to use in Contact and Via SIP headers:
:internal: will use the local/private in the Contact and Via SIP header.
:external: will try to determine the public address using STUN ping, OPTIONS packet or STUN server and use it in Contact and Via header.
:static: will use a static address in Contact and Via header, the address is specified in `forcedContact`_ node.
``forcedContact``
=================
.. code-block:: xml
192.168.100.100:7777
:Default: empty string
:Description: This IP address will be used in Contact and Via headers in case `contactIP`_ is set to "static".
``sendAudioBack``
=================
.. code-block:: xml
0
:Defalut: ``1``
:Valid values: ``0`` and ``1``
:Description: If set to ``1``, we will always send the audio back to the address from which we receive the audio from
the other side.
``keepAlive``
=============
.. code-block:: xml
1
:Default value: ``0``
:Valid values: ``0`` and ``1``
:Description: When set, libSoftphone periodically sends keep-alive packet to SIP server, to keep the connection active
and NAT port mappings open.
``keepAlivePeriod``
===================
.. code-block:: xml
30
:Default value: 30
:Valid values: integer number. The value is in seconds, the minimum allowed value is 5
:Description: Specifies the amount of seconds between two keep-alive packets
``rtpPortRangeStart`` and ``rtpPortRangeEnd``
=============================================
.. code-block:: xml
1000065530
:Default: 10000 and 65535.
:Valid values: integer numbers between 1025 and 65535 (inclusive). There should be at least 4 ports between these values
:Description: The port range to use for RTP sockets.
``listeningPort``
=================
.. code-block:: xml
5060
:Default: empty string
:Description: The local port which the SIP stack will bind to:
:Valid values: integer numbers between 1025 and 65535 (inclusive)
|
- If left empty, the SIP stack will choose a random port number and will bind to it. This number will remain the
same for at least one day. If the client is restarted and re-registers repeatedly, it will remember its rinstance,
callId and CSeq numbers, port will remain the same and therefore it should always occupy the same registration slot
on the server.
- If set to 0, a random port will be chosen every time the client registers.
- If set to a specific numeric value, the SIP stack will always bind to that port.
.. warning::
On iOS, setting `listeningPort`_ for TCP and TLS SIP transports has no effect. Specifying a port to bind
to for TCP is not supported by iOS platform.
``maxTimeToWaitForWorkingNetworkInMilliseconds``
================================================
.. code-block:: xml
15000
:Default: 15000
:Description: the time in milliseconds for which the client keeps calls in established state after the network is lost.
When this time expires and there is still no network, the call is hung up.
Custom SIP Headers
------------------
.. code-block:: xml
…
Specify custom headers to be added into SIP packets. The headers should be stored in their own node named "headers" as
sub-nodes with name "header". The attributes are:
:method: SIP request method. The custom header will be added only to SIP packets of the specified method. Use ``method="*"`` to add the header to all SIP packets.
:name: header name
:value: header value
.. _dnd:
Do Not Disturb
--------------
Do Not Disturb (DND), also called Zen Mode in Android Developers Documentation, mutes all events when the user does
not want to be disturbed. DND rules can be provisioned using the XML format described below. Here is an example:
.. code-block:: xml
08:0010:003100:0023:59961Do not disturb on weekends
The DND XML is wrapped in an ```` node. The optional attribute ``gmtOffsetInMinutes`` defines the timezone for
the time values in DND entries. Inside this XML node, there is a list of ```` child nodes.
```` and ```` elements define the start and end time when the DND rule applies. The format is ``HH:MM`` and the
hours are in 24h format. Both are required, if you want all-day rule, it should be ``00:00`` and
``23:59``.
```` is a bit mask which defines for which days in the week the rule applies. The values are as follows:
===== ======= ===============
bit value day
===== ======= ===============
0 1 Monday
1 2 Tuesday
2 4 Wednesday
3 8 Thursday
4 16 Friday
5 32 Saturday
6 64 Sunday
===== ======= ===============
If you are not familiar with bitwise arithmetics, all you need to do is to sum the values for days when you want the
rule to apply. For example, weekends are Saturday and Sunday, i.e. 32+64 = 96. Workdays would be 1+2+4+8+16 = 31.
Note that if you set this to 0, the rule will never be applied; to match any day, you need to set it to 127.
```` is a list of ```` child nodes. In case there are no ```` child nodes, the
rule will match for any incoming number. In case the list is not empty, the rule applies only if the incoming party
matches some of the ```` child nodes.
In case the ```` element has non-empty fields ```` and ``