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