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