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