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