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