res_pjsip: make it unloadable
[asterisk/asterisk.git] / res / res_pjsip.c
1 /*
2  * Asterisk -- An open source telephony toolkit.
3  *
4  * Copyright (C) 2013, Digium, Inc.
5  *
6  * Mark Michelson <mmichelson@digium.com>
7  *
8  * See http://www.asterisk.org for more information about
9  * the Asterisk project. Please do not directly contact
10  * any of the maintainers of this project for assistance;
11  * the project provides a web site, mailing lists and IRC
12  * channels for your use.
13  *
14  * This program is free software, distributed under the terms of
15  * the GNU General Public License Version 2. See the LICENSE file
16  * at the top of the source tree.
17  */
18
19 #include "asterisk.h"
20
21 #include <pjsip.h>
22 /* Needed for SUBSCRIBE, NOTIFY, and PUBLISH method definitions */
23 #include <pjsip_simple.h>
24 #include <pjlib.h>
25
26 #include "asterisk/res_pjsip.h"
27 #include "res_pjsip/include/res_pjsip_private.h"
28 #include "asterisk/linkedlists.h"
29 #include "asterisk/logger.h"
30 #include "asterisk/lock.h"
31 #include "asterisk/utils.h"
32 #include "asterisk/astobj2.h"
33 #include "asterisk/module.h"
34 #include "asterisk/threadpool.h"
35 #include "asterisk/taskprocessor.h"
36 #include "asterisk/uuid.h"
37 #include "asterisk/sorcery.h"
38 #include "asterisk/file.h"
39
40 /*** MODULEINFO
41         <depend>pjproject</depend>
42         <depend>res_sorcery_config</depend>
43         <depend>res_sorcery_memory</depend>
44         <depend>res_sorcery_astdb</depend>
45         <support_level>core</support_level>
46  ***/
47
48 /*** DOCUMENTATION
49         <configInfo name="res_pjsip" language="en_US">
50                 <synopsis>SIP Resource using PJProject</synopsis>
51                 <configFile name="pjsip.conf">
52                         <configObject name="endpoint">
53                                 <synopsis>Endpoint</synopsis>
54                                 <description><para>
55                                         The <emphasis>Endpoint</emphasis> is the primary configuration object.
56                                         It contains the core SIP related options only, endpoints are <emphasis>NOT</emphasis>
57                                         dialable entries of their own. Communication with another SIP device is
58                                         accomplished via Addresses of Record (AoRs) which have one or more
59                                         contacts assicated with them. Endpoints <emphasis>NOT</emphasis> configured to
60                                         use a <literal>transport</literal> will default to first transport found
61                                         in <filename>pjsip.conf</filename> that matches its type.
62                                         </para>
63                                         <para>Example: An Endpoint has been configured with no transport.
64                                         When it comes time to call an AoR, PJSIP will find the
65                                         first transport that matches the type. A SIP URI of <literal>sip:5000@[11::33]</literal>
66                                         will use the first IPv6 transport and try to send the request.
67                                         </para>
68                                         <para>If the anonymous endpoint identifier is in use an endpoint with the name
69                                         "anonymous@domain" will be searched for as a last resort. If this is not found
70                                         it will fall back to searching for "anonymous". If neither endpoints are found
71                                         the anonymous endpoint identifier will not return an endpoint and anonymous
72                                         calling will not be possible.
73                                         </para>
74                                 </description>
75                                 <configOption name="100rel" default="yes">
76                                         <synopsis>Allow support for RFC3262 provisional ACK tags</synopsis>
77                                         <description>
78                                                 <enumlist>
79                                                         <enum name="no" />
80                                                         <enum name="required" />
81                                                         <enum name="yes" />
82                                                 </enumlist>
83                                         </description>
84                                 </configOption>
85                                 <configOption name="aggregate_mwi" default="yes">
86                                         <synopsis>Condense MWI notifications into a single NOTIFY.</synopsis>
87                                         <description><para>When enabled, <replaceable>aggregate_mwi</replaceable> condenses message
88                                         waiting notifications from multiple mailboxes into a single NOTIFY. If it is disabled,
89                                         individual NOTIFYs are sent for each mailbox.</para></description>
90                                 </configOption>
91                                 <configOption name="allow">
92                                         <synopsis>Media Codec(s) to allow</synopsis>
93                                 </configOption>
94                                 <configOption name="aors">
95                                         <synopsis>AoR(s) to be used with the endpoint</synopsis>
96                                         <description><para>
97                                                 List of comma separated AoRs that the endpoint should be associated with.
98                                         </para></description>
99                                 </configOption>
100                                 <configOption name="auth">
101                                         <synopsis>Authentication Object(s) associated with the endpoint</synopsis>
102                                         <description><para>
103                                                 This is a comma-delimited list of <replaceable>auth</replaceable> sections defined
104                                                 in <filename>pjsip.conf</filename> to be used to verify inbound connection attempts.
105                                                 </para><para>
106                                                 Endpoints without an <literal>authentication</literal> object
107                                                 configured will allow connections without vertification.
108                                         </para></description>
109                                 </configOption>
110                                 <configOption name="callerid">
111                                         <synopsis>CallerID information for the endpoint</synopsis>
112                                         <description><para>
113                                                 Must be in the format <literal>Name &lt;Number&gt;</literal>,
114                                                 or only <literal>&lt;Number&gt;</literal>.
115                                         </para></description>
116                                 </configOption>
117                                 <configOption name="callerid_privacy">
118                                         <synopsis>Default privacy level</synopsis>
119                                         <description>
120                                                 <enumlist>
121                                                         <enum name="allowed_not_screened" />
122                                                         <enum name="allowed_passed_screen" />
123                                                         <enum name="allowed_failed_screen" />
124                                                         <enum name="allowed" />
125                                                         <enum name="prohib_not_screened" />
126                                                         <enum name="prohib_passed_screen" />
127                                                         <enum name="prohib_failed_screen" />
128                                                         <enum name="prohib" />
129                                                         <enum name="unavailable" />
130                                                 </enumlist>
131                                         </description>
132                                 </configOption>
133                                 <configOption name="callerid_tag">
134                                         <synopsis>Internal id_tag for the endpoint</synopsis>
135                                 </configOption>
136                                 <configOption name="context">
137                                         <synopsis>Dialplan context for inbound sessions</synopsis>
138                                 </configOption>
139                                 <configOption name="direct_media_glare_mitigation" default="none">
140                                         <synopsis>Mitigation of direct media (re)INVITE glare</synopsis>
141                                         <description>
142                                                 <para>
143                                                 This setting attempts to avoid creating INVITE glare scenarios
144                                                 by disabling direct media reINVITEs in one direction thereby allowing
145                                                 designated servers (according to this option) to initiate direct
146                                                 media reINVITEs without contention and significantly reducing call
147                                                 setup time.
148                                                 </para>
149                                                 <para>
150                                                 A more detailed description of how this option functions can be found on
151                                                 the Asterisk wiki https://wiki.asterisk.org/wiki/display/AST/SIP+Direct+Media+Reinvite+Glare+Avoidance
152                                                 </para>
153                                                 <enumlist>
154                                                         <enum name="none" />
155                                                         <enum name="outgoing" />
156                                                         <enum name="incoming" />
157                                                 </enumlist>
158                                         </description>
159                                 </configOption>
160                                 <configOption name="direct_media_method" default="invite">
161                                         <synopsis>Direct Media method type</synopsis>
162                                         <description>
163                                                 <para>Method for setting up Direct Media between endpoints.</para>
164                                                 <enumlist>
165                                                         <enum name="invite" />
166                                                         <enum name="reinvite">
167                                                                 <para>Alias for the <literal>invite</literal> value.</para>
168                                                         </enum>
169                                                         <enum name="update" />
170                                                 </enumlist>
171                                         </description>
172                                 </configOption>
173                                 <configOption name="connected_line_method" default="invite">
174                                         <synopsis>Connected line method type</synopsis>
175                                         <description>
176                                                 <para>Method used when updating connected line information.</para>
177                                                 <enumlist>
178                                                         <enum name="invite" />
179                                                         <enum name="reinvite">
180                                                                 <para>Alias for the <literal>invite</literal> value.</para>
181                                                         </enum>
182                                                         <enum name="update" />
183                                                 </enumlist>
184                                         </description>
185                                 </configOption>
186                                 <configOption name="direct_media" default="yes">
187                                         <synopsis>Determines whether media may flow directly between endpoints.</synopsis>
188                                 </configOption>
189                                 <configOption name="disable_direct_media_on_nat" default="no">
190                                         <synopsis>Disable direct media session refreshes when NAT obstructs the media session</synopsis>
191                                 </configOption>
192                                 <configOption name="disallow">
193                                         <synopsis>Media Codec(s) to disallow</synopsis>
194                                 </configOption>
195                                 <configOption name="dtmf_mode" default="rfc4733">
196                                         <synopsis>DTMF mode</synopsis>
197                                         <description>
198                                                 <para>This setting allows to choose the DTMF mode for endpoint communication.</para>
199                                                 <enumlist>
200                                                         <enum name="rfc4733">
201                                                                 <para>DTMF is sent out of band of the main audio stream.This
202                                                                 supercedes the older <emphasis>RFC-2833</emphasis> used within
203                                                                 the older <literal>chan_sip</literal>.</para>
204                                                         </enum>
205                                                         <enum name="inband">
206                                                                 <para>DTMF is sent as part of audio stream.</para>
207                                                         </enum>
208                                                         <enum name="info">
209                                                                 <para>DTMF is sent as SIP INFO packets.</para>
210                                                         </enum>
211                                                 </enumlist>
212                                         </description>
213                                 </configOption>
214                                 <configOption name="media_address">
215                                         <synopsis>IP address used in SDP for media handling</synopsis>
216                                         <description><para>
217                                                 At the time of SDP creation, the IP address defined here will be used as
218                                                 the media address for individual streams in the SDP.
219                                         </para>
220                                         <note><para>
221                                                 Be aware that the <literal>external_media_address</literal> option, set in Transport
222                                                 configuration, can also affect the final media address used in the SDP.
223                                         </para></note>
224                                         </description>
225                                 </configOption>
226                                 <configOption name="force_rport" default="yes">
227                                         <synopsis>Force use of return port</synopsis>
228                                 </configOption>
229                                 <configOption name="ice_support" default="no">
230                                         <synopsis>Enable the ICE mechanism to help traverse NAT</synopsis>
231                                 </configOption>
232                                 <configOption name="identify_by" default="username,location">
233                                         <synopsis>Way(s) for Endpoint to be identified</synopsis>
234                                         <description><para>
235                                                 An endpoint can be identified in multiple ways. Currently, the only supported
236                                                 option is <literal>username</literal>, which matches the endpoint based on the
237                                                 username in the From header.
238                                                 </para>
239                                                 <note><para>Endpoints can also be identified by IP address; however, that method
240                                                 of identification is not handled by this configuration option. See the documentation
241                                                 for the <literal>identify</literal> configuration section for more details on that
242                                                 method of endpoint identification. If this option is set to <literal>username</literal>
243                                                 and an <literal>identify</literal> configuration section exists for the endpoint, then
244                                                 the endpoint can be identified in multiple ways.</para></note>
245                                                 <enumlist>
246                                                         <enum name="username" />
247                                                 </enumlist>
248                                         </description>
249                                 </configOption>
250                                 <configOption name="redirect_method">
251                                         <synopsis>How redirects received from an endpoint are handled</synopsis>
252                                         <description><para>
253                                                 When a redirect is received from an endpoint there are multiple ways it can be handled.
254                                                 If this option is set to <literal>user</literal> the user portion of the redirect target
255                                                 is treated as an extension within the dialplan and dialed using a Local channel. If this option
256                                                 is set to <literal>uri_core</literal> the target URI is returned to the dialing application
257                                                 which dials it using the PJSIP channel driver and endpoint originally used. If this option is
258                                                 set to <literal>uri_pjsip</literal> the redirect occurs within chan_pjsip itself and is not exposed
259                                                 to the core at all. The <literal>uri_pjsip</literal> option has the benefit of being more efficient
260                                                 and also supporting multiple potential redirect targets. The con is that since redirection occurs
261                                                 within chan_pjsip redirecting information is not forwarded and redirection can not be
262                                                 prevented.
263                                                 </para>
264                                                 <enumlist>
265                                                         <enum name="user" />
266                                                         <enum name="uri_core" />
267                                                         <enum name="uri_pjsip" />
268                                                 </enumlist>
269                                         </description>
270                                 </configOption>
271                                 <configOption name="mailboxes">
272                                         <synopsis>NOTIFY the endpoint when state changes for any of the specified mailboxes</synopsis>
273                                         <description><para>
274                                                 Asterisk will send unsolicited MWI NOTIFY messages to the endpoint when state
275                                                 changes happen for any of the specified mailboxes. More than one mailbox can be
276                                                 specified with a comma-delimited string. app_voicemail mailboxes must be specified
277                                                 as mailbox@context; for example: mailboxes=6001@default. For mailboxes provided by
278                                                 external sources, such as through the res_external_mwi module, you must specify
279                                                 strings supported by the external system.
280                                         </para><para>
281                                                 For endpoints that SUBSCRIBE for MWI, use the <literal>mailboxes</literal> option in your AOR
282                                                 configuration.
283                                         </para></description>
284                                 </configOption>
285                                 <configOption name="moh_suggest" default="default">
286                                         <synopsis>Default Music On Hold class</synopsis>
287                                 </configOption>
288                                 <configOption name="outbound_auth">
289                                         <synopsis>Authentication object used for outbound requests</synopsis>
290                                 </configOption>
291                                 <configOption name="outbound_proxy">
292                                         <synopsis>Proxy through which to send requests, a full SIP URI must be provided</synopsis>
293                                 </configOption>
294                                 <configOption name="rewrite_contact">
295                                         <synopsis>Allow Contact header to be rewritten with the source IP address-port</synopsis>
296                                         <description><para>
297                                                 On inbound SIP messages from this endpoint, the Contact header will be changed to have the
298                                                 source IP address and port. This option does not affect outbound messages send to this
299                                                 endpoint.
300                                         </para></description>
301                                 </configOption>
302                                 <configOption name="rtp_ipv6" default="no">
303                                         <synopsis>Allow use of IPv6 for RTP traffic</synopsis>
304                                 </configOption>
305                                 <configOption name="rtp_symmetric" default="no">
306                                         <synopsis>Enforce that RTP must be symmetric</synopsis>
307                                 </configOption>
308                                 <configOption name="send_diversion" default="yes">
309                                         <synopsis>Send the Diversion header, conveying the diversion
310                                         information to the called user agent</synopsis>
311                                 </configOption>
312                                 <configOption name="send_pai" default="no">
313                                         <synopsis>Send the P-Asserted-Identity header</synopsis>
314                                 </configOption>
315                                 <configOption name="send_rpid" default="no">
316                                         <synopsis>Send the Remote-Party-ID header</synopsis>
317                                 </configOption>
318                                 <configOption name="timers_min_se" default="90">
319                                         <synopsis>Minimum session timers expiration period</synopsis>
320                                         <description><para>
321                                                 Minimium session timer expiration period. Time in seconds.
322                                         </para></description>
323                                 </configOption>
324                                 <configOption name="timers" default="yes">
325                                         <synopsis>Session timers for SIP packets</synopsis>
326                                         <description>
327                                                 <enumlist>
328                                                         <enum name="forced" />
329                                                         <enum name="no" />
330                                                         <enum name="required" />
331                                                         <enum name="yes" />
332                                                 </enumlist>
333                                         </description>
334                                 </configOption>
335                                 <configOption name="timers_sess_expires" default="1800">
336                                         <synopsis>Maximum session timer expiration period</synopsis>
337                                         <description><para>
338                                                 Maximium session timer expiration period. Time in seconds.
339                                         </para></description>
340                                 </configOption>
341                                 <configOption name="transport">
342                                         <synopsis>Desired transport configuration</synopsis>
343                                         <description><para>
344                                                 This will set the desired transport configuration to send SIP data through.
345                                                 </para>
346                                                 <warning><para>Not specifying a transport will <emphasis>DEFAULT</emphasis>
347                                                 to the first configured transport in <filename>pjsip.conf</filename> which is
348                                                 valid for the URI we are trying to contact.
349                                                 </para></warning>
350                                                 <warning><para>Transport configuration is not affected by reloads. In order to
351                                                 change transports, a full Asterisk restart is required</para></warning>
352                                         </description>
353                                 </configOption>
354                                 <configOption name="trust_id_inbound" default="no">
355                                         <synopsis>Accept identification information received from this endpoint</synopsis>
356                                         <description><para>This option determines whether Asterisk will accept
357                                         identification from the endpoint from headers such as P-Asserted-Identity
358                                         or Remote-Party-ID header. This option applies both to calls originating from the
359                                         endpoint and calls originating from Asterisk. If <literal>no</literal>, the
360                                         configured Caller-ID from pjsip.conf will always be used as the identity for
361                                         the endpoint.</para></description>
362                                 </configOption>
363                                 <configOption name="trust_id_outbound" default="no">
364                                         <synopsis>Send private identification details to the endpoint.</synopsis>
365                                         <description><para>This option determines whether res_pjsip will send private
366                                         identification information to the endpoint. If <literal>no</literal>,
367                                         private Caller-ID information will not be forwarded to the endpoint.
368                                         "Private" in this case refers to any method of restricting identification.
369                                         Example: setting <replaceable>callerid_privacy</replaceable> to any
370                                         <literal>prohib</literal> variation.
371                                         Example: If <replaceable>trust_id_inbound</replaceable> is set to
372                                         <literal>yes</literal>, the presence of a <literal>Privacy: id</literal>
373                                         header in a SIP request or response would indicate the identification
374                                         provided in the request is private.</para></description>
375                                 </configOption>
376                                 <configOption name="type">
377                                         <synopsis>Must be of type 'endpoint'.</synopsis>
378                                 </configOption>
379                                 <configOption name="use_ptime" default="no">
380                                         <synopsis>Use Endpoint's requested packetisation interval</synopsis>
381                                 </configOption>
382                                 <configOption name="use_avpf" default="no">
383                                         <synopsis>Determines whether res_pjsip will use and enforce usage of AVPF for this
384                                         endpoint.</synopsis>
385                                         <description><para>
386                                                 If set to <literal>yes</literal>, res_pjsip will use the AVPF or SAVPF RTP
387                                                 profile for all media offers on outbound calls and media updates and will
388                                                 decline media offers not using the AVPF or SAVPF profile.
389                                         </para><para>
390                                                 If set to <literal>no</literal>, res_pjsip will use the AVP or SAVP RTP
391                                                 profile for all media offers on outbound calls and media updates, and will
392                                                 decline media offers not using the AVP or SAVP profile.
393                                         </para></description>
394                                 </configOption>
395                                 <configOption name="force_avp" default="no">
396                                         <synopsis>Determines whether res_pjsip will use and enforce usage of AVP,
397                                         regardless of the RTP profile in use for this endpoint.</synopsis>
398                                         <description><para>
399                                                 If set to <literal>yes</literal>, res_pjsip will use the AVP, AVPF, SAVP, or
400                                                 SAVPF RTP profile for all media offers on outbound calls and media updates including
401                                                 those for DTLS-SRTP streams.
402                                         </para><para>
403                                                 If set to <literal>no</literal>, res_pjsip will use the respective RTP profile
404                                                 depending on configuration.
405                                         </para></description>
406                                 </configOption>
407                                 <configOption name="media_use_received_transport" default="no">
408                                         <synopsis>Determines whether res_pjsip will use the media transport received in the
409                                         offer SDP in the corresponding answer SDP.</synopsis>
410                                         <description><para>
411                                                 If set to <literal>yes</literal>, res_pjsip will use the received media transport.
412                                         </para><para>
413                                                 If set to <literal>no</literal>, res_pjsip will use the respective RTP profile
414                                                 depending on configuration.
415                                         </para></description>
416                                 </configOption>
417                                 <configOption name="media_encryption" default="no">
418                                         <synopsis>Determines whether res_pjsip will use and enforce usage of media encryption
419                                         for this endpoint.</synopsis>
420                                         <description>
421                                                 <enumlist>
422                                                         <enum name="no"><para>
423                                                                 res_pjsip will offer no encryption and allow no encryption to be setup.
424                                                         </para></enum>
425                                                         <enum name="sdes"><para>
426                                                                 res_pjsip will offer standard SRTP setup via in-SDP keys. Encrypted SIP
427                                                                 transport should be used in conjunction with this option to prevent
428                                                                 exposure of media encryption keys.
429                                                         </para></enum>
430                                                         <enum name="dtls"><para>
431                                                                 res_pjsip will offer DTLS-SRTP setup.
432                                                         </para></enum>
433                                                 </enumlist>
434                                         </description>
435                                 </configOption>
436                                 <configOption name="media_encryption_optimistic" default="no">
437                                         <synopsis>Determines whether encryption should be used if possible but does not terminate the
438                                         session if not achieved.</synopsis>
439                                         <description><para>
440                                                 This option only applies if <replaceable>media_encryption</replaceable> is
441                                                 set to <literal>sdes</literal> or <literal>dtls</literal>.
442                                         </para></description>
443                                 </configOption>
444                                 <configOption name="inband_progress" default="no">
445                                         <synopsis>Determines whether chan_pjsip will indicate ringing using inband
446                                             progress.</synopsis>
447                                         <description><para>
448                                                 If set to <literal>yes</literal>, chan_pjsip will send a 183 Session Progress
449                                                 when told to indicate ringing and will immediately start sending ringing
450                                                 as audio.
451                                         </para><para>
452                                                 If set to <literal>no</literal>, chan_pjsip will send a 180 Ringing when told
453                                                 to indicate ringing and will NOT send it as audio.
454                                         </para></description>
455                                 </configOption>
456                                 <configOption name="call_group">
457                                         <synopsis>The numeric pickup groups for a channel.</synopsis>
458                                         <description><para>
459                                                 Can be set to a comma separated list of numbers or ranges between the values
460                                                 of 0-63 (maximum of 64 groups).
461                                         </para></description>
462                                 </configOption>
463                                 <configOption name="pickup_group">
464                                         <synopsis>The numeric pickup groups that a channel can pickup.</synopsis>
465                                         <description><para>
466                                                 Can be set to a comma separated list of numbers or ranges between the values
467                                                 of 0-63 (maximum of 64 groups).
468                                         </para></description>
469                                 </configOption>
470                                 <configOption name="named_call_group">
471                                         <synopsis>The named pickup groups for a channel.</synopsis>
472                                         <description><para>
473                                                 Can be set to a comma separated list of case sensitive strings limited by
474                                                 supported line length.
475                                         </para></description>
476                                 </configOption>
477                                 <configOption name="named_pickup_group">
478                                         <synopsis>The named pickup groups that a channel can pickup.</synopsis>
479                                         <description><para>
480                                                 Can be set to a comma separated list of case sensitive strings limited by
481                                                 supported line length.
482                                         </para></description>
483                                 </configOption>
484                                 <configOption name="device_state_busy_at" default="0">
485                                         <synopsis>The number of in-use channels which will cause busy to be returned as device state</synopsis>
486                                         <description><para>
487                                                 When the number of in-use channels for the endpoint matches the devicestate_busy_at setting the
488                                                 PJSIP channel driver will return busy as the device state instead of in use.
489                                         </para></description>
490                                 </configOption>
491                                 <configOption name="t38_udptl" default="no">
492                                         <synopsis>Whether T.38 UDPTL support is enabled or not</synopsis>
493                                         <description><para>
494                                                 If set to yes T.38 UDPTL support will be enabled, and T.38 negotiation requests will be accepted
495                                                 and relayed.
496                                         </para></description>
497                                 </configOption>
498                                 <configOption name="t38_udptl_ec" default="none">
499                                         <synopsis>T.38 UDPTL error correction method</synopsis>
500                                         <description>
501                                                 <enumlist>
502                                                         <enum name="none"><para>
503                                                                 No error correction should be used.
504                                                         </para></enum>
505                                                         <enum name="fec"><para>
506                                                                 Forward error correction should be used.
507                                                         </para></enum>
508                                                         <enum name="redundancy"><para>
509                                                                 Redundacy error correction should be used.
510                                                         </para></enum>
511                                                 </enumlist>
512                                         </description>
513                                 </configOption>
514                                 <configOption name="t38_udptl_maxdatagram" default="0">
515                                         <synopsis>T.38 UDPTL maximum datagram size</synopsis>
516                                         <description><para>
517                                                 This option can be set to override the maximum datagram of a remote endpoint for broken
518                                                 endpoints.
519                                         </para></description>
520                                 </configOption>
521                                 <configOption name="fax_detect" default="no">
522                                         <synopsis>Whether CNG tone detection is enabled</synopsis>
523                                         <description><para>
524                                                 This option can be set to send the session to the fax extension when a CNG tone is
525                                                 detected.
526                                         </para></description>
527                                 </configOption>
528                                 <configOption name="t38_udptl_nat" default="no">
529                                         <synopsis>Whether NAT support is enabled on UDPTL sessions</synopsis>
530                                         <description><para>
531                                                 When enabled the UDPTL stack will send UDPTL packets to the source address of
532                                                 received packets.
533                                         </para></description>
534                                 </configOption>
535                                 <configOption name="t38_udptl_ipv6" default="no">
536                                         <synopsis>Whether IPv6 is used for UDPTL Sessions</synopsis>
537                                         <description><para>
538                                                 When enabled the UDPTL stack will use IPv6.
539                                         </para></description>
540                                 </configOption>
541                                 <configOption name="tone_zone">
542                                         <synopsis>Set which country's indications to use for channels created for this endpoint.</synopsis>
543                                 </configOption>
544                                 <configOption name="language">
545                                         <synopsis>Set the default language to use for channels created for this endpoint.</synopsis>
546                                 </configOption>
547                                 <configOption name="one_touch_recording" default="no">
548                                         <synopsis>Determines whether one-touch recording is allowed for this endpoint.</synopsis>
549                                         <see-also>
550                                                 <ref type="configOption">record_on_feature</ref>
551                                                 <ref type="configOption">record_off_feature</ref>
552                                         </see-also>
553                                 </configOption>
554                                 <configOption name="record_on_feature" default="automixmon">
555                                         <synopsis>The feature to enact when one-touch recording is turned on.</synopsis>
556                                         <description>
557                                                 <para>When an INFO request for one-touch recording arrives with a Record header set to "on", this
558                                                 feature will be enabled for the channel. The feature designated here can be any built-in
559                                                 or dynamic feature defined in features.conf.</para>
560                                                 <note><para>This setting has no effect if the endpoint's one_touch_recording option is disabled</para></note>
561                                         </description>
562                                         <see-also>
563                                                 <ref type="configOption">one_touch_recording</ref>
564                                                 <ref type="configOption">record_off_feature</ref>
565                                         </see-also>
566                                 </configOption>
567                                 <configOption name="record_off_feature" default="automixmon">
568                                         <synopsis>The feature to enact when one-touch recording is turned off.</synopsis>
569                                         <description>
570                                                 <para>When an INFO request for one-touch recording arrives with a Record header set to "off", this
571                                                 feature will be enabled for the channel. The feature designated here can be any built-in
572                                                 or dynamic feature defined in features.conf.</para>
573                                                 <note><para>This setting has no effect if the endpoint's one_touch_recording option is disabled</para></note>
574                                         </description>
575                                         <see-also>
576                                                 <ref type="configOption">one_touch_recording</ref>
577                                                 <ref type="configOption">record_on_feature</ref>
578                                         </see-also>
579                                 </configOption>
580                                 <configOption name="rtp_engine" default="asterisk">
581                                         <synopsis>Name of the RTP engine to use for channels created for this endpoint</synopsis>
582                                 </configOption>
583                                 <configOption name="allow_transfer" default="yes">
584                                         <synopsis>Determines whether SIP REFER transfers are allowed for this endpoint</synopsis>
585                                 </configOption>
586                                 <configOption name="user_eq_phone" default="no">
587                                         <synopsis>Determines whether a user=phone parameter is placed into the request URI if the user is determined to be a phone number</synopsis>
588                                 </configOption>
589                                 <configOption name="moh_passthrough" default="no">
590                                         <synopsis>Determines whether hold and unhold will be passed through using re-INVITEs with recvonly and sendrecv to the remote side</synopsis>
591                                 </configOption>
592                                 <configOption name="sdp_owner" default="-">
593                                         <synopsis>String placed as the username portion of an SDP origin (o=) line.</synopsis>
594                                 </configOption>
595                                 <configOption name="sdp_session" default="Asterisk">
596                                         <synopsis>String used for the SDP session (s=) line.</synopsis>
597                                 </configOption>
598                                 <configOption name="tos_audio">
599                                         <synopsis>DSCP TOS bits for audio streams</synopsis>
600                                         <description><para>
601                                                 See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for more information about QoS settings
602                                         </para></description>
603                                 </configOption>
604                                 <configOption name="tos_video">
605                                         <synopsis>DSCP TOS bits for video streams</synopsis>
606                                         <description><para>
607                                                 See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for more information about QoS settings
608                                         </para></description>
609                                 </configOption>
610                                 <configOption name="cos_audio">
611                                         <synopsis>Priority for audio streams</synopsis>
612                                         <description><para>
613                                                 See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for more information about QoS settings
614                                         </para></description>
615                                 </configOption>
616                                 <configOption name="cos_video">
617                                         <synopsis>Priority for video streams</synopsis>
618                                         <description><para>
619                                                 See https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service for more information about QoS settings
620                                         </para></description>
621                                 </configOption>
622                                 <configOption name="allow_subscribe" default="yes">
623                                         <synopsis>Determines if endpoint is allowed to initiate subscriptions with Asterisk.</synopsis>
624                                 </configOption>
625                                 <configOption name="sub_min_expiry" default="60">
626                                         <synopsis>The minimum allowed expiry time for subscriptions initiated by the endpoint.</synopsis>
627                                 </configOption>
628                                 <configOption name="from_user">
629                                         <synopsis>Username to use in From header for requests to this endpoint.</synopsis>
630                                 </configOption>
631                                 <configOption name="mwi_from_user">
632                                         <synopsis>Username to use in From header for unsolicited MWI NOTIFYs to this endpoint.</synopsis>
633                                 </configOption>
634                                 <configOption name="from_domain">
635                                         <synopsis>Domain to user in From header for requests to this endpoint.</synopsis>
636                                 </configOption>
637                                 <configOption name="dtls_verify">
638                                         <synopsis>Verify that the provided peer certificate is valid</synopsis>
639                                         <description><para>
640                                                 This option only applies if <replaceable>media_encryption</replaceable> is
641                                                 set to <literal>dtls</literal>.
642                                         </para></description>
643                                 </configOption>
644                                 <configOption name="dtls_rekey">
645                                         <synopsis>Interval at which to renegotiate the TLS session and rekey the SRTP session</synopsis>
646                                         <description><para>
647                                                 This option only applies if <replaceable>media_encryption</replaceable> is
648                                                 set to <literal>dtls</literal>.
649                                         </para><para>
650                                                 If this is not set or the value provided is 0 rekeying will be disabled.
651                                         </para></description>
652                                 </configOption>
653                                 <configOption name="dtls_cert_file">
654                                         <synopsis>Path to certificate file to present to peer</synopsis>
655                                         <description><para>
656                                                 This option only applies if <replaceable>media_encryption</replaceable> is
657                                                 set to <literal>dtls</literal>.
658                                         </para></description>
659                                 </configOption>
660                                 <configOption name="dtls_private_key">
661                                         <synopsis>Path to private key for certificate file</synopsis>
662                                         <description><para>
663                                                 This option only applies if <replaceable>media_encryption</replaceable> is
664                                                 set to <literal>dtls</literal>.
665                                         </para></description>
666                                 </configOption>
667                                 <configOption name="dtls_cipher">
668                                         <synopsis>Cipher to use for DTLS negotiation</synopsis>
669                                         <description><para>
670                                                 This option only applies if <replaceable>media_encryption</replaceable> is
671                                                 set to <literal>dtls</literal>.
672                                         </para>
673                                         <para>Many options for acceptable ciphers. See link for more:</para>
674                                         <para>http://www.openssl.org/docs/apps/ciphers.html#CIPHER_STRINGS
675                                         </para></description>
676                                 </configOption>
677                                 <configOption name="dtls_ca_file">
678                                         <synopsis>Path to certificate authority certificate</synopsis>
679                                         <description><para>
680                                                 This option only applies if <replaceable>media_encryption</replaceable> is
681                                                 set to <literal>dtls</literal>.
682                                         </para></description>
683                                 </configOption>
684                                 <configOption name="dtls_ca_path">
685                                         <synopsis>Path to a directory containing certificate authority certificates</synopsis>
686                                         <description><para>
687                                                 This option only applies if <replaceable>media_encryption</replaceable> is
688                                                 set to <literal>dtls</literal>.
689                                         </para></description>
690                                 </configOption>
691                                 <configOption name="dtls_setup">
692                                         <synopsis>Whether we are willing to accept connections, connect to the other party, or both.</synopsis>
693                                         <description>
694                                                 <para>
695                                                         This option only applies if <replaceable>media_encryption</replaceable> is
696                                                         set to <literal>dtls</literal>.
697                                                 </para>
698                                                 <enumlist>
699                                                         <enum name="active"><para>
700                                                                 res_pjsip will make a connection to the peer.
701                                                         </para></enum>
702                                                         <enum name="passive"><para>
703                                                                 res_pjsip will accept connections from the peer.
704                                                         </para></enum>
705                                                         <enum name="actpass"><para>
706                                                                 res_pjsip will offer and accept connections from the peer.
707                                                         </para></enum>
708                                                 </enumlist>
709                                         </description>
710                                 </configOption>
711                                 <configOption name="dtls_fingerprint">
712                                         <synopsis>Type of hash to use for the DTLS fingerprint in the SDP.</synopsis>
713                                         <description>
714                                                 <para>
715                                                         This option only applies if <replaceable>media_encryption</replaceable> is
716                                                         set to <literal>dtls</literal>.
717                                                 </para>
718                                                 <enumlist>
719                                                         <enum name="SHA-256"></enum>
720                                                         <enum name="SHA-1"></enum>
721                                                 </enumlist>
722                                         </description>
723                                 </configOption>
724                                 <configOption name="srtp_tag_32">
725                                         <synopsis>Determines whether 32 byte tags should be used instead of 80 byte tags.</synopsis>
726                                         <description><para>
727                                                 This option only applies if <replaceable>media_encryption</replaceable> is
728                                                 set to <literal>sdes</literal> or <literal>dtls</literal>.
729                                         </para></description>
730                                 </configOption>
731                                 <configOption name="set_var">
732                                         <synopsis>Variable set on a channel involving the endpoint.</synopsis>
733                                         <description><para>
734                                                 When a new channel is created using the endpoint set the specified
735                                                 variable(s) on that channel. For multiple channel variables specify
736                                                 multiple 'set_var'(s).
737                                         </para></description>
738                                 </configOption>
739                                 <configOption name="message_context">
740                                         <synopsis>Context to route incoming MESSAGE requests to.</synopsis>
741                                         <description><para>
742                                                 If specified, incoming MESSAGE requests will be routed to the indicated
743                                                 dialplan context. If no <replaceable>message_context</replaceable> is
744                                                 specified, then the <replaceable>context</replaceable> setting is used.
745                                         </para></description>
746                                 </configOption>
747                                 <configOption name="accountcode">
748                                         <synopsis>An accountcode to set automatically on any channels created for this endpoint.</synopsis>
749                                         <description><para>
750                                                 If specified, any channel created for this endpoint will automatically
751                                                 have this accountcode set on it.
752                                         </para></description>
753                                 </configOption>
754                         </configObject>
755                         <configObject name="auth">
756                                 <synopsis>Authentication type</synopsis>
757                                 <description><para>
758                                         Authentication objects hold the authentication information for use
759                                         by other objects such as <literal>endpoints</literal> or <literal>registrations</literal>.
760                                         This also allows for multiple objects to use a single auth object. See
761                                         the <literal>auth_type</literal> config option for password style choices.
762                                 </para></description>
763                                 <configOption name="auth_type" default="userpass">
764                                         <synopsis>Authentication type</synopsis>
765                                         <description><para>
766                                                 This option specifies which of the password style config options should be read
767                                                 when trying to authenticate an endpoint inbound request. If set to <literal>userpass</literal>
768                                                 then we'll read from the 'password' option. For <literal>md5</literal> we'll read
769                                                 from 'md5_cred'.
770                                                 </para>
771                                                 <enumlist>
772                                                         <enum name="md5"/>
773                                                         <enum name="userpass"/>
774                                                 </enumlist>
775                                         </description>
776                                 </configOption>
777                                 <configOption name="nonce_lifetime" default="32">
778                                         <synopsis>Lifetime of a nonce associated with this authentication config.</synopsis>
779                                 </configOption>
780                                 <configOption name="md5_cred">
781                                         <synopsis>MD5 Hash used for authentication.</synopsis>
782                                         <description><para>Only used when auth_type is <literal>md5</literal>.</para></description>
783                                 </configOption>
784                                 <configOption name="password">
785                                         <synopsis>PlainText password used for authentication.</synopsis>
786                                         <description><para>Only used when auth_type is <literal>userpass</literal>.</para></description>
787                                 </configOption>
788                                 <configOption name="realm" default="asterisk">
789                                         <synopsis>SIP realm for endpoint</synopsis>
790                                 </configOption>
791                                 <configOption name="type">
792                                         <synopsis>Must be 'auth'</synopsis>
793                                 </configOption>
794                                 <configOption name="username">
795                                         <synopsis>Username to use for account</synopsis>
796                                 </configOption>
797                         </configObject>
798                         <configObject name="domain_alias">
799                                 <synopsis>Domain Alias</synopsis>
800                                 <description><para>
801                                         Signifies that a domain is an alias. If the domain on a session is
802                                         not found to match an AoR then this object is used to see if we have
803                                         an alias for the AoR to which the endpoint is binding. This objects
804                                         name as defined in configuration should be the domain alias and a
805                                         config option is provided to specify the domain to be aliased.
806                                 </para></description>
807                                 <configOption name="type">
808                                         <synopsis>Must be of type 'domain_alias'.</synopsis>
809                                 </configOption>
810                                 <configOption name="domain">
811                                         <synopsis>Domain to be aliased</synopsis>
812                                 </configOption>
813                         </configObject>
814                         <configObject name="transport">
815                                 <synopsis>SIP Transport</synopsis>
816                                 <description><para>
817                                         <emphasis>Transports</emphasis>
818                                         </para>
819                                         <para>There are different transports and protocol derivatives
820                                                 supported by <literal>res_pjsip</literal>. They are in order of
821                                                 preference: UDP, TCP, and WebSocket (WS).</para>
822                                         <note><para>Changes to transport configuration in pjsip.conf will only be
823                                                 effected on a complete restart of Asterisk. A module reload
824                                                 will not suffice.</para></note>
825                                 </description>
826                                 <configOption name="async_operations" default="1">
827                                         <synopsis>Number of simultaneous Asynchronous Operations</synopsis>
828                                 </configOption>
829                                 <configOption name="bind">
830                                         <synopsis>IP Address and optional port to bind to for this transport</synopsis>
831                                 </configOption>
832                                 <configOption name="ca_list_file">
833                                         <synopsis>File containing a list of certificates to read (TLS ONLY)</synopsis>
834                                 </configOption>
835                                 <configOption name="cert_file">
836                                         <synopsis>Certificate file for endpoint (TLS ONLY)</synopsis>
837                                         <description><para>
838                                                 A path to a .crt or .pem file can be provided.  However, only
839                                                 the certificate is read from the file, not the private key.
840                                                 The <literal>priv_key_file</literal> option must supply a
841                                                 matching key file.
842                                         </para></description>
843                                 </configOption>
844                                 <configOption name="cipher">
845                                         <synopsis>Preferred cryptography cipher names (TLS ONLY)</synopsis>
846                                         <description>
847                                         <para>Comma separated list of cipher names or numeric equivalents.
848                                                 Numeric equivalents can be either decimal or hexadecimal (0xX).
849                                         </para>
850                                         <para>There are many cipher names.  Use the CLI command
851                                                 <literal>pjsip list ciphers</literal> to see a list of cipher
852                                                 names available for your installation.  See link for more:</para>
853                                         <para>http://www.openssl.org/docs/apps/ciphers.html#CIPHER_SUITE_NAMES
854                                         </para>
855                                         </description>
856                                 </configOption>
857                                 <configOption name="domain">
858                                         <synopsis>Domain the transport comes from</synopsis>
859                                 </configOption>
860                                 <configOption name="external_media_address">
861                                         <synopsis>External IP address to use in RTP handling</synopsis>
862                                         <description><para>
863                                                 When a request or response is sent out, if the destination of the
864                                                 message is outside the IP network defined in the option <literal>localnet</literal>,
865                                                 and the media address in the SDP is within the localnet network, then the
866                                                 media address in the SDP will be rewritten to the value defined for
867                                                 <literal>external_media_address</literal>.
868                                         </para></description>
869                                 </configOption>
870                                 <configOption name="external_signaling_address">
871                                         <synopsis>External address for SIP signalling</synopsis>
872                                 </configOption>
873                                 <configOption name="external_signaling_port" default="0">
874                                         <synopsis>External port for SIP signalling</synopsis>
875                                 </configOption>
876                                 <configOption name="method">
877                                         <synopsis>Method of SSL transport (TLS ONLY)</synopsis>
878                                         <description>
879                                                 <enumlist>
880                                                         <enum name="default">
881                                                                 <para>The default as defined by PJSIP. This is currently TLSv1, but may change with future releases.</para>
882                                                         </enum>
883                                                         <enum name="unspecified">
884                                                                 <para>This option is equivalent to setting 'default'</para>
885                                                         </enum>
886                                                         <enum name="tlsv1" />
887                                                         <enum name="sslv2" />
888                                                         <enum name="sslv3" />
889                                                         <enum name="sslv23" />
890                                                 </enumlist>
891                                         </description>
892                                 </configOption>
893                                 <configOption name="local_net">
894                                         <synopsis>Network to consider local (used for NAT purposes).</synopsis>
895                                         <description><para>This must be in CIDR or dotted decimal format with the IP
896                                         and mask separated with a slash ('/').</para></description>
897                                 </configOption>
898                                 <configOption name="password">
899                                         <synopsis>Password required for transport</synopsis>
900                                 </configOption>
901                                 <configOption name="priv_key_file">
902                                         <synopsis>Private key file (TLS ONLY)</synopsis>
903                                 </configOption>
904                                 <configOption name="protocol" default="udp">
905                                         <synopsis>Protocol to use for SIP traffic</synopsis>
906                                         <description>
907                                                 <enumlist>
908                                                         <enum name="udp" />
909                                                         <enum name="tcp" />
910                                                         <enum name="tls" />
911                                                         <enum name="ws" />
912                                                         <enum name="wss" />
913                                                 </enumlist>
914                                         </description>
915                                 </configOption>
916                                 <configOption name="require_client_cert" default="false">
917                                         <synopsis>Require client certificate (TLS ONLY)</synopsis>
918                                 </configOption>
919                                 <configOption name="type">
920                                         <synopsis>Must be of type 'transport'.</synopsis>
921                                 </configOption>
922                                 <configOption name="verify_client" default="false">
923                                         <synopsis>Require verification of client certificate (TLS ONLY)</synopsis>
924                                 </configOption>
925                                 <configOption name="verify_server" default="false">
926                                         <synopsis>Require verification of server certificate (TLS ONLY)</synopsis>
927                                 </configOption>
928                                 <configOption name="tos" default="false">
929                                         <synopsis>Enable TOS for the signalling sent over this transport</synopsis>
930                                         <description>
931                                         <para>See <literal>https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service</literal>
932                                         for more information on this parameter.</para>
933                                         <note><para>This option does not apply to the <replaceable>ws</replaceable>
934                                         or the <replaceable>wss</replaceable> protocols.</para></note>
935                                         </description>
936                                 </configOption>
937                                 <configOption name="cos" default="false">
938                                         <synopsis>Enable COS for the signalling sent over this transport</synopsis>
939                                         <description>
940                                         <para>See <literal>https://wiki.asterisk.org/wiki/display/AST/IP+Quality+of+Service</literal>
941                                         for more information on this parameter.</para>
942                                         <note><para>This option does not apply to the <replaceable>ws</replaceable>
943                                         or the <replaceable>wss</replaceable> protocols.</para></note>
944                                         </description>
945                                 </configOption>
946                                 <configOption name="websocket_write_timeout">
947                                         <synopsis>The timeout (in milliseconds) to set on WebSocket connections.</synopsis>
948                                         <description>
949                                                 <para>If a websocket connection accepts input slowly, the timeout
950                                                 for writes to it can be increased to keep it from being disconnected.
951                                                 Value is in milliseconds; default is 100 ms.</para>
952                                         </description>
953                                 </configOption>
954                         </configObject>
955                         <configObject name="contact">
956                                 <synopsis>A way of creating an aliased name to a SIP URI</synopsis>
957                                 <description><para>
958                                         Contacts are a way to hide SIP URIs from the dialplan directly.
959                                         They are also used to make a group of contactable parties when
960                                         in use with <literal>AoR</literal> lists.
961                                 </para></description>
962                                 <configOption name="type">
963                                         <synopsis>Must be of type 'contact'.</synopsis>
964                                 </configOption>
965                                 <configOption name="uri">
966                                         <synopsis>SIP URI to contact peer</synopsis>
967                                 </configOption>
968                                 <configOption name="expiration_time">
969                                         <synopsis>Time to keep alive a contact</synopsis>
970                                         <description><para>
971                                                 Time to keep alive a contact. String style specification.
972                                         </para></description>
973                                 </configOption>
974                                 <configOption name="qualify_frequency" default="0">
975                                         <synopsis>Interval at which to qualify a contact</synopsis>
976                                         <description><para>
977                                                 Interval between attempts to qualify the contact for reachability.
978                                                 If <literal>0</literal> never qualify. Time in seconds.
979                                         </para></description>
980                                 </configOption>
981                                 <configOption name="outbound_proxy">
982                                         <synopsis>Outbound proxy used when sending OPTIONS request</synopsis>
983                                         <description><para>
984                                                 If set the provided URI will be used as the outbound proxy when an
985                                                 OPTIONS request is sent to a contact for qualify purposes.
986                                         </para></description>
987                                 </configOption>
988                                 <configOption name="path">
989                                         <synopsis>Stored Path vector for use in Route headers on outgoing requests.</synopsis>
990                                 </configOption>
991                                 <configOption name="user_agent">
992                                         <synopsis>User-Agent header from registration.</synopsis>
993                                         <description><para>
994                                                 The User-Agent is automatically stored based on data present in incoming SIP
995                                                 REGISTER requests and is not intended to be configured manually.
996                                         </para></description>
997                                 </configOption>
998                         </configObject>
999                         <configObject name="aor">
1000                                 <synopsis>The configuration for a location of an endpoint</synopsis>
1001                                 <description><para>
1002                                         An AoR is what allows Asterisk to contact an endpoint via res_pjsip. If no
1003                                         AoRs are specified, an endpoint will not be reachable by Asterisk.
1004                                         Beyond that, an AoR has other uses within Asterisk, such as inbound
1005                                         registration.
1006                                         </para><para>
1007                                         An <literal>AoR</literal> is a way to allow dialing a group
1008                                         of <literal>Contacts</literal> that all use the same
1009                                         <literal>endpoint</literal> for calls.
1010                                         </para><para>
1011                                         This can be used as another way of grouping a list of contacts to dial
1012                                         rather than specifing them each directly when dialing via the dialplan.
1013                                         This must be used in conjuction with the <literal>PJSIP_DIAL_CONTACTS</literal>.
1014                                         </para><para>
1015                                         Registrations: For Asterisk to match an inbound registration to an endpoint,
1016                                         the AoR object name must match the user portion of the SIP URI in the "To:"
1017                                         header of the inbound SIP registration. That will usually be equivalent
1018                                         to the "user name" set in your hard or soft phones configuration.
1019                                 </para></description>
1020                                 <configOption name="contact">
1021                                         <synopsis>Permanent contacts assigned to AoR</synopsis>
1022                                         <description><para>
1023                                                 Contacts specified will be called whenever referenced
1024                                                 by <literal>chan_pjsip</literal>.
1025                                                 </para><para>
1026                                                 Use a separate "contact=" entry for each contact required. Contacts
1027                                                 are specified using a SIP URI.
1028                                         </para></description>
1029                                 </configOption>
1030                                 <configOption name="default_expiration" default="3600">
1031                                         <synopsis>Default expiration time in seconds for contacts that are dynamically bound to an AoR.</synopsis>
1032                                 </configOption>
1033                                 <configOption name="mailboxes">
1034                                         <synopsis>Allow subscriptions for the specified mailbox(es)</synopsis>
1035                                         <description><para>This option applies when an external entity subscribes to an AoR
1036                                                 for Message Waiting Indications. The mailboxes specified will be subscribed to.
1037                                                 More than one mailbox can be specified with a comma-delimited string.
1038                                                 app_voicemail mailboxes must be specified as mailbox@context;
1039                                                 for example: mailboxes=6001@default. For mailboxes provided by external sources,
1040                                                 such as through the res_external_mwi module, you must specify strings supported by
1041                                                 the external system.
1042                                         </para><para>
1043                                                 For endpoints that cannot SUBSCRIBE for MWI, you can set the <literal>mailboxes</literal> option in your
1044                                                 endpoint configuration section to enable unsolicited MWI NOTIFYs to the endpoint.
1045                                         </para></description>
1046                                 </configOption>
1047                                 <configOption name="maximum_expiration" default="7200">
1048                                         <synopsis>Maximum time to keep an AoR</synopsis>
1049                                         <description><para>
1050                                                 Maximium time to keep a peer with explicit expiration. Time in seconds.
1051                                         </para></description>
1052                                 </configOption>
1053                                 <configOption name="max_contacts" default="0">
1054                                         <synopsis>Maximum number of contacts that can bind to an AoR</synopsis>
1055                                         <description><para>
1056                                                 Maximum number of contacts that can associate with this AoR. This value does
1057                                                 not affect the number of contacts that can be added with the "contact" option.
1058                                                 It only limits contacts added through external interaction, such as
1059                                                 registration.
1060                                                 </para>
1061                                                 <note><para>This should be set to <literal>1</literal> and
1062                                                 <replaceable>remove_existing</replaceable> set to <literal>yes</literal> if you
1063                                                 wish to stick with the older <literal>chan_sip</literal> behaviour.
1064                                                 </para></note>
1065                                         </description>
1066                                 </configOption>
1067                                 <configOption name="minimum_expiration" default="60">
1068                                         <synopsis>Minimum keep alive time for an AoR</synopsis>
1069                                         <description><para>
1070                                                 Minimum time to keep a peer with an explict expiration. Time in seconds.
1071                                         </para></description>
1072                                 </configOption>
1073                                 <configOption name="remove_existing" default="no">
1074                                         <synopsis>Determines whether new contacts replace existing ones.</synopsis>
1075                                         <description><para>
1076                                                 On receiving a new registration to the AoR should it remove
1077                                                 the existing contact that was registered against it?
1078                                                 </para>
1079                                                 <note><para>This should be set to <literal>yes</literal> and
1080                                                 <replaceable>max_contacts</replaceable> set to <literal>1</literal> if you
1081                                                 wish to stick with the older <literal>chan_sip</literal> behaviour.
1082                                                 </para></note>
1083                                         </description>
1084                                 </configOption>
1085                                 <configOption name="type">
1086                                         <synopsis>Must be of type 'aor'.</synopsis>
1087                                 </configOption>
1088                                 <configOption name="qualify_frequency" default="0">
1089                                         <synopsis>Interval at which to qualify an AoR</synopsis>
1090                                         <description><para>
1091                                                 Interval between attempts to qualify the AoR for reachability.
1092                                                 If <literal>0</literal> never qualify. Time in seconds.
1093                                         </para></description>
1094                                 </configOption>
1095                                 <configOption name="authenticate_qualify" default="no">
1096                                         <synopsis>Authenticates a qualify request if needed</synopsis>
1097                                         <description><para>
1098                                                 If true and a qualify request receives a challenge or authenticate response
1099                                                 authentication is attempted before declaring the contact available.
1100                                         </para></description>
1101                                 </configOption>
1102                                 <configOption name="outbound_proxy">
1103                                         <synopsis>Outbound proxy used when sending OPTIONS request</synopsis>
1104                                         <description><para>
1105                                                 If set the provided URI will be used as the outbound proxy when an
1106                                                 OPTIONS request is sent to a contact for qualify purposes.
1107                                         </para></description>
1108                                 </configOption>
1109                                 <configOption name="support_path">
1110                                         <synopsis>Enables Path support for REGISTER requests and Route support for other requests.</synopsis>
1111                                         <description><para>
1112                                                 When this option is enabled, the Path headers in register requests will be saved
1113                                                 and its contents will be used in Route headers for outbound out-of-dialog requests
1114                                                 and in Path headers for outbound 200 responses. Path support will also be indicated
1115                                                 in the Supported header.
1116                                         </para></description>
1117                                 </configOption>
1118                         </configObject>
1119                         <configObject name="system">
1120                                 <synopsis>Options that apply to the SIP stack as well as other system-wide settings</synopsis>
1121                                 <description><para>
1122                                         The settings in this section are global. In addition to being global, the values will
1123                                         not be re-evaluated when a reload is performed. This is because the values must be set
1124                                         before the SIP stack is initialized. The only way to reset these values is to either
1125                                         restart Asterisk, or unload res_pjsip.so and then load it again.
1126                                 </para></description>
1127                                 <configOption name="timer_t1" default="500">
1128                                         <synopsis>Set transaction timer T1 value (milliseconds).</synopsis>
1129                                         <description><para>
1130                                                 Timer T1 is the base for determining how long to wait before retransmitting
1131                                                 requests that receive no response when using an unreliable transport (e.g. UDP).
1132                                                 For more information on this timer, see RFC 3261, Section 17.1.1.1.
1133                                         </para></description>
1134                                 </configOption>
1135                                 <configOption name="timer_b" default="32000">
1136                                         <synopsis>Set transaction timer B value (milliseconds).</synopsis>
1137                                         <description><para>
1138                                                 Timer B determines the maximum amount of time to wait after sending an INVITE
1139                                                 request before terminating the transaction. It is recommended that this be set
1140                                                 to 64 * Timer T1, but it may be set higher if desired. For more information on
1141                                                 this timer, see RFC 3261, Section 17.1.1.1.
1142                                         </para></description>
1143                                 </configOption>
1144                                 <configOption name="compact_headers" default="no">
1145                                         <synopsis>Use the short forms of common SIP header names.</synopsis>
1146                                 </configOption>
1147                                 <configOption name="threadpool_initial_size" default="0">
1148                                         <synopsis>Initial number of threads in the res_pjsip threadpool.</synopsis>
1149                                 </configOption>
1150                                 <configOption name="threadpool_auto_increment" default="5">
1151                                         <synopsis>The amount by which the number of threads is incremented when necessary.</synopsis>
1152                                 </configOption>
1153                                 <configOption name="threadpool_idle_timeout" default="60">
1154                                         <synopsis>Number of seconds before an idle thread should be disposed of.</synopsis>
1155                                 </configOption>
1156                                 <configOption name="threadpool_max_size" default="0">
1157                                         <synopsis>Maximum number of threads in the res_pjsip threadpool.
1158                                         A value of 0 indicates no maximum.</synopsis>
1159                                 </configOption>
1160                                 <configOption name="disable_tcp_switch" default="yes">
1161                                         <synopsis>Disable automatic switching from UDP to TCP transports.</synopsis>
1162                                         <description><para>
1163                                                 Disable automatic switching from UDP to TCP transports if outgoing
1164                                                 request is too large.  See RFC 3261 section 18.1.1.
1165                                         </para></description>
1166                                 </configOption>
1167                                 <configOption name="type">
1168                                         <synopsis>Must be of type 'system'.</synopsis>
1169                                 </configOption>
1170                         </configObject>
1171                         <configObject name="global">
1172                                 <synopsis>Options that apply globally to all SIP communications</synopsis>
1173                                 <description><para>
1174                                         The settings in this section are global. Unlike options in the <literal>system</literal>
1175                                         section, these options can be refreshed by performing a reload.
1176                                 </para></description>
1177                                 <configOption name="max_forwards" default="70">
1178                                         <synopsis>Value used in Max-Forwards header for SIP requests.</synopsis>
1179                                 </configOption>
1180                                 <configOption name="keep_alive_interval" default="0">
1181                                         <synopsis>The interval (in seconds) to send keepalives to active connection-oriented transports.</synopsis>
1182                                 </configOption>
1183                                 <configOption name="type">
1184                                         <synopsis>Must be of type 'global'.</synopsis>
1185                                 </configOption>
1186                                 <configOption name="user_agent" default="Asterisk &lt;Asterisk Version&gt;">
1187                                         <synopsis>Value used in User-Agent header for SIP requests and Server header for SIP responses.</synopsis>
1188                                 </configOption>
1189                                 <configOption name="default_outbound_endpoint" default="default_outbound_endpoint">
1190                                         <synopsis>Endpoint to use when sending an outbound request to a URI without a specified endpoint.</synopsis>
1191                                 </configOption>
1192                                 <configOption name="debug" default="no">
1193                                         <synopsis>Enable/Disable SIP debug logging.  Valid options include yes|no or
1194                                         a host address</synopsis>
1195                                 </configOption>
1196                         </configObject>
1197                 </configFile>
1198         </configInfo>
1199         <manager name="PJSIPQualify" language="en_US">
1200                 <synopsis>
1201                         Qualify a chan_pjsip endpoint.
1202                 </synopsis>
1203                 <syntax>
1204                         <xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
1205                         <parameter name="Endpoint" required="true">
1206                                 <para>The endpoint you want to qualify.</para>
1207                         </parameter>
1208                 </syntax>
1209                 <description>
1210                         <para>Qualify a chan_pjsip endpoint.</para>
1211                 </description>
1212         </manager>
1213         <managerEvent language="en_US" name="IdentifyDetail">
1214                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1215                         <synopsis>Provide details about an identify section.</synopsis>
1216                         <syntax>
1217                                 <parameter name="ObjectType">
1218                                         <para>The object's type. This will always be 'identify'.</para>
1219                                 </parameter>
1220                                 <parameter name="ObjectName">
1221                                         <para>The name of this object.</para>
1222                                 </parameter>
1223                                 <parameter name="Endpoint">
1224                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip_endpoint_identifier_ip']/configFile[@name='pjsip.conf']/configObject[@name='identify']/configOption[@name='endpoint']/synopsis/node())"/></para>
1225                                 </parameter>
1226                                 <parameter name="Match">
1227                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip_endpoint_identifier_ip']/configFile[@name='pjsip.conf']/configObject[@name='identify']/configOption[@name='match']/synopsis/node())"/></para>
1228                                 </parameter>
1229                                 <parameter name="EndpointName">
1230                                         <para>The name of the endpoint associated with this information.</para>
1231                                 </parameter>
1232                         </syntax>
1233                 </managerEventInstance>
1234         </managerEvent>
1235         <managerEvent language="en_US" name="AorDetail">
1236                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1237                         <synopsis>Provide details about an Address of Record (AoR) section.</synopsis>
1238                         <syntax>
1239                                 <parameter name="ObjectType">
1240                                         <para>The object's type. This will always be 'aor'.</para>
1241                                 </parameter>
1242                                 <parameter name="ObjectName">
1243                                         <para>The name of this object.</para>
1244                                 </parameter>
1245                                 <parameter name="MinimumExpiration">
1246                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='minimum_expiration']/synopsis/node())"/></para>
1247                                 </parameter>
1248                                 <parameter name="MaximumExpiration">
1249                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='maximum_expiration']/synopsis/node())"/></para>
1250                                 </parameter>
1251                                 <parameter name="DefaultExpiration">
1252                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='default_expiration']/synopsis/node())"/></para>
1253                                 </parameter>
1254                                 <parameter name="QualifyFrequency">
1255                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='qualify_frequency']/synopsis/node())"/></para>
1256                                 </parameter>
1257                                 <parameter name="AuthenticateQualify">
1258                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='authenticate_qualify']/synopsis/node())"/></para>
1259                                 </parameter>
1260                                 <parameter name="MaxContacts">
1261                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='max_contacts']/synopsis/node())"/></para>
1262                                 </parameter>
1263                                 <parameter name="RemoveExisting">
1264                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='remove_existing']/synopsis/node())"/></para>
1265                                 </parameter>
1266                                 <parameter name="Mailboxes">
1267                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='mailboxes']/synopsis/node())"/></para>
1268                                 </parameter>
1269                                 <parameter name="OutboundProxy">
1270                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='outbound_proxy']/synopsis/node())"/></para>
1271                                 </parameter>
1272                                 <parameter name="SupportPath">
1273                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='aor']/configOption[@name='support_path']/synopsis/node())"/></para>
1274                                 </parameter>
1275                                 <parameter name="TotalContacts">
1276                                         <para>The total number of contacts associated with this AoR.</para>
1277                                 </parameter>
1278                                 <parameter name="ContactsRegistered">
1279                                         <para>The number of non-permanent contacts associated with this AoR.</para>
1280                                 </parameter>
1281                                 <parameter name="EndpointName">
1282                                         <para>The name of the endpoint associated with this information.</para>
1283                                 </parameter>
1284                         </syntax>
1285                 </managerEventInstance>
1286         </managerEvent>
1287         <managerEvent language="en_US" name="AuthDetail">
1288                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1289                         <synopsis>Provide details about an authentication section.</synopsis>
1290                         <syntax>
1291                                 <parameter name="ObjectType">
1292                                         <para>The object's type. This will always be 'auth'.</para>
1293                                 </parameter>
1294                                 <parameter name="ObjectName">
1295                                         <para>The name of this object.</para>
1296                                 </parameter>
1297                                 <parameter name="Username">
1298                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='username']/synopsis/node())"/></para>
1299                                 </parameter>
1300                                 <parameter name="Password">
1301                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='username']/synopsis/node())"/></para>
1302                                 </parameter>
1303                                 <parameter name="Md5Cred">
1304                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='md5_cred']/synopsis/node())"/></para>
1305                                 </parameter>
1306                                 <parameter name="Realm">
1307                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='realm']/synopsis/node())"/></para>
1308                                 </parameter>
1309                                 <parameter name="NonceLifetime">
1310                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='nonce_lifetime']/synopsis/node())"/></para>
1311                                 </parameter>
1312                                 <parameter name="AuthType">
1313                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='auth']/configOption[@name='auth_type']/synopsis/node())"/></para>
1314                                 </parameter>
1315                                 <parameter name="EndpointName">
1316                                         <para>The name of the endpoint associated with this information.</para>
1317                                 </parameter>
1318                         </syntax>
1319                 </managerEventInstance>
1320         </managerEvent>
1321         <managerEvent language="en_US" name="TransportDetail">
1322                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1323                         <synopsis>Provide details about an authentication section.</synopsis>
1324                         <syntax>
1325                                 <parameter name="ObjectType">
1326                                         <para>The object's type. This will always be 'transport'.</para>
1327                                 </parameter>
1328                                 <parameter name="ObjectName">
1329                                         <para>The name of this object.</para>
1330                                 </parameter>
1331                                 <parameter name="Protocol">
1332                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='protocol']/synopsis/node())"/></para>
1333                                 </parameter>
1334                                 <parameter name="Bind">
1335                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='bind']/synopsis/node())"/></para>
1336                                 </parameter>
1337                                 <parameter name="AsycOperations">
1338                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='async_operations']/synopsis/node())"/></para>
1339                                 </parameter>
1340                                 <parameter name="CaListFile">
1341                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='ca_list_file']/synopsis/node())"/></para>
1342                                 </parameter>
1343                                 <parameter name="CertFile">
1344                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='cert_file']/synopsis/node())"/></para>
1345                                 </parameter>
1346                                 <parameter name="PrivKeyFile">
1347                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='priv_key_file']/synopsis/node())"/></para>
1348                                 </parameter>
1349                                 <parameter name="Password">
1350                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='password']/synopsis/node())"/></para>
1351                                 </parameter>
1352                                 <parameter name="ExternalSignalingAddress">
1353                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='external_signaling_address']/synopsis/node())"/></para>
1354                                 </parameter>
1355                                 <parameter name="ExternalSignalingPort">
1356                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='external_signaling_port']/synopsis/node())"/></para>
1357                                 </parameter>
1358                                 <parameter name="ExternalMediaAddress">
1359                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='external_media_address']/synopsis/node())"/></para>
1360                                 </parameter>
1361                                 <parameter name="Domain">
1362                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='domain']/synopsis/node())"/></para>
1363                                 </parameter>
1364                                 <parameter name="VerifyServer">
1365                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='verify_server']/synopsis/node())"/></para>
1366                                 </parameter>
1367                                 <parameter name="VerifyClient">
1368                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='verify_client']/synopsis/node())"/></para>
1369                                 </parameter>
1370                                 <parameter name="RequireClientCert">
1371                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='require_client_cert']/synopsis/node())"/></para>
1372                                 </parameter>
1373                                 <parameter name="Method">
1374                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='method']/synopsis/node())"/></para>
1375                                 </parameter>
1376                                 <parameter name="Cipher">
1377                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='cipher']/synopsis/node())"/></para>
1378                                 </parameter>
1379                                 <parameter name="LocalNet">
1380                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='local_net']/synopsis/node())"/></para>
1381                                 </parameter>
1382                                 <parameter name="Tos">
1383                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='tos']/synopsis/node())"/></para>
1384                                 </parameter>
1385                                 <parameter name="Cos">
1386                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='cos']/synopsis/node())"/></para>
1387                                 </parameter>
1388                                 <parameter name="WebsocketWriteTimeout">
1389                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='transport']/configOption[@name='websocket_write_timeout']/synopsis/node())"/></para>
1390                                 </parameter>
1391                                 <parameter name="EndpointName">
1392                                         <para>The name of the endpoint associated with this information.</para>
1393                                 </parameter>
1394                         </syntax>
1395                 </managerEventInstance>
1396         </managerEvent>
1397         <managerEvent language="en_US" name="EndpointDetail">
1398                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1399                         <synopsis>Provide details about an endpoint section.</synopsis>
1400                         <syntax>
1401                                 <parameter name="ObjectType">
1402                                         <para>The object's type. This will always be 'endpoint'.</para>
1403                                 </parameter>
1404                                 <parameter name="ObjectName">
1405                                         <para>The name of this object.</para>
1406                                 </parameter>
1407                                 <parameter name="Context">
1408                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='context']/synopsis/node())"/></para>
1409                                 </parameter>
1410                                 <parameter name="Disallow">
1411                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='disallow']/synopsis/node())"/></para>
1412                                 </parameter>
1413                                 <parameter name="Allow">
1414                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='allow']/synopsis/node())"/></para>
1415                                 </parameter>
1416                                 <parameter name="DtmfMode">
1417                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtmf_mode']/synopsis/node())"/></para>
1418                                 </parameter>
1419                                 <parameter name="RtpIpv6">
1420                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='rtp_ipv6']/synopsis/node())"/></para>
1421                                 </parameter>
1422                                 <parameter name="RtpSymmetric">
1423                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='rtp_symmetric']/synopsis/node())"/></para>
1424                                 </parameter>
1425                                 <parameter name="IceSupport">
1426                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='ice_support']/synopsis/node())"/></para>
1427                                 </parameter>
1428                                 <parameter name="UsePtime">
1429                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='use_ptime']/synopsis/node())"/></para>
1430                                 </parameter>
1431                                 <parameter name="ForceRport">
1432                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='force_rport']/synopsis/node())"/></para>
1433                                 </parameter>
1434                                 <parameter name="RewriteContact">
1435                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='rewrite_contact']/synopsis/node())"/></para>
1436                                 </parameter>
1437                                 <parameter name="Transport">
1438                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='transport']/synopsis/node())"/></para>
1439                                 </parameter>
1440                                 <parameter name="OutboundProxy">
1441                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='outbound_proxy']/synopsis/node())"/></para>
1442                                 </parameter>
1443                                 <parameter name="MohSuggest">
1444                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='moh_suggest']/synopsis/node())"/></para>
1445                                 </parameter>
1446                                 <parameter name="100rel">
1447                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='100rel']/synopsis/node())"/></para>
1448                                 </parameter>
1449                                 <parameter name="Timers">
1450                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='timers']/synopsis/node())"/></para>
1451                                 </parameter>
1452                                 <parameter name="TimersMinSe">
1453                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='timers_min_se']/synopsis/node())"/></para>
1454                                 </parameter>
1455                                 <parameter name="TimersSessExpires">
1456                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='timers_sess_expires']/synopsis/node())"/></para>
1457                                 </parameter>
1458                                 <parameter name="Auth">
1459                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='auth']/synopsis/node())"/></para>
1460                                 </parameter>
1461                                 <parameter name="OutboundAuth">
1462                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='outbound_auth']/synopsis/node())"/></para>
1463                                 </parameter>
1464                                 <parameter name="Aors">
1465                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='aors']/synopsis/node())"/></para>
1466                                 </parameter>
1467                                 <parameter name="MediaAddress">
1468                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='media_address']/synopsis/node())"/></para>
1469                                 </parameter>
1470                                 <parameter name="IdentifyBy">
1471                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='identify_by']/synopsis/node())"/></para>
1472                                 </parameter>
1473                                 <parameter name="DirectMedia">
1474                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='direct_media']/synopsis/node())"/></para>
1475                                 </parameter>
1476                                 <parameter name="DirectMediaMethod">
1477                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='direct_media_method']/synopsis/node())"/></para>
1478                                 </parameter>
1479                                 <parameter name="ConnectedLineMethod">
1480                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='connected_line_method']/synopsis/node())"/></para>
1481                                 </parameter>
1482                                 <parameter name="DirectMediaGlareMitigation">
1483                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='direct_media_glare_mitigation']/synopsis/node())"/></para>
1484                                 </parameter>
1485                                 <parameter name="DisableDirectMediaOnNat">
1486                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='disable_direct_media_on_nat']/synopsis/node())"/></para>
1487                                 </parameter>
1488                                 <parameter name="Callerid">
1489                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='callerid']/synopsis/node())"/></para>
1490                                 </parameter>
1491                                 <parameter name="CalleridPrivacy">
1492                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='callerid_privacy']/synopsis/node())"/></para>
1493                                 </parameter>
1494                                 <parameter name="CalleridTag">
1495                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='callerid_tag']/synopsis/node())"/></para>
1496                                 </parameter>
1497                                 <parameter name="TrustIdInbound">
1498                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='trust_id_inbound']/synopsis/node())"/></para>
1499                                 </parameter>
1500                                 <parameter name="TrustIdOutbound">
1501                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='trust_id_outbound']/synopsis/node())"/></para>
1502                                 </parameter>
1503                                 <parameter name="SendPai">
1504                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='send_pai']/synopsis/node())"/></para>
1505                                 </parameter>
1506                                 <parameter name="SendRpid">
1507                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='send_rpid']/synopsis/node())"/></para>
1508                                 </parameter>
1509                                 <parameter name="SendDiversion">
1510                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='send_diversion']/synopsis/node())"/></para>
1511                                 </parameter>
1512                                 <parameter name="Mailboxes">
1513                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='mailboxes']/synopsis/node())"/></para>
1514                                 </parameter>
1515                                 <parameter name="AggregateMwi">
1516                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='aggregate_mwi']/synopsis/node())"/></para>
1517                                 </parameter>
1518                                 <parameter name="MediaEncryption">
1519                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='media_encryption']/synopsis/node())"/></para>
1520                                 </parameter>
1521                                 <parameter name="MediaEncryptionOptimistic">
1522                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='media_encryption_optimistic']/synopsis/node())"/></para>
1523                                 </parameter>
1524                                 <parameter name="UseAvpf">
1525                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='use_avpf']/synopsis/node())"/></para>
1526                                 </parameter>
1527                                 <parameter name="ForceAvp">
1528                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='force_avp']/synopsis/node())"/></para>
1529                                 </parameter>
1530                                 <parameter name="MediaUseReceivedTransport">
1531                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='media_use_received_transport']/synopsis/node())"/></para>
1532                                 </parameter>
1533                                 <parameter name="OneTouchRecording">
1534                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='one_touch_recording']/synopsis/node())"/></para>
1535                                 </parameter>
1536                                 <parameter name="InbandProgress">
1537                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='inband_progress']/synopsis/node())"/></para>
1538                                 </parameter>
1539                                 <parameter name="CallGroup">
1540                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='call_group']/synopsis/node())"/></para>
1541                                 </parameter>
1542                                 <parameter name="PickupGroup">
1543                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='pickup_group']/synopsis/node())"/></para>
1544                                 </parameter>
1545                                 <parameter name="NamedCallGroup">
1546                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='named_call_group']/synopsis/node())"/></para>
1547                                 </parameter>
1548                                 <parameter name="NamedPickupGroup">
1549                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='named_pickup_group']/synopsis/node())"/></para>
1550                                 </parameter>
1551                                 <parameter name="DeviceStateBusyAt">
1552                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='device_state_busy_at']/synopsis/node())"/></para>
1553                                 </parameter>
1554                                 <parameter name="T38Udptl">
1555                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='t38_udptl']/synopsis/node())"/></para>
1556                                 </parameter>
1557                                 <parameter name="T38UdptlEc">
1558                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='t38_udptl_ec']/synopsis/node())"/></para>
1559                                 </parameter>
1560                                 <parameter name="T38UdptlMaxdatagram">
1561                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='t38_udptl_maxdatagram']/synopsis/node())"/></para>
1562                                 </parameter>
1563                                 <parameter name="FaxDetect">
1564                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='fax_detect']/synopsis/node())"/></para>
1565                                 </parameter>
1566                                 <parameter name="T38UdptlNat">
1567                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='t38_udptl_nat']/synopsis/node())"/></para>
1568                                 </parameter>
1569                                 <parameter name="T38UdptlIpv6">
1570                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='t38_udptl_ipv6']/synopsis/node())"/></para>
1571                                 </parameter>
1572                                 <parameter name="ToneZone">
1573                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='tone_zone']/synopsis/node())"/></para>
1574                                 </parameter>
1575                                 <parameter name="Language">
1576                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='language']/synopsis/node())"/></para>
1577                                 </parameter>
1578                                 <parameter name="RecordOnFeature">
1579                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='record_on_feature']/synopsis/node())"/></para>
1580                                 </parameter>
1581                                 <parameter name="RecordOffFeature">
1582                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='record_off_feature']/synopsis/node())"/></para>
1583                                 </parameter>
1584                                 <parameter name="AllowTransfer">
1585                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='allow_transfer']/synopsis/node())"/></para>
1586                                 </parameter>
1587                                 <parameter name="UserEqPhone">
1588                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='user_eq_phone']/synopsis/node())"/></para>
1589                                 </parameter>
1590                                 <parameter name="MohPassthrough">
1591                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='moh_passthrough']/synopsis/node())"/></para>
1592                                 </parameter>
1593                                 <parameter name="SdpOwner">
1594                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='sdp_owner']/synopsis/node())"/></para>
1595                                 </parameter>
1596                                 <parameter name="SdpSession">
1597                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='sdp_session']/synopsis/node())"/></para>
1598                                 </parameter>
1599                                 <parameter name="TosAudio">
1600                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='tos_audio']/synopsis/node())"/></para>
1601                                 </parameter>
1602                                 <parameter name="TosVideo">
1603                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='tos_video']/synopsis/node())"/></para>
1604                                 </parameter>
1605                                 <parameter name="CosAudio">
1606                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='cos_audio']/synopsis/node())"/></para>
1607                                 </parameter>
1608                                 <parameter name="CosVideo">
1609                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='cos_video']/synopsis/node())"/></para>
1610                                 </parameter>
1611                                 <parameter name="AllowSubscribe">
1612                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='allow_subscribe']/synopsis/node())"/></para>
1613                                 </parameter>
1614                                 <parameter name="SubMinExpiry">
1615                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='sub_min_expiry']/synopsis/node())"/></para>
1616                                 </parameter>
1617                                 <parameter name="FromUser">
1618                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='from_user']/synopsis/node())"/></para>
1619                                 </parameter>
1620                                 <parameter name="FromDomain">
1621                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='from_domain']/synopsis/node())"/></para>
1622                                 </parameter>
1623                                 <parameter name="MwiFromUser">
1624                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='mwi_from_user']/synopsis/node())"/></para>
1625                                 </parameter>
1626                                 <parameter name="RtpEngine">
1627                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='rtp_engine']/synopsis/node())"/></para>
1628                                 </parameter>
1629                                 <parameter name="DtlsVerify">
1630                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_verify']/synopsis/node())"/></para>
1631                                 </parameter>
1632                                 <parameter name="DtlsRekey">
1633                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_rekey']/synopsis/node())"/></para>
1634                                 </parameter>
1635                                 <parameter name="DtlsCertFile">
1636                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_cert_file']/synopsis/node())"/></para>
1637                                 </parameter>
1638                                 <parameter name="DtlsPrivateKey">
1639                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_private_key']/synopsis/node())"/></para>
1640                                 </parameter>
1641                                 <parameter name="DtlsCipher">
1642                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_cipher']/synopsis/node())"/></para>
1643                                 </parameter>
1644                                 <parameter name="DtlsCaFile">
1645                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_ca_file']/synopsis/node())"/></para>
1646                                 </parameter>
1647                                 <parameter name="DtlsCaPath">
1648                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_ca_path']/synopsis/node())"/></para>
1649                                 </parameter>
1650                                 <parameter name="DtlsSetup">
1651                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='dtls_setup']/synopsis/node())"/></para>
1652                                 </parameter>
1653                                 <parameter name="SrtpTag32">
1654                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='srtp_tag_32']/synopsis/node())"/></para>
1655                                 </parameter>
1656                                 <parameter name="RedirectMethod">
1657                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='redirect_method']/synopsis/node())"/></para>
1658                                 </parameter>
1659                                 <parameter name="SetVar">
1660                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='set_var']/synopsis/node())"/></para>
1661                                 </parameter>
1662                                 <parameter name="MessageContext">
1663                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='message_context']/synopsis/node())"/></para>
1664                                 </parameter>
1665                                 <parameter name="Accountcode">
1666                                         <para><xi:include xpointer="xpointer(/docs/configInfo[@name='res_pjsip']/configFile[@name='pjsip.conf']/configObject[@name='endpoint']/configOption[@name='accountcode']/synopsis/node())"/></para>
1667                                 </parameter>
1668                                 <parameter name="DeviceState">
1669                                         <para>The aggregate device state for this endpoint.</para>
1670                                 </parameter>
1671                                 <parameter name="ActiveChannels">
1672                                         <para>The number of active channels associated with this endpoint.</para>
1673                                 </parameter>
1674                         </syntax>
1675                 </managerEventInstance>
1676         </managerEvent>
1677         <managerEvent language="en_US" name="ContactStatusDetail">
1678                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1679                         <synopsis>Provide details about a contact's status.</synopsis>
1680                         <syntax>
1681                                 <parameter name="AOR">
1682                                         <para>The AoR that owns this contact.</para>
1683                                 </parameter>
1684                                 <parameter name="URI">
1685                                         <para>This contact's URI.</para>
1686                                 </parameter>
1687                                 <parameter name="Status">
1688                                         <para>This contact's status.</para>
1689                                         <enumlist>
1690                                                 <enum name="Reachable"/>
1691                                                 <enum name="Unreachable"/>
1692                                         </enumlist>
1693                                 </parameter>
1694                                 <parameter name="RoundtripUsec">
1695                                         <para>The round trip time in microseconds.</para>
1696                                 </parameter>
1697                                 <parameter name="EndpointName">
1698                                         <para>The name of the endpoint associated with this information.</para>
1699                                 </parameter>
1700                         </syntax>
1701                 </managerEventInstance>
1702         </managerEvent>
1703         <managerEvent language="en_US" name="EndpointList">
1704                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1705                         <synopsis>Provide details about a contact's status.</synopsis>
1706                         <syntax>
1707                                 <parameter name="ObjectType">
1708                                         <para>The object's type. This will always be 'endpoint'.</para>
1709                                 </parameter>
1710                                 <parameter name="ObjectName">
1711                                         <para>The name of this object.</para>
1712                                 </parameter>
1713                                 <parameter name="Transport">
1714                                         <para>The transport configurations associated with this endpoint.</para>
1715                                 </parameter>
1716                                 <parameter name="Aor">
1717                                         <para>The aor configurations associated with this endpoint.</para>
1718                                 </parameter>
1719                                 <parameter name="Auths">
1720                                         <para>The inbound authentication configurations associated with this endpoint.</para>
1721                                 </parameter>
1722                                 <parameter name="OutboundAuths">
1723                                         <para>The outbound authentication configurations associated with this endpoint.</para>
1724                                 </parameter>
1725                                 <parameter name="DeviceState">
1726                                         <para>The aggregate device state for this endpoint.</para>
1727                                 </parameter>
1728                                 <parameter name="ActiveChannels">
1729                                         <para>The number of active channels associated with this endpoint.</para>
1730                                 </parameter>
1731                         </syntax>
1732                 </managerEventInstance>
1733         </managerEvent>
1734         <manager name="PJSIPShowEndpoints" language="en_US">
1735                 <synopsis>
1736                         Lists PJSIP endpoints.
1737                 </synopsis>
1738                 <syntax />
1739                 <description>
1740                         <para>
1741                         Provides a listing of all endpoints.  For each endpoint an <literal>EndpointList</literal> event
1742                         is raised that contains relevant attributes and status information.  Once all
1743                         endpoints have been listed an <literal>EndpointListComplete</literal> event is issued.
1744                         </para>
1745                 </description>
1746                 <responses>
1747                         <list-elements>
1748                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='EndpointList'])" />
1749                         </list-elements>
1750                         <managerEvent language="en_US" name="EndpointListComplete">
1751                                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1752                                         <synopsis>Provide final information about an endpoint list.</synopsis>
1753                                         <syntax>
1754                                                 <parameter name="EventList"/>
1755                                                 <parameter name="ListItems"/>
1756                                         </syntax>
1757                                 </managerEventInstance>
1758                         </managerEvent>
1759                 </responses>
1760         </manager>
1761         <manager name="PJSIPShowEndpoint" language="en_US">
1762                 <synopsis>
1763                         Detail listing of an endpoint and its objects.
1764                 </synopsis>
1765                 <syntax>
1766                         <xi:include xpointer="xpointer(/docs/manager[@name='Login']/syntax/parameter[@name='ActionID'])" />
1767                         <parameter name="Endpoint" required="true">
1768                                 <para>The endpoint to list.</para>
1769                         </parameter>
1770                 </syntax>
1771                 <description>
1772                         <para>
1773                         Provides a detailed listing of options for a given endpoint.  Events are issued
1774                         showing the configuration and status of the endpoint and associated objects.  These
1775                         events include <literal>EndpointDetail</literal>, <literal>AorDetail</literal>,
1776                         <literal>AuthDetail</literal>, <literal>TransportDetail</literal>, and
1777                         <literal>IdentifyDetail</literal>.  Some events may be listed multiple times if multiple objects are
1778                         associated (for instance AoRs).  Once all detail events have been raised a final
1779                         <literal>EndpointDetailComplete</literal> event is issued.
1780                         </para>
1781                 </description>
1782                 <responses>
1783                         <list-elements>
1784                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='EndpointDetail'])" />
1785                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='IdentifyDetail'])" />
1786                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='ContactStatusDetail'])" />
1787                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='AuthDetail'])" />
1788                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='TransportDetail'])" />
1789                                 <xi:include xpointer="xpointer(/docs/managerEvent[@name='AorDetail'])" />
1790                         </list-elements>
1791                         <managerEvent language="en_US" name="EndpointDetailComplete">
1792                                 <managerEventInstance class="EVENT_FLAG_COMMAND">
1793                                         <synopsis>Provide final information about endpoint details.</synopsis>
1794                                         <syntax>
1795                                                 <parameter name="EventList"/>
1796                                                 <parameter name="ListItems"/>
1797                                         </syntax>
1798                                 </managerEventInstance>
1799                         </managerEvent>
1800                 </responses>
1801         </manager>
1802  ***/
1803
1804 #define MOD_DATA_CONTACT "contact"
1805
1806 static pjsip_endpoint *ast_pjsip_endpoint;
1807
1808 static struct ast_threadpool *sip_threadpool;
1809
1810 static int register_service_noref(void *data)
1811 {
1812         pjsip_module **module = data;
1813         if (!ast_pjsip_endpoint) {
1814                 ast_log(LOG_ERROR, "There is no PJSIP endpoint. Unable to register services\n");
1815                 return -1;
1816         }
1817         if (pjsip_endpt_register_module(ast_pjsip_endpoint, *module) != PJ_SUCCESS) {
1818                 ast_log(LOG_ERROR, "Unable to register module %.*s\n", (int) pj_strlen(&(*module)->name), pj_strbuf(&(*module)->name));
1819                 return -1;
1820         }
1821         ast_debug(1, "Registered SIP service %.*s (%p)\n", (int) pj_strlen(&(*module)->name), pj_strbuf(&(*module)->name), *module);
1822         return 0;
1823 }
1824
1825 static int register_service(void *data)
1826 {
1827         int res;
1828
1829         if (!(res = register_service_noref(data))) {
1830                 ast_module_ref(ast_module_info->self);
1831         }
1832
1833         return res;
1834 }
1835
1836 int internal_sip_register_service(pjsip_module *module)
1837 {
1838         return ast_sip_push_task_synchronous(NULL, register_service_noref, &module);
1839 }
1840
1841 int ast_sip_register_service(pjsip_module *module)
1842 {
1843         return ast_sip_push_task_synchronous(NULL, register_service, &module);
1844 }
1845
1846 static int unregister_service_noref(void *data)
1847 {
1848         pjsip_module **module = data;
1849         if (!ast_pjsip_endpoint) {
1850                 return -1;
1851         }
1852         pjsip_endpt_unregister_module(ast_pjsip_endpoint, *module);
1853         ast_debug(1, "Unregistered SIP service %.*s\n", (int) pj_strlen(&(*module)->name), pj_strbuf(&(*module)->name));
1854         return 0;
1855 }
1856
1857 static int unregister_service(void *data)
1858 {
1859         int res;
1860
1861         if (!(res = unregister_service_noref(data))) {
1862                 ast_module_unref(ast_module_info->self);
1863         }
1864
1865         return res;
1866 }
1867
1868 int internal_sip_unregister_service(pjsip_module *module)
1869 {
1870         return ast_sip_push_task_synchronous(NULL, unregister_service_noref, &module);
1871 }
1872
1873 void ast_sip_unregister_service(pjsip_module *module)
1874 {
1875         ast_sip_push_task_synchronous(NULL, unregister_service, &module);
1876 }
1877
1878 static struct ast_sip_authenticator *registered_authenticator;
1879
1880 int ast_sip_register_authenticator(struct ast_sip_authenticator *auth)
1881 {
1882         if (registered_authenticator) {
1883                 ast_log(LOG_WARNING, "Authenticator %p is already registered. Cannot register a new one\n", registered_authenticator);
1884                 return -1;
1885         }
1886         registered_authenticator = auth;
1887         ast_debug(1, "Registered SIP authenticator module %p\n", auth);
1888         ast_module_ref(ast_module_info->self);
1889         return 0;
1890 }
1891
1892 void ast_sip_unregister_authenticator(struct ast_sip_authenticator *auth)
1893 {
1894         if (registered_authenticator != auth) {
1895                 ast_log(LOG_WARNING, "Trying to unregister authenticator %p but authenticator %p registered\n",
1896                                 auth, registered_authenticator);
1897                 return;
1898         }
1899         registered_authenticator = NULL;
1900         ast_debug(1, "Unregistered SIP authenticator %p\n", auth);
1901         ast_module_unref(ast_module_info->self);
1902 }
1903
1904 int ast_sip_requires_authentication(struct ast_sip_endpoint *endpoint, pjsip_rx_data *rdata)
1905 {
1906         if (!registered_authenticator) {
1907                 ast_log(LOG_WARNING, "No SIP authenticator registered. Assuming authentication is not required\n");
1908                 return 0;
1909         }
1910
1911         return registered_authenticator->requires_authentication(endpoint, rdata);
1912 }
1913
1914 enum ast_sip_check_auth_result ast_sip_check_authentication(struct ast_sip_endpoint *endpoint,
1915                 pjsip_rx_data *rdata, pjsip_tx_data *tdata)
1916 {
1917         if (!registered_authenticator) {
1918                 ast_log(LOG_WARNING, "No SIP authenticator registered. Assuming authentication is successful\n");
1919                 return 0;
1920         }
1921         return registered_authenticator->check_authentication(endpoint, rdata, tdata);
1922 }
1923
1924 static struct ast_sip_outbound_authenticator *registered_outbound_authenticator;
1925
1926 int ast_sip_register_outbound_authenticator(struct ast_sip_outbound_authenticator *auth)
1927 {
1928         if (registered_outbound_authenticator) {
1929                 ast_log(LOG_WARNING, "Outbound authenticator %p is already registered. Cannot register a new one\n", registered_outbound_authenticator);
1930                 return -1;
1931         }
1932         registered_outbound_authenticator = auth;
1933         ast_debug(1, "Registered SIP outbound authenticator module %p\n", auth);
1934         ast_module_ref(ast_module_info->self);
1935         return 0;
1936 }
1937
1938 void ast_sip_unregister_outbound_authenticator(struct ast_sip_outbound_authenticator *auth)
1939 {
1940         if (registered_outbound_authenticator != auth) {
1941                 ast_log(LOG_WARNING, "Trying to unregister outbound authenticator %p but outbound authenticator %p registered\n",
1942                                 auth, registered_outbound_authenticator);
1943                 return;
1944         }
1945         registered_outbound_authenticator = NULL;
1946         ast_debug(1, "Unregistered SIP outbound authenticator %p\n", auth);
1947         ast_module_unref(ast_module_info->self);
1948 }
1949
1950 int ast_sip_create_request_with_auth(const struct ast_sip_auth_vector *auths, pjsip_rx_data *challenge,
1951                 pjsip_transaction *tsx, pjsip_tx_data **new_request)
1952 {
1953         if (!registered_outbound_authenticator) {
1954                 ast_log(LOG_WARNING, "No SIP outbound authenticator registered. Cannot respond to authentication challenge\n");
1955                 return -1;
1956         }
1957         return registered_outbound_authenticator->create_request_with_auth(auths, challenge, tsx, new_request);
1958 }
1959
1960 struct endpoint_identifier_list {
1961         struct ast_sip_endpoint_identifier *identifier;
1962         AST_RWLIST_ENTRY(endpoint_identifier_list) list;
1963 };
1964
1965 static AST_RWLIST_HEAD_STATIC(endpoint_identifiers, endpoint_identifier_list);
1966
1967 int ast_sip_register_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier)
1968 {
1969         struct endpoint_identifier_list *id_list_item;
1970         SCOPED_LOCK(lock, &endpoint_identifiers, AST_RWLIST_WRLOCK, AST_RWLIST_UNLOCK);
1971
1972         id_list_item = ast_calloc(1, sizeof(*id_list_item));
1973         if (!id_list_item) {
1974                 ast_log(LOG_ERROR, "Unabled to add endpoint identifier. Out of memory.\n");
1975                 return -1;
1976         }
1977         id_list_item->identifier = identifier;
1978
1979         AST_RWLIST_INSERT_TAIL(&endpoint_identifiers, id_list_item, list);
1980         ast_debug(1, "Registered endpoint identifier %p\n", identifier);
1981
1982         ast_module_ref(ast_module_info->self);
1983         return 0;
1984 }
1985
1986 void ast_sip_unregister_endpoint_identifier(struct ast_sip_endpoint_identifier *identifier)
1987 {
1988         struct endpoint_identifier_list *iter;
1989         SCOPED_LOCK(lock, &endpoint_identifiers, AST_RWLIST_WRLOCK, AST_RWLIST_UNLOCK);
1990         AST_RWLIST_TRAVERSE_SAFE_BEGIN(&endpoint_identifiers, iter, list) {
1991                 if (iter->identifier == identifier) {
1992                         AST_RWLIST_REMOVE_CURRENT(list);
1993                         ast_free(iter);
1994                         ast_debug(1, "Unregistered endpoint identifier %p\n", identifier);
1995                         ast_module_unref(ast_module_info->self);
1996                         break;
1997                 }
1998         }
1999         AST_RWLIST_TRAVERSE_SAFE_END;
2000 }
2001
2002 struct ast_sip_endpoint *ast_sip_identify_endpoint(pjsip_rx_data *rdata)
2003 {
2004         struct endpoint_identifier_list *iter;
2005         struct ast_sip_endpoint *endpoint = NULL;
2006         SCOPED_LOCK(lock, &endpoint_identifiers, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK);
2007         AST_RWLIST_TRAVERSE(&endpoint_identifiers, iter, list) {
2008                 ast_assert(iter->identifier->identify_endpoint != NULL);
2009                 endpoint = iter->identifier->identify_endpoint(rdata);
2010                 if (endpoint) {
2011                         break;
2012                 }
2013         }
2014         return endpoint;
2015 }
2016
2017 AST_RWLIST_HEAD_STATIC(endpoint_formatters, ast_sip_endpoint_formatter);
2018
2019 void internal_sip_register_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
2020 {
2021         SCOPED_LOCK(lock, &endpoint_formatters, AST_RWLIST_WRLOCK, AST_RWLIST_UNLOCK);
2022         AST_RWLIST_INSERT_TAIL(&endpoint_formatters, obj, next);
2023 }
2024
2025 int ast_sip_register_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
2026 {
2027         internal_sip_register_endpoint_formatter(obj);
2028         ast_module_ref(ast_module_info->self);
2029         return 0;
2030 }
2031
2032 int internal_sip_unregister_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
2033 {
2034         struct ast_sip_endpoint_formatter *i;
2035         SCOPED_LOCK(lock, &endpoint_formatters, AST_RWLIST_WRLOCK, AST_RWLIST_UNLOCK);
2036         AST_RWLIST_TRAVERSE_SAFE_BEGIN(&endpoint_formatters, i, next) {
2037                 if (i == obj) {
2038                         AST_RWLIST_REMOVE_CURRENT(next);
2039                         break;
2040                 }
2041         }
2042         AST_RWLIST_TRAVERSE_SAFE_END;
2043         return i == obj ? 0 : -1;
2044 }
2045
2046 void ast_sip_unregister_endpoint_formatter(struct ast_sip_endpoint_formatter *obj)
2047 {
2048         if (!internal_sip_unregister_endpoint_formatter(obj)) {
2049                 ast_module_unref(ast_module_info->self);
2050         }
2051 }
2052
2053 int ast_sip_format_endpoint_ami(struct ast_sip_endpoint *endpoint,
2054                                 struct ast_sip_ami *ami, int *count)
2055 {
2056         int res = 0;
2057         struct ast_sip_endpoint_formatter *i;
2058         SCOPED_LOCK(lock, &endpoint_formatters, AST_RWLIST_RDLOCK, AST_RWLIST_UNLOCK);
2059         *count = 0;
2060         AST_RWLIST_TRAVERSE(&endpoint_formatters, i, next) {
2061                 if (i->format_ami && ((res = i->format_ami(endpoint, ami)) < 0)) {
2062                         return res;
2063                 }
2064
2065                 if (!res) {
2066                         (*count)++;
2067                 }
2068         }
2069         return 0;
2070 }
2071
2072 pjsip_endpoint *ast_sip_get_pjsip_endpoint(void)
2073 {
2074         return ast_pjsip_endpoint;
2075 }
2076
2077 static int sip_dialog_create_from(pj_pool_t *pool, pj_str_t *from, const char *user, const char *domain, const pj_str_t *target, pjsip_tpselector *selector)
2078 {
2079         pj_str_t tmp, local_addr;
2080         pjsip_uri *uri;
2081         pjsip_sip_uri *sip_uri;
2082         pjsip_transport_type_e type = PJSIP_TRANSPORT_UNSPECIFIED;
2083         int local_port;
2084         char uuid_str[AST_UUID_STR_LEN];
2085
2086         if (ast_strlen_zero(user)) {
2087                 user = ast_uuid_generate_str(uuid_str, sizeof(uuid_str));
2088         }
2089
2090         /* Parse the provided target URI so we can determine what transport it will end up using */
2091         pj_strdup_with_null(pool, &tmp, target);
2092
2093         if (!(uri = pjsip_parse_uri(pool, tmp.ptr, tmp.slen, 0)) ||
2094             (!PJSIP_URI_SCHEME_IS_SIP(uri) && !PJSIP_URI_SCHEME_IS_SIPS(uri))) {
2095                 return -1;
2096         }
2097
2098         sip_uri = pjsip_uri_get_uri(uri);
2099
2100         /* Determine the transport type to use */
2101         if (PJSIP_URI_SCHEME_IS_SIPS(sip_uri)) {
2102                 type = PJSIP_TRANSPORT_TLS;
2103         } else if (!sip_uri->transport_param.slen) {
2104                 type = PJSIP_TRANSPORT_UDP;
2105         } else {
2106                 type = pjsip_transport_get_type_from_name(&sip_uri->transport_param);
2107         }
2108
2109         if (type == PJSIP_TRANSPORT_UNSPECIFIED) {
2110                 return -1;
2111         }
2112
2113         /* If the host is IPv6 turn the transport into an IPv6 version */
2114         if (pj_strchr(&sip_uri->host, ':') && type < PJSIP_TRANSPORT_START_OTHER) {
2115                 type = (pjsip_transport_type_e)(((int)type) + PJSIP_TRANSPORT_IPV6);
2116         }
2117
2118         if (!ast_strlen_zero(domain)) {
2119                 from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
2120                 from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,
2121                                 "<sip:%s@%s%s%s>",
2122                                 user,
2123                                 domain,
2124                                 (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? ";transport=" : "",
2125                                 (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? pjsip_transport_get_type_name(type) : "");
2126                 return 0;
2127         }
2128
2129         /* Get the local bound address for the transport that will be used when communicating with the provided URI */
2130         if (pjsip_tpmgr_find_local_addr(pjsip_endpt_get_tpmgr(ast_sip_get_pjsip_endpoint()), pool, type, selector,
2131                                                               &local_addr, &local_port) != PJ_SUCCESS) {
2132
2133                 /* If no local address can be retrieved using the transport manager use the host one */
2134                 pj_strdup(pool, &local_addr, pj_gethostname());
2135                 local_port = pjsip_transport_get_default_port_for_type(PJSIP_TRANSPORT_UDP);
2136         }
2137
2138         /* If IPv6 was specified in the transport, set the proper type */
2139         if (pj_strchr(&local_addr, ':') && type < PJSIP_TRANSPORT_START_OTHER) {
2140                 type = (pjsip_transport_type_e)(((int)type) + PJSIP_TRANSPORT_IPV6);
2141         }
2142
2143         from->ptr = pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE);
2144         from->slen = pj_ansi_snprintf(from->ptr, PJSIP_MAX_URL_SIZE,
2145                                       "<sip:%s@%s%.*s%s:%d%s%s>",
2146                                       user,
2147                                       (type & PJSIP_TRANSPORT_IPV6) ? "[" : "",
2148                                       (int)local_addr.slen,
2149                                       local_addr.ptr,
2150                                       (type & PJSIP_TRANSPORT_IPV6) ? "]" : "",
2151                                       local_port,
2152                                       (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? ";transport=" : "",
2153                                       (type != PJSIP_TRANSPORT_UDP && type != PJSIP_TRANSPORT_UDP6) ? pjsip_transport_get_type_name(type) : "");
2154
2155         return 0;
2156 }
2157
2158 static int sip_get_tpselector_from_endpoint(const struct ast_sip_endpoint *endpoint, pjsip_tpselector *selector)
2159 {
2160         RAII_VAR(struct ast_sip_transport *, transport, NULL, ao2_cleanup);
2161         const char *transport_name = endpoint->transport;
2162
2163         if (ast_strlen_zero(transport_name)) {
2164                 return 0;
2165         }
2166
2167         transport = ast_sorcery_retrieve_by_id(ast_sip_get_sorcery(), "transport", transport_name);
2168
2169         if (!transport || !transport->state) {
2170                 ast_log(LOG_ERROR, "Unable to retrieve PJSIP transport '%s' for endpoint '%s'\n",
2171                         transport_name, ast_sorcery_object_get_id(endpoint));
2172                 return -1;
2173         }
2174
2175         if (transport->state->transport) {
2176                 selector->type = PJSIP_TPSELECTOR_TRANSPORT;
2177                 selector->u.transport = transport->state->transport;
2178         } else if (transport->state->factory) {
2179                 selector->type = PJSIP_TPSELECTOR_LISTENER;
2180                 selector->u.listener = transport->state->factory;
2181         } else if (transport->type == AST_TRANSPORT_WS || transport->type == AST_TRANSPORT_WSS) {
2182                 /* The WebSocket transport has no factory as it can not create outgoing connections, so
2183                  * even if an endpoint is locked to a WebSocket transport we let the PJSIP logic
2184                  * find the existing connection if available and use it.
2185                  */
2186                 return 0;
2187         } else {
2188                 return -1;
2189         }
2190
2191         return 0;
2192 }
2193
2194 void ast_sip_add_usereqphone(const struct ast_sip_endpoint *endpoint, pj_pool_t *pool, pjsip_uri *uri)