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