Project

General

Profile

SipConfigurationAPI » History » Version 46

Luci Stanescu, 04/15/2010 11:55 AM

1 1 Adrian Georgescu
= Configuration API =
2
3 41 Adrian Georgescu
[[TOC(SipMiddlewareApi, SipConfigurationAPI, SipCoreApiDocumentation, depth=3)]]
4 1 Adrian Georgescu
5 28 Luci Stanescu
The configuration API is used by the [wiki:SipMiddlewareApi Middleware API] to store and read its settings. By managing the settings of the middleware through this configuration API one can create different applications that behave consistently and inherit the same settings. For example a command line client or a GUI program can read and write their settings through this API. In addition, the configuration API offers an extensibility framework, by which applications can add their specific settings which will be managed in the same way as the middleware settings. The settings are loaded and saved from/to persistent storage using a backend; a backend is provided which has a simple text file format.
6 1 Adrian Georgescu
7 33 Luci Stanescu
The settings can be managed by API calls. The middleware settings have appropriate defaults so that it can function properly with a minimum amount of changes.
8 1 Adrian Georgescu
9 33 Luci Stanescu
== Architecture ==
10
11
Configuration API consists of the low-level classes that can be used for storing and retrieving configuration objects. Moreover, it allows the creation of a higher level API for accessing configuration items. The SIP SIMPLE settings are defined using this API, however application-specific settings can also make use of it in order to define a consistent view of all the settings, by either extending the settings objects defined in the middleware or creating new settings objects.
12
13
The module '''sipsimple.configuration''' contains the main classes of the configuration API. These are:
14
15
 * ConfigurationManager
16
 * SettingsObject
17
 * SettingsGroup
18
 * Setting
19
 * SettingsObjectExtension
20
21
In addition, the exceptions which make up this package are:
22
23
 * ConfigurationError (base class for all other configuration errors)
24
 * ObjectNotFoundError
25
26 39 Adrian Georgescu
The package '''sipsimple.configuration.backend''' contains the abstract interface for configuration backends, as well as concrete implementations of backends. This package is explained in more detail in [wiki:SipConfigurationAPI#BackendAPI Configuration Backend API].
27 33 Luci Stanescu
28 37 Adrian Georgescu
=== ConfigurationManager ===
29 33 Luci Stanescu
30
The central entity is the ConfigurationManager, which is used for storing and retrieving settings. Within the ConfigurationManager, settings can be represented in a hierarchical structure, where the root the of tree is the configuration ''document''. This structure is represented using a dictionary, defined recursively as:
31
 * the keys of the dictionary are unicode objects
32
 * the values of the dictionary can be:
33
   * the None object (this represents a default value)
34
   * unicode objects
35
   * lists of unicode objects
36
   * dictionaries using this specification
37
An item in the dictionary with an unicode object or a list as the value is a single setting: the name of the item is the name of the setting. An item with a dictionary as the value is a group of settings: the name of the item is the name of the group. This dictionary representation is stored to a persistent storage and loaded using the configuration backend as explained in [wiki:SipConfigurationAPI#ConfigurationBackendAPI Configuration Backend API]. Any backend which is able to store and load such data can be used, but a simple [wiki:SipConfigurationAPI#FileBackend text file backend] is provided. After configuration data is loaded from the backend, it is saved on the ConfigurationManager and can be managed using its methods; in order to save the data using the backend provided, the {{{save}}} method needs to be called; any calls to {{{update}}} or {{{delete}}} will not ask the backend to store the data as well.
38
39
The ConfigurationManager class is a singleton to allow any part of the code to access it without the need to pass references. However, its '''start''' method needs to be called before it can be used. Once this is done, objects can be added, retrieved or deleted from the underlying storage; if using the [wiki:SipMiddlewareApi#SIPApplication SIPApplication] class, its start method takes care of this passing as the backend the one it receives as an argument. The methods of ConfigurationManager are:
40
41
 '''!__init!__'''(''self'')::
42
 References to the ConfigurationManager instance can be obtained anytime without passing any arguments. However, it needs the manager needs to be started in order to be used, otherwise all methods will raise a RuntimeError.
43
 '''start'''(''self'', '''backend''')::
44
 The start method allows the ConfigurationManager instance to use the specified backend for accessing the underlying storage. See [wiki:SipConfigurationAPI#ConfigurationBackendAPI Configuration Backend API] for information on what the required interface for the passed object is. Raises a {{{ConfigurationBackendError}}} if the backend cannot load the configuration data from persistent storage.
45
 '''update'''(''self'', '''group''', '''name''', '''data''')::
46
 The partial {{{data}}} which must be a dictionary as formerly defined corresponding to an object having the specified name under the specified group. If {{{group}}} is {{{None}}}, the object will be saved top-level (its name will the a top-level key in the data dictionary). Note that changes will not be written to the underlying storage until the '''save''' method is called.
47
 '''delete'''(''self'', '''group''', '''name''')::
48
 If an object stored as {{{name}}} exists in {{{group}}}, then it will be deleted. If {{{group}}} is {{{None}}}, then the top-level object identified by {{{name}}} will be deleted.
49
 '''get'''(''self'', '''group''', '''name''')::
50
 Retrieves the object stored with {{{name}}} in {{{group}}}, if it exists. Otherwise, the method will raise an {{{ObjectNotFoundError}}}. If {{{group}}} is {{{None}}}, the top-level object identified by {{{name}}} will be retrieved.
51
 '''get_names'''(''self'', '''group''')::
52
 Returns a list with all the names of the objects in {{{group}}}. Returns an empty list if the group does not exist.
53
 '''save'''(''self'')::
54
 Flushes the changes made to the configuration to the backend. This method must be called to ensure that all changes have been written to persistent storage. Raises a {{{ConfigurationBackendError}}} if the backend cannot store the data to persistent storage. 
55
56
57
=== SettingsObject ===
58
59
A SettingsObject is used to represent a hierarchy of settings, which are managed via the ConfigurationManager. There are two types of SettingsObject:
60 46 Luci Stanescu
 * SettingsObjects without an ID, i.e. there should be only one instance of this SettingsObject in an application. The application should define these objects using the {{{Singleton}}} metaclass. This also means that the object cannot be deleted. An example of such a SettingsObject is SIPSimpleSettings. These SettingsObjects are useful to represent global settings.
61
 * SettingsObjects with an associated id. The instances are not necessarily persistent. New ones can be created and existing ones can be deleted. An example of such a SettingsObject is the Account. These SettingsObjects are useful to represent settings which apply to entities identifiable by a string id. The ID can be changed, which means these objects cannot be Singletons.
62 33 Luci Stanescu
63
SettingsObjects can belong to a group, depending on whether the {{{__group__}}} attribute was specified. If it wasn't, the data will be saved top-level using the id of the SettingsObject; otherwise, the data will be saved under the group specified using the id. It is recommended that SettingsObjects with instances per id be saved in a group, although this is not enforced. For example, the Account instances are saved in a group named '''Accounts'''.
64
65
When a SettingsObject is instantiated its contained settings are loaded from the configuration storage. If it is the first time a SettingsObject is created, the default values for the settings will apply. The SettingsObject will only be copied to storage when its '''save''' method is called.
66
67
==== Defining a global SettingsObject ====
68
69 1 Adrian Georgescu
In order to define a global SettingsObject, the {{{__id__}}} attribute must be defined on the class, while the {{{__group__}}} attribute can be defined. The {{{__id__}}} must not be used in any other SettingsObject which is stored in the same group (or globally if the {{{__group__}}} attribute is missing). An example of defining a global SettingsObject:
70 33 Luci Stanescu
{{{
71 46 Luci Stanescu
from application.python.util import Singleton
72 33 Luci Stanescu
from sipsimple.configuration import SettingsObject
73 1 Adrian Georgescu
74 33 Luci Stanescu
class SIPSimpleSettings(SettingsObject):
75 46 Luci Stanescu
    __metaclass__ = Singleton
76 33 Luci Stanescu
    __group__ = 'Global'
77
    __id__ = 'SIPSimple'
78
}}}
79
80
The {{{__init__}}} method must not accept any other argument except ''self''. It will be called each time the settings are loaded from the storage, not only the first time the object is created.
81
82
83
==== Defining a per-id SettingsObject ====
84
85
In order to define a per-id SettingsObject, the {{{__group__}}} attribute should be defined on the class, while the {{{__id__}}} attribute must be left to None. When instantiating the resulting class, exactly one argument must be given, which represents the string id. Each class defined as a per-id SettingsObject should be allocated a different group from all the other SettingsObjects (including global ones), otherwise the keys under which the SettingsObjects are stored could overlap. An example of defining a per-id SettingsObject:
86
{{{
87
from sipsimple.configuration import SettingsObject
88
89
class Account(SettingsObject):
90
    __group__ = 'Accounts'
91
    def __init__(self, id):
92
        """Do something each time the Account is loaded"""
93
}}}
94
95
The {{{__init__}}} method must accept exactly one argument except ''self''. It will be called each time the object is loaded from the storage, in addition to the first time the object is created. This allows the SettingsObject to be more than a simple collection of settings.
96
97 44 Adrian Georgescu
==== methods ====
98 33 Luci Stanescu
99
 '''save'''(''self'')::
100
 If the contained Settings of this SettingsObject have changed, the object will be saved to the persistent storage. A CFGSettingsObjectDidChange notification will be issued which contains the modified settings. If the save fails, a CFGManagerSaveFailed notification is issued in addition.
101
 '''delete'''(''self'')::
102
 This method can only be called on per-id SettingsObjects. It will delete the object from the persistent storage. All references to this SettingsObject must be removed.
103 44 Adrian Georgescu
104 1 Adrian Georgescu
==== notifications ====
105 33 Luci Stanescu
106
 '''CFGSettingsObjectDidChange'''::
107 46 Luci Stanescu
 This notification is sent when the save method of a SettingsObject is called and some settings were previously changed. Attributes:
108 1 Adrian Georgescu
 [[BR]]''modified'':[[BR]]
109
 A dict instance which maps settings keys in their fully qualified form (attribute names seperated by '.', relative to the SettingsObject) to a ModifiedValue instance; the ModifiedValue instance contains two attributes: ''old'' and ''new'' which are set to the old and the new Setting's value respectively.
110 46 Luci Stanescu
 [[BR]]''timestamp'':[[BR]]
111
 A {{{datetime.datetime}}} object representing the moment the notification was sent.
112
 '''CFGSettingsObjectDidChangeID'''::
113
 This notification is sent when the save method of SettingsObject is called and the ID of the object was previously changed. Attributes:
114
 [[BR]]''old_id'':[[BR]]
115
 The old value of the ID.
116
 [[BR]]''new_id'':[[BR]]
117
 The new value of the ID.
118
 [[BR]]''timestamp'':[[BR]]
119
 A {{{datetime.datetime}}} object representing the moment the notification was sent.
120 33 Luci Stanescu
121
=== Setting ===
122
123
The Setting descriptor is used to describe a setting in SettingsObjects. The following methods are part of the public API of it:
124
 '''!__init!__'''(''self'', '''type''', '''default'''={{{None}}}, '''nillable'''={{{False}}})::
125 1 Adrian Georgescu
 Create a new Setting descriptor which represents a setting in all instances of a SettingsObject. The default value must be specified if the setting is not nillable. The type will be applied to the values which are set to this descriptor if the value is not already an instance of the type; it is not applied to the default value.
126 33 Luci Stanescu
127
An example of using a setting:
128
{{{
129 46 Luci Stanescu
from application.python.util import Singleton
130 1 Adrian Georgescu
from sipsimple import __version__
131 42 Luci Stanescu
from sipsimple.configuration import Setting, SettingsObject
132 33 Luci Stanescu
133
class SIPSimpleSettings(SettingsObject):
134 46 Luci Stanescu
    __metaclass__ = Singleton
135 33 Luci Stanescu
    __group__ = 'Global'
136
    __id__ = 'SIPSimple'
137
138
    user_agent = Setting(type=str, default='sipsimple %s' % __version__)
139
}}}
140
141
When a setting value is read from the configuration backend, the type is used to reconstruct the value from a unicode object, a list of unicode objects, or a dictionary containing unicode keys and values with any of these three types. Several built-in types are recognised and are handled automatically:
142
 * bool: the unicode strings {{{u'yes'}}}, {{{u'true', {{{u'on'}}} and {{{u'1'}}} are considered to have the value {{{True}}}, while {{{u'no'}}}, {{{u'false'}}}, {{{u'off'}}} and {{{u'0'}}} are considered to have the value False; the comparison is done case insensitively; all other strings are considered invalid.
143
 * int, long and basestring: the type is called using the value as an argument.
144
All other types are instantiated using an un-pickling like mechanism. The {{{__new__}}} method is called without any arguments and {{{__setstate__}}} is called on the object returned by {{{__new__}}} using the value as the sole argument.
145
146
Saving a setting value is done similarly, according to type. The builtin types which are handled are the same:
147
 * bool: the unicode objects {{{u'true'}}} and {{{u'false}}} are used depending on the value.
148
 * int, long and basestring: {{{unicode}}} is called with the value as the sole argument.
149
For all other types, the {{{__getstate__}}} method is called which should return an appropriate value.
150
151
152 1 Adrian Georgescu
=== SettingsGroup ===
153 33 Luci Stanescu
154
A SettingsGroup allows settings to be structured hierarchically. Subclasses of SettingsGroup are containers for Settings and other SettingsGroups just as SettingsObjects are. In addition, the subclasses of SettingsGroup are descriptors and can be used as such to assign a SettingsGroup as a child of another SettingsGroup or a SettingsObject. An example usage containing Setting, SettingsGroup and SettingsObject:
155
{{{
156 46 Luci Stanescu
from application.python.util import Singleton
157 42 Luci Stanescu
from sipsimple import __version__
158 33 Luci Stanescu
from sipsimple.configuration import Setting, SettingsGroup, SettingsObject
159
160 1 Adrian Georgescu
class TLSSettings(SettingsGroup):
161 33 Luci Stanescu
    verify_server = Setting(type=bool, default=False)
162
163
class SIPSimpleSettings(SettingsObject):
164 46 Luci Stanescu
    __metaclass__ = Singleton
165 33 Luci Stanescu
    __group__ = 'Global'
166
    __id__ = 'SIPSimple'
167
168
    user_agent = Setting(type=str, default='sipsimple %s' % __version__)
169
170
    tls = TLSSettings
171
}}}
172
173 1 Adrian Georgescu
=== SettingsObjectExtension ===
174 33 Luci Stanescu
175
The SettingsObjectExtension allows an application to add or customize the settings of the middleware according to its needs. In order to add or replace settings/settings groups defined in another SettingsObject, SettingsObjectExtension can be subclassed and the register_extension class method of the original SettingsObject can be called passing the SettingObjectExtension subclass as the sole argument. In order to add/replace settings in a group of settings, the original SettingsGroup can be subclassed. Example:
176
{{{
177 46 Luci Stanescu
from application.python.util import Singleton
178 42 Luci Stanescu
from sipsimple import __version__
179
from sipsimple.configuration import Setting, SettingsGroup, SettingsObject, SettingsObjectExtension
180 33 Luci Stanescu
181 1 Adrian Georgescu
class TLSSettings(SettingsGroup):
182 33 Luci Stanescu
    verify_server = Setting(type=bool, default=False)
183
184
class SIPSimpleSettings(SettingsObject):
185 46 Luci Stanescu
    __metaclass__ = Singleton
186 33 Luci Stanescu
    __group__ = 'Global'
187
    __id__ = 'SIPSimple'
188
189
    user_agent = Setting(type=str, default='sipsimple %s' % __version__)
190
191
    tls = TLSSettings
192
193
class TLSSettingsExtension(TLSSettings):
194
    verify_client = Setting(type=bool, default=True)
195
196
class SIPSimpleSettingsExtension(SettingsObjectExtension):
197
    default_account = Setting(type=str, default=None, nillable=True)
198
199
    tls = TLSSettingsExtension
200
201
SIPSimpleSettings.register_extension(SIPSimpleSettingsExtension)
202
}}}
203
204
=== Backend API ===
205
206
The backend API provides a way to use the configuration framework consistently, while using any system for storing the data persistently. The ConfigurationManager makes use of a backend whenever it needs to write/read something to the persistent storage. The backend only needs to know how to handle data in the dictionary format explained in [wiki:SipConfigurationAPI#ConfigurationManager Configuration Manager]. In order to use a specific backend, it is given to the ConfigurationManager in its start method.
207
208
The interface '''sipsimple.configuration.backend.IBackend''' describes the backend:
209
 '''load'''()::
210
 Load the configuration data using whatever means employed by the backend implementation and return a dictionary conforming to the definition in [wiki:SipConfigurationAPI#ConfigurationManager Configuration Manager].
211
 '''save'''('''data''')::
212
 Given a dictionary conforming to the definition in this interface, save the data using whatever means employed by the backend implementation.
213
214
215
==== FileBackend ====
216
217
A concrete implementation of the '''IBackend''' interface resides in '''sipsimple.configuration.backend.file.FileBackend'''. The methods different from the ones in '''IBackend''' are:
218
219
 '''!__init!__'''(''self'', '''filename''', '''encoding'''={{{'utf-8'}}})::
220
 Create a new FileBackend which uses the specified filename for loading and storing the data to; the data is written using the specified encoding, defaulting to UTF-8.
221
222
This object saves the data using a simple text file format with the following syntax:
223
 * SettingGroups, SettingsObjects or Groups of SettingsObjects are represented by their name (or id in the case of SettingsObjects) followed by a colon (''':'''). These containers can contain other such containers or simple settings. Their children need to be indented more that the container itself. The indentation need not be consistent.
224
 {{{
225
 Accounts:
226
    user@domain:
227
      display_name = User
228
      tls:
229
        certificate =
230
 }}}
231
 * Simple settings are represented by a name followed by an equals sign and the value; whitespace anywhere in between is ignored. The different values are represented in the following way:
232
  * None is represented by the absence of a value.
233
  {{{
234
    setting =
235
  }}}
236
  * Unicode objects are represented by a simple string (which can be quoted to include leading and trailing whitespace by either single or double quotes) and can have the following espace sequances: '''\' ''', '''\"''', '''\n''', '''\r'''. The unicode characters are encoded using the encoding specified in the constructor.
237
  {{{
238
    setting1 = value
239
    setting2 = value with spaces
240
    setting3 = "  value with leading and trailing spaces  "
241
    setting4 = value with a line feed\n
242
  }}}
243
  * Lists are represented by unicode strings as described above separated by commas (''','''). Any not-quoted whitespace around the comma is ignored.
244
  {{{
245
    setting = a, b  , c
246
  }}}
247
  * Complex settings can be represented just like a group:
248
  {{{
249
    complex_setting:
250
      field1 = value
251
      field2 = 123
252
  }}}
253
  
254
255 35 Luci Stanescu
== Middleware Settings ==
256 4 Adrian Georgescu
257
These are the current settings, kept in the modules '''sipsimple.configuration.settings''' and '''sipsimple.account'''. The main classes used to access the settings are Account, BonjourAccount and SIPSimpleSettings. All settings can be accessed as simple attributes. The types of attributes is described for each setting below. When setting the value of an attribute, if it's not of the required type, it will be given to the specified type as the only argument. The modified settings are not saved to the persistent storage until the '''save''' method is called on the main object. Once this is done, a CFGSettingsObjectDidChange notification is sent, the data of which is explained in [wiki:SipConfigurationAPI#SettingsObjectNotifications SettingsObject Notifications].
258 1 Adrian Georgescu
259
Only a nillable setting can be assigned the value {{{None}}}, even if the type of the setting would otherwise accept {{{None}}} as an argument. The settings as described below are ''not'' nillable, unless specified explicitely. To reset the value of a setting, the special object {{{sipsimple.configuration.DefaultValue}}} can be assigned to it. If a default value is not explicitely specified below, it defaults to {{{None}}}. Note that a non-nillable setting cannot have the default value of {{{None}}}.
260 4 Adrian Georgescu
261 33 Luci Stanescu
=== General ===
262 1 Adrian Georgescu
263 22 Adrian Georgescu
{{{
264
SIP SIMPLE settings:
265 27 Luci Stanescu
             +-- default_account = user@example.com
266 17 Adrian Georgescu
SIP SIMPLE --|-- user_agent = sipsimple
267 22 Adrian Georgescu
             |-- audio
268 4 Adrian Georgescu
             |-- chat
269 22 Adrian Georgescu
             |-- desktop_sharing
270 1 Adrian Georgescu
             |-- file_transfer
271
             |-- logs
272 23 Adrian Georgescu
             |-- msrp
273 17 Adrian Georgescu
             |-- rtp
274 1 Adrian Georgescu
             |-- sip
275
             +-- tls
276
277
        +-- alert_device = system_default
278 27 Luci Stanescu
audio --|-- input_device = system_default
279 17 Adrian Georgescu
        |-- output_device = system_default
280 1 Adrian Georgescu
        |-- sample_rate = 44100
281
        |-- silent = False
282 27 Luci Stanescu
        +-- tail_length = 200
283
284 1 Adrian Georgescu
       +
285 23 Adrian Georgescu
chat --|
286
       +
287 22 Adrian Georgescu
288 17 Adrian Georgescu
                  +
289
desktop_sharing --|
290 22 Adrian Georgescu
                  +
291 23 Adrian Georgescu
292
                +
293
file_transfer --|
294
                +
295
296 18 Adrian Georgescu
       +-- pjsip_level = 5
297 22 Adrian Georgescu
logs --|
298 18 Adrian Georgescu
       +
299 17 Adrian Georgescu
300 22 Adrian Georgescu
       +-- transport = tls
301 4 Adrian Georgescu
msrp --|
302 1 Adrian Georgescu
       +
303
304
      +-- audio_codec_list = AudioCodecList(['speex', 'G722', 'PCMU', 'PCMA', 'iLBC', 'GSM'])
305
rtp --|-- port_range = PortRange(start=50000, end=50400)
306 2 Adrian Georgescu
      +-- timeout = 30
307 1 Adrian Georgescu
308
      +-- tcp_port = 0
309
sip --|-- tls_port = 0
310
      |-- transport_list = SIPTransportList(['tls', 'tcp', 'udp'])
311
      +-- udp_port = 0
312
313
      +-- ca_list = None
314 28 Luci Stanescu
tls --|-- protocol = TLSv1
315
      +-- timeout = 1000
316 1 Adrian Georgescu
317 28 Luci Stanescu
}}}
318 1 Adrian Georgescu
319 28 Luci Stanescu
The {{{sipsimple.configuration.settings.SIPSimpleSettings}}} class is a singleton can be instantiated and used anywhere after the [wiki:SipConfigurationAPI#ConfigurationManager ConfigurationManager] has been started. 
320
321 24 Adrian Georgescu
The settings are explained below:
322 1 Adrian Georgescu
323
 '''SIPSimpleSettings.default_account''' (type={{{str}}}, default={{{'bonjour@local'}}}, nillable={{{True}}})::
324
  A string, which contains the id of the default Account. This setting is managed by the AccountManager and should not be changed manually. See [wiki:SipMiddlewareApi#AccountManager AccountManager] for more information.
325 28 Luci Stanescu
326 1 Adrian Georgescu
 '''SIPSimpleSettings.user_agent''' (type={{{str}}}, default={{{'sipsimple VERSION'}}})::
327 28 Luci Stanescu
  This setting will be used to set the value of the User-Agent header in outgoing SIP requests and of the Server header in all SIP responses.
328 1 Adrian Georgescu
329 33 Luci Stanescu
==== Audio ====
330 17 Adrian Georgescu
331 1 Adrian Georgescu
 '''SIPSimpleSettings.audio.input_device''' (type={{{AudioInputDevice}}}, default={{{'system_default'}}}, nillable={{{True}}})::
332
  The name of the audio device, which will be used for input (recording). If it is set to {{{'system_default'}}}, one will be selected automatically by the operating system; if it is set to {{{None}}}, a dummy device will be used which doesn't record anything.
333 23 Adrian Georgescu
334 1 Adrian Georgescu
 '''SIPSimpleSettings.audio.output_device''' (type={{{AudioOutputDevice}}}, default={{{'system_default'}}}, nillable={{{True}}})::
335 4 Adrian Georgescu
  The name of the audio device, which will be used for output (playback). If it is set to {{{'system_default'}}, one will be selected automatically by the operating system; if it is set to {{{None}}}, a dummy device will be used which will discard any audio data.
336 24 Adrian Georgescu
337 1 Adrian Georgescu
 '''SIPSimpleSettings.audio.alert_device''' (type={{{AudioOutputDevice}}}, default={{{'system_default'}}}, nillable={{{True}}})::
338
  The name of the alert device, which can be used for alerting the user. If it is set to {{{'system_default'}}}, one will be selected automatically by the operating system; if it is set to {{{None}}}, a dummy device will be used which will discard any audio data. This device is not used by the middleware but is provided for consistency.
339 24 Adrian Georgescu
340 4 Adrian Georgescu
 '''SIPSimpleSettings.audio.tail_length''' (type={{{NonNegativeInteger}}}, default={{{200}}})::
341 27 Luci Stanescu
  This setting is used as a parameter for the audio echo cancellation algorithm. It's value is a non-negative integer which represents milliseconds. It specifies the length of the echo cancellation filter.
342 24 Adrian Georgescu
343 1 Adrian Georgescu
 '''SIPSimpleSettings.audio.sample_rate''' (type={{{SampleRate}}}, default={{{16000}}})::
344
  This is the sample rate at which the audio system runs, in Hz. All playback and recording will be done at this rate. If an audio codec has a smaller or larger sample rate, it will be resampled to this value (if possible). Example values include 8000, 32000, 44100 etc.
345
 
346
 '''SIPSimpleSettings.audio.silent''' (type={{{bool}}}, default={{{False}}})::
347
  If this setting is set to True, no audio notifications will be played on the alert device (the volume of the alert device will be set to 0).
348
349 33 Luci Stanescu
==== Chat ====
350 23 Adrian Georgescu
351 1 Adrian Georgescu
Empty section for future use.
352 4 Adrian Georgescu
353 33 Luci Stanescu
==== Desktop Sharing ====
354 1 Adrian Georgescu
355 23 Adrian Georgescu
Empty section for future use.
356 1 Adrian Georgescu
357 33 Luci Stanescu
==== File Transfer ====
358 1 Adrian Georgescu
359
Empty section for future use.
360 23 Adrian Georgescu
361 33 Luci Stanescu
==== Logs ====
362 1 Adrian Georgescu
363 28 Luci Stanescu
 '''SIPSimpleSettings.logs.pjsip_level''' (type={{{NonNegativeInteger}}}, default={{{5}}})::
364
  This setting controls the amount of log messages generated by the PJSIP core. It must be set to a non-negative integer.
365 1 Adrian Georgescu
366 33 Luci Stanescu
==== MSRP ====
367 1 Adrian Georgescu
368 23 Adrian Georgescu
 '''SIPSimpleSettings.msrp.transport''' (type={{{MSRPTransport}}}, default={{{'tls'}}})::
369 34 Luci Stanescu
  MSRP can use either TLS or TCP and this setting controls which one should be used for normal accounts.
370 23 Adrian Georgescu
371 33 Luci Stanescu
==== RTP ====
372 23 Adrian Georgescu
373
 '''SIPSimpleSettings.rtp.port_range''' (type={{{PortRange}}}, default={{{PortRange(50000, 50400)}}})::
374
  This setting controls the port range from which ports used by RTP transport will be assigned. The values of the ports need to be in the range 1-65535; the start port must not be larger than the end port.
375
376 43 Adrian Georgescu
 '''SIPSimpleSettings.rtp.audio_codec_list''' (type={{{AudioCodecLis}t}}, default={{{AudioCodecList(('speex', 'G722', 'PCMU', 'PCMA'))}}})::
377
  This setting is used to specify the preferred audio codecs, which should be used for audio calls. It must contain only strings, which represent the supported codecs (speex, G722, PCMA, PCMU, iLBC and GSM), in the order in which they are preferred. This setting can be overridden per account.
378 23 Adrian Georgescu
379 33 Luci Stanescu
==== SIP ====
380 23 Adrian Georgescu
381 28 Luci Stanescu
 '''SIPSimpleSettings.sip.udp_port''' (type={{{Port}}}, default={{{0}}})::
382 8 Adrian Georgescu
  This is the port on which the Engine will bind and for for sending and receiving UDP packets. It is an integer in the range 0-65535. If it is set to 0, it will be allocated automatically.
383 28 Luci Stanescu
384 1 Adrian Georgescu
 '''SIPSimpleSettings.sip.tcp_port''' (type={{{Port}}}, default={{{0}}})::
385 8 Adrian Georgescu
  This is the port on which the Engine will listen for TCP connections. It is an integer in the range 0-65535. If it is set to 0, it will be allocated automatically.
386 1 Adrian Georgescu
387 28 Luci Stanescu
 '''SIPSimpleSettings.sip.tls_port''' (type={{{Port}}}, default={{{0}}})::
388 8 Adrian Georgescu
  This is the port on which the Engine will listen for TLS connections. It is an integer in the range 0-65535. If it is set to 0, it will be allocated automatically.
389 1 Adrian Georgescu
390 27 Luci Stanescu
 '''SIPSimpleSettings.sip.transport_list''' (type={{{SIPTransportList}}}, default={{{SIPTransportList(('tls', 'tcp', 'udp'))}}})::
391
  This setting's value is a tuple, which can only contain the strings 'tls', 'tcp' and 'udp'. It has a double purpose:
392 29 Luci Stanescu
   * Only the transports specified here are used to SIP requests associated with normal accounts.
393 27 Luci Stanescu
   * The order of the transports specified in this tuple represent the preferred order in which transports should be used. This applies to all SIP requests.
394
395 33 Luci Stanescu
==== TLS ====
396 27 Luci Stanescu
397 1 Adrian Georgescu
 '''SIPSimpleSettings.tls.ca_list''' (type={{{Path}}}, default={{{None}}}, nillable={{{True}}})::
398 27 Luci Stanescu
  The settings points to a file which contains the CA certificates. In can be {{{None}}}, in which case no CAs are available. It is interpreted as an absolute path, with a leading ''~'' expanded to the home directory of the current user. In order to access the full path to the CA file, the normalized attribute on the setting can be used:
399
  {{{
400
  SIPSimpleSettings().tls.ca_list.normalized
401 31 Luci Stanescu
  }}}
402 27 Luci Stanescu
403
 '''SIPSimpleSettings.tls.protocol''' (type={{{TLSProtocol}}}, default={{{'TLSv1'}}})::
404
  This setting sets the version of the TLS protocol which will be used. It is a string and must be one of {{{'TLSv1'}}}, {{{'SSLv2'}}}, {{{'SSL3'}}}, {{{'SSL23'}}}.
405
406 29 Luci Stanescu
 '''SIPSimpleSettings.tls.timeout''' (type={{{NonNegativeInteger}}}, default={{{1000}}})::
407 27 Luci Stanescu
  This is the timeout for negotiating TLS connections, in milliseconds. It must be an non-negative integer.
408
409 33 Luci Stanescu
=== Account ===
410 1 Adrian Georgescu
411
{{{
412 29 Luci Stanescu
Account user@example.com:
413
          +-- display_name = Example User
414
account --|-- enabled = True
415 45 Luci Stanescu
          |-- auth
416 29 Luci Stanescu
          |-- dialog_event
417
          |-- message_summary
418
          |-- nat_traversal
419
          |-- presence
420 1 Adrian Georgescu
          |-- pstn
421 29 Luci Stanescu
          |-- rtp
422 1 Adrian Georgescu
          |-- sip
423
          |-- tls
424
          +-- xcap
425
426 45 Luci Stanescu
       +-- password = xyz
427
auth --|-- username = None
428
       +
429
430 29 Luci Stanescu
               +-- enabled = True
431
dialog_event --|
432
               +
433
434
                  +-- enabled = True
435
message_summary --|-- voicemail_uri = None
436
                  +
437
438
                +-- msrp_relay = None
439 1 Adrian Georgescu
nat_traversal --|-- stun_server_list = None
440 29 Luci Stanescu
                |-- use_ice = False
441 1 Adrian Georgescu
                |-- use_msrp_relay_for_inbound = True
442
                +-- use_msrp_relay_for_outbound = False
443
444
           +-- enabled = True
445
presence --|-- use_rls = True
446
           +
447
448
       +
449 30 Luci Stanescu
pstn --|
450 1 Adrian Georgescu
       +
451
452
      +-- audio_codec_list = None
453
rtp --|-- inband_dtmf = False
454
      |-- srtp_encryption = optional
455 30 Luci Stanescu
      +-- use_srtp_without_tls = False
456 1 Adrian Georgescu
457
      +-- outbound_proxy = SIPProxyAddress('sip.example.com', port=5060, transport='udp')
458
sip --|-- publish_interval = 600
459
      |-- register = True
460 30 Luci Stanescu
      |-- register_interval = 600
461 1 Adrian Georgescu
      +-- subscribe_interval = 600
462
463
464
      +-- certificate = tls/user@example.com.crt
465
tls --|-- verify_server = False
466
      +
467
468
       +-- enabled = True
469 30 Luci Stanescu
xcap --|-- use_xcap_diff = True
470 1 Adrian Georgescu
       +-- xcap_root = https://xcap.example.com/xcap-root/
471
}}}
472
473
The Account object is used to represent a normal SIP account registered at a SIP provider. It is uniquely identifiable by it's SIP ID, in the form ''user@domain''. There is exactly one instance of Account per ID, which means that an Account can be accessed by instantianting it anywhere. However, this is not the recommended way of accessing accounts, since it can lead to creating new accounts. The recommended way is by using the [wiki:SipMiddlewareApi#AccountManager AccountManager]. Information about the roles of Account, apart from being a collection of settings, is explained in the [wiki:SipMiddlewareApi#Account Middleware API]. 
474 30 Luci Stanescu
475 1 Adrian Georgescu
The settings that can be accessed on an Account are described below:
476
477
 '''Account.id''' (type={{{SIPAddress}}})::
478
  This is not a setting, as it cannot be modified. Its type is a subclass of {{{str}}}, so it can be used as a normal string, however it also has two attributes {{{username}}} and {{{domain}}} which point to the specific parts of the SIP address.
479
480
 '''Account.display_name''' (type={{{str}}}, default={{{None}}}, nillable={{{True}}})::
481
  The contents of this setting will be sent as part of the ''From'' header when sending SIP requests, the ''From'' CPIM header and other similar information.
482
483
 '''Account.enabled''' (type={{{bool}}}, default={{{False}}})::
484
  If this setting is set to {{{True}}}, the Account will automatically activate and can be used in other parts of the middleware. More about this is described in [wiki:SipMiddlewareApi#Account Account].
485
486 45 Luci Stanescu
==== Auth ====
487
488
 '''Account.auth.username''' (type={{{str}}}, default={{{None}}}, nillable={{{True}}})::
489
  The username used for authentication if it is different from the one in the SIP ID of the account. If it is {{{None}}} or an empty string, the account SIP ID username will be used instead.
490
491
 '''Account.auth.password''' (type={{{str}}}, default={{{''}}})::
492 1 Adrian Georgescu
  The password, which will be used with this account for authentication.
493
494
495 33 Luci Stanescu
==== Dialog Event ====
496 1 Adrian Georgescu
497
 '''Account.dialog_event.enabled''' (type={{{bool}}}, default={{{True}}})::
498
  If this setting is set to {{{True}}}, the Account will subscribe to the ''dialog'' event as specified by RFC4235.
499
500 33 Luci Stanescu
==== Message Summary ====
501 1 Adrian Georgescu
502
 '''Account.message_summary.enabled''' (type={{{bool}}}, default={{{True}}})::
503
  If this setting is set to {{{True}}}, the Account will subscribe to the ''message-summary'' event, as specified by RFC3842.
504
505
 '''Account.message_summary.voicemail_uri''' (type={{{str}}}, default={{{None}}}, nillable={{{True}}})::
506
  This is the SIP URI which can be called to listen to the voicemail messages.
507
508 33 Luci Stanescu
==== NAT Traversal ====
509 1 Adrian Georgescu
510
 '''Account.nat_traversal.use_ice''' (type={{{bool}}}, default={{{False}}})::
511
  If this setting is set to {{{True}}}, ICE will be used for finding media candidates for communication over NAT-ed networks.
512
513
 '''Account.nat_traversal.stun_server_list''' (type={{{StunServerAddressList}}}, default={{{None}}}, nillable={{{True}}})::
514
  This setting used for NAT traversal can be used to specify the addresses of the STUN servers used for detecting server reflexive candidates in the context of ICE. The value of the setting is a tuple of objects of type {{{StunServerAddress}}}. If None, the servers will be looked up in the DNS (SRV record _stun._udp.domain).
515
516
 '''Account.nat_traversal.msrp_relay''' (type={{{MSRPRelayAddress}}}, default={{{None}}}, nillable={{{True}}})::
517 30 Luci Stanescu
  This setting can be used to specify a MSRP relay for use in MSRP connections. If it is set to {{{None}}}. If None, the servers will be looked up in the DNS (SRV record _msrps._tcp.domain).
518 1 Adrian Georgescu
519
 '''Account.nat_traversal.use_msrp_relay_for_inbound''' (type={{{bool}}}, default={{{True}}})::
520
  If this setting is set to {{{True}}}, the MSRP relay will be used for all incoming MSRP connections.
521
522
 '''Account.nat_traversal.use_msrp_relay_for_outbound''' (type={{{bool}}}, default={{{False}}})::
523 30 Luci Stanescu
  If this setting is set to {{{True}}}, the MSRP relay will be used for all outgoing MSRP connections.
524
525 33 Luci Stanescu
==== Presence ====
526 1 Adrian Georgescu
527 30 Luci Stanescu
 '''Account.presence.enabled''' (type={{{bool}}}, default={{{True}}})::
528 1 Adrian Georgescu
  If this setting is set to {{{True}}}, the Account will publish its presence state and subscribe to presence and presence.winfo Event packages.
529 30 Luci Stanescu
530
 '''Account.presence.use_rls''' (type={{{bool}}}, default={{{True}}})::
531
  If this setting is set to {{{True}}}, the Account will store its Buddy Lists in '''rls-services''' XCAP document  and send a single Subscribe for the ''presence'' event to the RLS services address to obtain the presence information for its buddies. If it is set to {{{False}}}, it will subscribe to each buddy individually.
532
533 33 Luci Stanescu
==== RTP ====
534 30 Luci Stanescu
535 1 Adrian Georgescu
 '''Account.rtp.audio_codecs''' (type={{{AudioCodecList}}}, default={{{None}}}, nillable={{{True}}})::
536
  This setting is used to specify the preferred audio codecs, which should be used for audio calls of this account. It must be a tuple containing only strings, which represent the supported codecs (speex, g722, g711, ilbc and gsm), in the order in which they are preferred, or {{{None}}} if the codec_list from the general rtp settings is to be used.
537
538
 '''Account.audio.srtp_encryption''' (type={{{SRTPEncryption}}}, default={{{'optional'}}})::
539
  The value of this setting specifies how the account requires the calls to be encrypted using SRTP. It can be one of the values {{{'disabled'}}}, {{{'optional'}}} or {{{'mandatory'}}}.
540
541
 '''Account.audio.use_srtp_without_tls''' (type={{{bool}}}, default={{{False}}})::
542
  If this setting is set to {{{True}}}, SRTP could be used even if the SIP signaling used to control the call is not over TLS.
543
544 33 Luci Stanescu
==== SIP ====
545 1 Adrian Georgescu
546 30 Luci Stanescu
 '''Account.sip.outbound_proxy''' (type={{{SIPProxyAddress}}}, default={{{None}}}, nillable={{{True}}})::
547 1 Adrian Georgescu
  This setting specifies whether to send all SIP requests when creating a new SIP dialog to a specific proxy. If this setting is set to {{{None}}}, then an RFC3263 lookup will be done based on the domain part of the SIP request URI.
548
549
 '''Account.sip.register''' (type={{{bool}}}, default={{{True}}})::
550
  If this setting is set to {{{True}}}, the Account will automatically register when it is active. More about this is described in [wiki:SipMiddlewareApi#Account Account].
551
552
 '''Account.sip.publish_interval''' (type={{{NonNegativeInteger}}}, default={{{600}}})::
553 31 Luci Stanescu
  This setting controls the number of seconds used for the ''Expire'' header when publishing events. It must be a non-negative integer.
554
555
 '''Account.sip.subscribe_interval''' (type={{{NonNegativeInteger}}}, default={{{600}}})::
556
  This setting controls the number of seconds used for the ''Expire'' header when subscribing to events. It must be a non-negative integer.
557
558
 '''Account.registration.interval''' (type={{{NonNegativeInteger}}}, default={{{600}}})::
559
  This setting controls the number of seconds used for the ''Expire'' header when registering. It must be a non-negative integer.
560
561 33 Luci Stanescu
==== TLS ====
562 31 Luci Stanescu
563 1 Adrian Georgescu
 '''Account.tls.certificate''' (type={{{Path}}}, default={{{None}}}, nillable={{{True}}})::
564 31 Luci Stanescu
  The path to the file that contains the certificate and its private key used to authenticate on TLS connections. It is interpreted as an absolute path, with a leading ''~'' expanded to the home directory of the current user. In order to access the full path to the TLS certificate, the normalized attribute on the setting can be used:
565
  {{{
566
  account.tls.certificate.normalized
567
  }}}
568
569
 '''Account.tls.verify_server''' (type={{{bool}}}, default={{{False}}})::
570
  If this setting is set to {{{True}}}, the middleware will verify the server's certificate when connecting via TLS.
571
572 33 Luci Stanescu
==== XCAP  ====
573 31 Luci Stanescu
574
 '''Account.xcap.enabled''' (type={{{bool}}}, default={{{True}}})::
575
  If this setting is set to {{{True}}}, The use of XCAP root set below will be activated.
576
577
 '''Account.xcap.xcap_root''' (type={{{XCAPRoot}}}, default={{{None}}}, nillable={{{True}}})::
578
  The XCAP root is required for accessing documents via the XCAP protocol. It must be a URL with either the ''http'' or ''https'' schemes.
579
580
 '''Account.xcap.use_xcap_diff''' (type={{{bool}}}, default={{{True}}})::
581
  If this setting is set to {{{True}}}, the Account will subscribe to the ''xcap-diff'' event in order to find out if the XCAP documents handled by the Account are modified by another entity.
582 1 Adrian Georgescu
583
584 33 Luci Stanescu
=== BonjourAccount ===
585 1 Adrian Georgescu
586 30 Luci Stanescu
{{{
587 1 Adrian Georgescu
Account bonjour@local:
588
          +-- display_name = Bonjour User
589
account --|-- enabled = False
590 34 Luci Stanescu
          |-- msrp
591 1 Adrian Georgescu
          |-- rtp
592 34 Luci Stanescu
          |-- sip
593 1 Adrian Georgescu
          +-- tls
594 34 Luci Stanescu
595
       +-- transport = tcp
596
msrp --|
597
       +
598 1 Adrian Georgescu
599
      +-- audio_codec_list = None
600
rtp --|-- inband_dtmf = False
601
      |-- srtp_encryption = optional
602 30 Luci Stanescu
      +-- use_srtp_without_tls = False
603 1 Adrian Georgescu
604 45 Luci Stanescu
      +-- transport_list = SIPTransportList(['udp'])
605 34 Luci Stanescu
sip --|
606
      +
607
608 30 Luci Stanescu
      +-- certificate = tls/bonjour@local.crt
609 1 Adrian Georgescu
tls --|-- verify_server = False
610 30 Luci Stanescu
      +
611
}}}
612 1 Adrian Georgescu
613 30 Luci Stanescu
The BonjourAccount is a singleton object as there can only be one bonjour account on a system. A bonjour account is used in P2P mode and does not interact with any server. Similar to the Account, it is used both as a complex object, which contains the required behavior for bonjour, as well as a container for the settings which apply to it. 
614 1 Adrian Georgescu
615 30 Luci Stanescu
The settings of the BonjourAccount are described below:
616
 
617
 '''BonjourAccount.id''' (type={{{SIPAddress}}})::
618
  This is not a setting, as it is the static string 'bonjour@local' which represents the id of the BonjourAccount.
619
620
 '''BonjourAccount.enabled''' (type={{{bool}}}, default={{{True}}})::
621
  If this setting is set to {{{True}}}, the account will be used. More information about this is in [wiki:SipMiddlewareApi#BonjourAccount BonjourAccount].
622
623
 '''BonjourAccount.display_name''' (type={{{str}}}, default={{{None}}}, nillable={{{True}}})::
624 1 Adrian Georgescu
  The contents of this setting will be sent as part of the ''From'' header when sending SIP requests.
625
626 34 Luci Stanescu
==== MSRP ====
627
628
 '''SIPSimpleSettings.msrp.transport''' (type={{{MSRPTransport}}}, default={{{'tcp'}}})::
629
  MSRP can use either TLS or TCP and this setting controls which one should be used for the bonjour account.
630
631 33 Luci Stanescu
==== RTP ====
632 30 Luci Stanescu
633
 '''BonjourAccount.rtp.audio_codec_list''' (type={{{AudioCodecList}}}, default={{{('speex', 'g722', 'g711', 'ilbc', 'gsm')}}})::
634 32 Luci Stanescu
  This setting is used to specify the preferred audio codecs, which should be used for audio calls of this account. It must be a tuple containing only strings, which represent the supported codecs (speex, g722, g711, ilbc and gsm), in the order in which they are preferred.
635 30 Luci Stanescu
636
 '''BonjourAccount.rtp.srtp_encryption''' (type={{{SRTPEncryption}}}, default={{{'optional'}}})::
637
  The value of this setting specifies how the account requires the calls to be encrypted using SRTP. It can be one of the values {{{'disabled'}}}, {{{'optional'}}} or {{{'mandatory'}}}.
638
639
 '''BonjourAccount.rtp.use_srtp_without_tls''' (type={{{bool}}}, default={{{False}}})::
640 1 Adrian Georgescu
  If this setting is set to {{{True}}}, SRTP could be used even if the SIP signaling used to control the call is not over TLS.
641 34 Luci Stanescu
642
==== SIP ====
643
644
 '''BonjourAccount.sip.transport_list''' (type={{{SIPTransportList}}}, default={{{SIPTransportList(['udp'])}}})::
645
  This setting's value is a tuple, which can only contain the strings 'tls', 'tcp' and 'udp'. It specifies which transports should be used for publishing the bonjour account using mDNS and which bonjour contacts to browse for.
646 30 Luci Stanescu
647 33 Luci Stanescu
==== TLS ====
648 30 Luci Stanescu
649
 '''BonjourAccount.tls.certificate''' (type={{{Path}}}, default={{{None}}}, nillable={{{True}}})::
650
  The path to the file that contains the certificate and its private key used to authenticate on TLS connections. It is interpreted as an absolute path, with a leading ''~'' expanded to the home directory of the current user. In order to access the full path to the certificate file, the normalized attribute on the setting can be used:
651
  {{{
652
  BonjourAccount().tls.ca_list.normalized
653
  }}}
654
655
 '''BonjourAccount.tls.verify_server''' (type={{{bool}}}, default={{{False}}})::
656
  If this setting is set to {{{True}}}, the middleware will verify the server's certificate when connecting via TLS.
657 29 Luci Stanescu
658 35 Luci Stanescu
== SIPClients Settings ==
659 30 Luci Stanescu
660
The SIPClients scripts use the Configuration API to extend the settings in the middleware with some application-specific settings. The following sections list these additional settings in order to provide an example for the kind of settings which, being application specific, do not find their place in the middleware and should be added by the application.
661 29 Luci Stanescu
662 38 Adrian Georgescu
=== General ===
663 29 Luci Stanescu
664
 '''SIPSimpleSettings.user_data_directory''' (type={{{AbsolutePath}}}, default={{{'~/.sipclient}}})::
665
  This is the directory, which will be used by default for storing the SIP SIMPLE data. The relative paths are calculated on runtime based on this setting, which means that if this setting is changed, all relative paths will point inside the new directory. It is a string, which must be an absolute path.
666
667 33 Luci Stanescu
==== Audio ====
668 29 Luci Stanescu
669
 '''SIPSimpleSettings.audio.directory''' (type={{{DataPath}}}, default={{{DataPath('history')}}})::
670
  This directory will be used to store recorded audio conversations. Under this directory, a subdirectory per account with the id of the account as the name will be created. If it is set to relative path, it is taken relative to {{{SIPSimpleSettings.user_data_directory}}}; otherwise it is interpreted as an absolute path. In order to access the full path to the history directory, the value attribute on the setting can be used:
671
  {{{
672
  SIPSimpleSettings().audio.directory.value
673
  }}}
674
675 33 Luci Stanescu
==== File Transfer ====
676 29 Luci Stanescu
677
 '''SIPSimpleSettings.file_transfer.directory''' (type={{{DataPath}}}, default={{{DataPath('file_transfers')}}})::
678
  This directory is used to store the files obtained via MSRP file transfer. If it is set to relative path, it is taken relative to {{{SIPSimpleSettings.user_data_directory}}}; otherwise it is interpreted as an absolute path. In order to access the full path to the history directory, the value attribute on the setting can be used:
679
  {{{
680
  SIPSimpleSettings().file_transfer.directory.value
681
  }}}
682
683 33 Luci Stanescu
==== Logs ====
684 29 Luci Stanescu
685
 '''SIPSimpleSettings.logs.directory''' (type={{{DataPath}}}, default={{{DataPath('logs')}}})::
686
  This is the directory where the logs create by the SIP SIMPLE middleware will be stored. If it is set to relative path, it is taken relative to {{{SIPSimpleSettings.user_data_directory}}}; otherwise it is interpreted as an absolute path. In order to access the full path to the history directory, the value attribute on the setting can be used:
687
  {{{
688
  SIPSimpleSettings().logs.directory.value
689
  }}}
690
691
 '''SIPSimpleSettings.logs.trace_sip''' (type={{{bool}}}, default={{{False}}})::
692
  If this setting is set to True, the SIP packets will be written to a log file named 'sip_trace.txt', inside the directory pointed by {{{SIPSimpleSettings.logging.directory}}}.
693
694
 '''SIPSimpleSettings.logs.trace_pjsip''' (type={{{bool}}}, default={{{False}}})::
695
  If this setting is set to True, the PJSIP log messages will be written to a log file named 'pjsip_trace.txt', inside the directory pointed by {{{SIPSimpleSettings.logging.directory}}}.
696
697
 '''SIPSimpleSettings.logs.trace_msrp''' (type={{{bool}}}, default={{{False}}})::
698
  If this setting is set to True, the MSRP packets will be written to a log file named 'msrp_trace.txt', inside the directory pointed by {{{SIPSimpleSettings.logging.directory}}}.
699
700
 '''SIPSimpleSettings.logs.trace_xcap''' (type={{{bool}}}, default={{{False}}})::
701
  If this setting is set to True, the XCAP packets will be written to a log file named 'xcap_trace.txt', inside the directory pointed by {{{SIPSimpleSettings.logging.directory}}}.
702
703 33 Luci Stanescu
==== Sounds ====
704 29 Luci Stanescu
705
 '''SIPSimpleSettings.sounds.audio_inbound''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
706
  This setting should point to a wav file, which will be played when a SIP session request is received. If it is set to {{{None}}}, no sound will be played.
707
708
 '''SIPSimpleSettings.sounds.audio_outbound''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
709
  This setting should point to a wav file, which will be used as ringtone during an outgoing SIP session request as a response to a 180 Ringing. If it is set to {{{None}}}, no sound will be played.
710
711
 '''SIPSimpleSettings.sounds.file_sent''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
712
  This setting should point to a wav file, which will be played when an outgoing file transfer is finished. If it is set to {{{None}}}, no sound will be played.
713
714
 '''SIPSimpleSettings.sounds.file_received''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
715
  This setting should point to a wav file, which will be played when an incoming file transfer is finished. If it is set to {{{None}}}, no sound will be played.
716
717
 '''SIPSimpleSettings.sounds.message_sent''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
718
  This setting is a string representing an absolute path to a wav file, which is played when a message is sent in a chat session. If it is set to {{{None}}}, no sound is played.
719
720
 '''SIPSimpleSettings.sounds.message_received''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
721
  This setting is a string representing an absolute path to a wav file, which is played when a message is received in a chat session. If it is set to {{{None}}}, no sound is played.
722
723 33 Luci Stanescu
=== Account ===
724 29 Luci Stanescu
725 33 Luci Stanescu
==== Sounds ====
726 29 Luci Stanescu
727
 '''Account.sounds.audio_inbound''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
728
  This setting should point to a wav file, which will be used to play the incoming ringtone. If it is set to {{{None}}}, the wav file set in {{{SIPSimpleSettings.sounds.audio_inbound}}} will be used instead.
729
730 33 Luci Stanescu
=== BonjourAccount ===
731 29 Luci Stanescu
732 33 Luci Stanescu
==== Sounds ====
733 29 Luci Stanescu
734
 '''BonjourAccount.sounds.audio_inbound''' (type={{{AbsolutePath}}}, default={{{None}}}, nillable={{{True}}})::
735 1 Adrian Georgescu
  This setting should point to a wav file which will be used as the incoming ringtone. If it is set to {{{None}}}, the wav file set in {{{SIPSimpleSettings.sounds.audio_inbound}}} will be used instead.