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