1 /* $Id$ */
2 /*
3  * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4  * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20 #ifndef __PJSIP_SIP_CONFIG_H__
21 #define __PJSIP_SIP_CONFIG_H__
22 
23 /**
24  * @file sip_config.h
25  * @brief Compile time configuration.
26  */
27 #include <pj/types.h>
28 
29 /**
30  * @defgroup PJSIP_CORE Core SIP Library
31  * @brief The core framework from which all other SIP components depends on.
32  *
33  * The PJSIP Core library only provides transport framework, event
34  * dispatching/module framework, and SIP message representation and
35  * parsing. It doesn't do anything usefull in itself!
36  *
37  * If application wants the stack to do anything usefull at all,
38  * it must registers @ref PJSIP_MOD to the core library. Examples
39  * of modules are @ref PJSIP_TRANSACT and @ref PJSUA_UA.
40  */
41 
42 /**
43  * @defgroup PJSIP_BASE Base Types
44  * @ingroup PJSIP_CORE
45  * @brief Basic PJSIP types and configurations.
46  */
47 
48 /**
49  * @defgroup PJSIP_CONFIG PJSIP Configurations/Settings
50  * @ingroup PJSIP_BASE
51  * @brief PJSIP compile time configurations.
52  * @{
53  */
54 
55 /*
56  * Include sip_autoconf.h if autoconf is used (PJ_AUTOCONF is set)
57  */
58 #if defined(PJ_AUTOCONF)
59 #   include <pjsip/sip_autoconf.h>
60 #endif
61 
62 PJ_BEGIN_DECL
63 
64 /**
65  * This structure describes PJSIP run-time configurations/settings.
66  * Application may use #pjsip_cfg() function to modify the settings
67  * before creating the stack.
68  */
69 typedef struct pjsip_cfg_t
70 {
71     /** Global settings. */
72     struct {
73 	/**
74 	 * Specify port number should be allowed to appear in To and From
75 	 * header. Note that RFC 3261 disallow this, see Table 1 in section
76 	 * 19.1.1 of the RFC.
77 	 *
78 	 * Default is PJSIP_ALLOW_PORT_IN_FROMTO_HDR.
79 	 */
80 	pj_bool_t allow_port_in_fromto_hdr;
81 
82 	/**
83 	 * Accept call replace in early state when invite is not initiated
84 	 * by the user agent. RFC 3891 Section 3 disallows this, however,
85 	 * for better interoperability reason, this might be ignored.
86 	 *
87 	 * Default is PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE.
88 	 */
89 	pj_bool_t accept_replace_in_early_state;
90 
91 	/**
92 	 * Allow hash character ('#') to appear in outgoing URIs. See
93 	 * https://trac.pjsip.org/repos/ticket/1569.
94 	 *
95 	 * Default is PJ_FALSE.
96 	 */
97 	pj_bool_t allow_tx_hash_in_uri;
98 
99 	/**
100 	 * Disable rport in request.
101 	 *
102 	 * Default is PJ_FALSE.
103 	 */
104 	pj_bool_t disable_rport;
105 
106 	/**
107 	 * Disable automatic switching from UDP to TCP if outgoing request
108 	 * is greater than 1300 bytes.
109 	 *
110 	 * Default is PJSIP_DONT_SWITCH_TO_TCP.
111 	 */
112 	pj_bool_t disable_tcp_switch;
113 
114 	/**
115 	 * Disable automatic switching to TLS if target-URI does not use
116 	 * "sips" scheme nor TLS transport, even when request-URI uses
117 	 * "sips" scheme.
118 	 *
119 	 * Default is PJSIP_DONT_SWITCH_TO_TLS.
120 	 */
121 	pj_bool_t disable_tls_switch;
122 
123 	/**
124 	 * Enable call media session to always be updated to the latest
125 	 * received early media SDP when receiving forked early media
126 	 * (multiple 183 responses with different To tag).
127 	 *
128 	 * Default is PJSIP_FOLLOW_EARLY_MEDIA_FORK.
129 	 */
130 	pj_bool_t follow_early_media_fork;
131 
132 	/**
133 	 * Specify whether "alias" param should be added to the Via header
134 	 * in any outgoing request with connection oriented transport.
135 	 *
136 	 * Default is PJSIP_REQ_HAS_VIA_ALIAS.
137 	 */
138 	pj_bool_t req_has_via_alias;
139 
140 	/**
141 	 * Resolve hostname when trying to get the network interface to be put
142 	 * in Via or Contact header.
143 	 *
144 	 * Default is PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE.
145 	 */
146 	pj_bool_t resolve_hostname_to_get_interface;
147 
148 	/**
149 	 * Disable security check on incoming messages in a secure dialog.
150 	 * A secure dialog is created when the request that creates the dialog
151 	 * uses "sips" scheme in its request URI. Contact URI should use "sips"
152 	 * scheme and the top-most Record-Route URI, if any, should use either
153 	 * "sips" scheme or "transport=tls" param. See also
154 	 * https://trac.pjsip.org/repos/ticket/1735.
155 	 *
156 	 * Default is PJ_FALSE.
157 	 */
158 	pj_bool_t disable_secure_dlg_check;
159 
160 	/**
161 	 * Encode SIP headers in their short forms to reduce size. By default,
162 	 * SIP headers in outgoing messages will be encoded in their full names.
163 	 * If this option is enabled, then SIP headers for outgoing messages
164 	 * will be encoded in their short forms, to reduce message size.
165 	 * Note that this does not affect the ability of PJSIP to parse incoming
166 	 * SIP messages, as the parser always supports parsing both the long
167 	 * and short version of the headers.
168 	 *
169 	 * Default is PJSIP_ENCODE_SHORT_HNAME
170 	 */
171 	pj_bool_t use_compact_form;
172 
173         /**
174          * Accept multiple SDP answers on non-reliable 18X responses and the 2XX
175          * response when they are all received from the same source (same To tag).
176          *
177          * See also:
178          * https://tools.ietf.org/html/rfc6337#section-3.1.1
179          *
180          * Default is PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS.
181          */
182         pj_bool_t accept_multiple_sdp_answers;
183 
184     } endpt;
185 
186     /** Transaction layer settings. */
187     struct {
188 
189 	/** Maximum number of transactions. The value is initialized with
190 	 *  PJSIP_MAX_TSX_COUNT
191 	 */
192 	unsigned max_count;
193 
194 	/* Timeout values: */
195 
196 	/** Transaction T1 timeout, in msec. Default value is PJSIP_T1_TIMEOUT
197 	 */
198 	unsigned t1;
199 
200 	/** Transaction T2 timeout, in msec. Default value is PJSIP_T2_TIMEOUT
201 	 */
202 	unsigned t2;
203 
204 	/** Transaction completed timer for non-INVITE, in msec. Default value
205 	 *  is PJSIP_T4_TIMEOUT
206 	 */
207 	unsigned t4;
208 
209 	/** Transaction completed timer for INVITE, in msec. Default value is
210 	 *  PJSIP_TD_TIMEOUT.
211 	 */
212 	unsigned td;
213 
214     } tsx;
215 
216     /* Dialog layer settings .. TODO */
217 
218     /** Client registration settings. */
219     struct {
220 	/**
221 	 * Specify whether client registration should check for its
222 	 * registered contact in Contact header of successful REGISTER
223 	 * response to determine whether registration has been successful.
224 	 * This setting may be disabled if non-compliant registrar is unable
225 	 * to return correct Contact header.
226 	 *
227 	 * Default is PJSIP_REGISTER_CLIENT_CHECK_CONTACT
228 	 */
229 	pj_bool_t   check_contact;
230 
231 	/**
232 	 * Specify whether client registration should add "x-uid" extension
233 	 * parameter in all Contact URIs that it registers to assist the
234 	 * matching of Contact URIs in the 200/OK REGISTER response, in
235 	 * case the registrar is unable to return exact Contact URI in the
236 	 * 200/OK response.
237 	 *
238 	 * Default is PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM.
239 	 */
240 	pj_bool_t   add_xuid_param;
241 
242     } regc;
243 
244     /** TCP transport settings */
245     struct {
246         /**
247          * Set the interval to send keep-alive packet for TCP transports.
248          * If the value is zero, keep-alive will be disabled for TCP.
249          *
250          * Default is PJSIP_TCP_KEEP_ALIVE_INTERVAL.
251          */
252         long keep_alive_interval;
253 
254     } tcp;
255 
256     /** TLS transport settings */
257     struct {
258         /**
259          * Set the interval to send keep-alive packet for TLS transports.
260          * If the value is zero, keep-alive will be disabled for TLS.
261          *
262          * Default is PJSIP_TLS_KEEP_ALIVE_INTERVAL.
263          */
264         long keep_alive_interval;
265 
266     } tls;
267 
268 } pjsip_cfg_t;
269 
270 
271 #ifdef PJ_DLL
272 /**
273  * Get pjsip configuration instance. Application may modify the
274  * settings before creating the SIP endpoint and modules.
275  *
276  * @return  Configuration instance.
277  */
278 PJ_DECL(pjsip_cfg_t*) pjsip_cfg(void);
279 
280 #else	/* PJ_DLL */
281 
282 extern pjsip_cfg_t pjsip_sip_cfg_var;
283 
284 /**
285  * Get pjsip configuration instance. Application may modify the
286  * settings before creating the SIP endpoint and modules.
287  *
288  * @return  Configuration instance.
289  */
pjsip_cfg(void)290 PJ_INLINE(pjsip_cfg_t*) pjsip_cfg(void)
291 {
292     return &pjsip_sip_cfg_var;
293 }
294 
295 #endif	/* PJ_DLL */
296 
297 
298 /**
299  * Specify maximum transaction count in transaction hash table.
300  * For efficiency, the value should be 2^n-1 since it will be
301  * rounded up to 2^n.
302  *
303  * Default value is 1023
304  */
305 #ifndef PJSIP_MAX_TSX_COUNT
306 #   define PJSIP_MAX_TSX_COUNT		(1024-1)
307 #endif
308 
309 /**
310  * Specify maximum number of dialogs in the dialog hash table.
311  * For efficiency, the value should be 2^n-1 since it will be
312  * rounded up to 2^n.
313  *
314  * Default value is 511.
315  */
316 #ifndef PJSIP_MAX_DIALOG_COUNT
317 #   define PJSIP_MAX_DIALOG_COUNT	(512-1)
318 #endif
319 
320 
321 /**
322  * Specify maximum number of transports.
323  * Default value is equal to maximum number of handles in ioqueue.
324  * See also PJSIP_TPMGR_HTABLE_SIZE.
325  */
326 #ifndef PJSIP_MAX_TRANSPORTS
327 #   define PJSIP_MAX_TRANSPORTS		(PJ_IOQUEUE_MAX_HANDLES)
328 #endif
329 
330 
331 /**
332  * Transport manager hash table size (must be 2^n-1).
333  * See also PJSIP_MAX_TRANSPORTS
334  */
335 #ifndef PJSIP_TPMGR_HTABLE_SIZE
336 #   define PJSIP_TPMGR_HTABLE_SIZE	31
337 #endif
338 
339 
340 /**
341  * Specify maximum URL size.
342  */
343 #ifndef PJSIP_MAX_URL_SIZE
344 #   define PJSIP_MAX_URL_SIZE		256
345 #endif
346 
347 
348 /**
349  * Specify maximum number of modules.
350  * This mainly affects the size of mod_data array in various components.
351  */
352 #ifndef PJSIP_MAX_MODULE
353 #   define PJSIP_MAX_MODULE		32
354 #endif
355 
356 
357 /**
358  * Maximum packet length. We set it more than MTU since a SIP PDU
359  * containing presence information can be quite large (>1500).
360  */
361 #ifndef PJSIP_MAX_PKT_LEN
362 #   define PJSIP_MAX_PKT_LEN		4000
363 #endif
364 
365 
366 /**
367  * RFC 3261 section 18.1.1:
368  * If a request is within 200 bytes of the path MTU, or if it is larger
369  * than 1300 bytes and the path MTU is unknown, the request MUST be sent
370  * using an RFC 2914 [43] congestion controlled transport protocol, such
371  * as TCP.
372  *
373  * Disable the behavior of automatic switching to TCP whenever UDP packet
374  * size exceeds the threshold defined in PJSIP_UDP_SIZE_THRESHOLD.
375  *
376  * This option can also be controlled at run-time by the \a disable_tcp_switch
377  * setting in pjsip_cfg_t.
378  *
379  * Default is 0 (no).
380  */
381 #ifndef PJSIP_DONT_SWITCH_TO_TCP
382 #   define PJSIP_DONT_SWITCH_TO_TCP	0
383 #endif
384 
385 
386 /**
387  * As specified RFC 3261 section 8.1.2, when request-URI uses "sips" scheme,
388  * TLS must always be used regardless of the target-URI scheme or transport
389  * type.
390  *
391  * This option will specify whether the behavior of automatic switching to TLS
392  * should be disabled, i.e: regard the target-URI scheme or transport type.
393  *
394  * This option can also be controlled at run-time by the \a disable_tls_switch
395  * setting in pjsip_cfg_t.
396  *
397  * Default is 0 (no).
398  */
399 #ifndef PJSIP_DONT_SWITCH_TO_TLS
400 #   define PJSIP_DONT_SWITCH_TO_TLS	0
401 #endif
402 
403 /**
404  * Specify if #pjsip_endpt_handle_events() should sleep if ioqueue poll
405  * returns error.
406  *
407  * Default is 1 (yes).
408  */
409 
410 #ifndef PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR
411 #   define PJSIP_HANDLE_EVENTS_HAS_SLEEP_ON_ERR	    1
412 #endif
413 
414 /**
415  * Specify whether the call media session should be updated to the latest
416  * received early media SDP when receiving forked early media (multiple 183
417  * responses with different To tag).
418  *
419  * This option can also be controlled at run-time by the
420  * \a follow_early_media_fork setting in pjsip_cfg_t.
421  *
422  * Default is PJ_TRUE.
423  */
424 #ifndef PJSIP_FOLLOW_EARLY_MEDIA_FORK
425 #   define PJSIP_FOLLOW_EARLY_MEDIA_FORK	    PJ_TRUE
426 #endif
427 
428 
429 /**
430  * Accept multiple SDP answers on non-reliable 18X responses and the 2XX
431  * response when they are all received from the same source (same To tag).
432  *
433  * This option can also be controlled at run-time by the
434  * \a accept_multiple_sdp_answers setting in pjsip_cfg_t.
435  *
436  * Default is PJ_TRUE.
437  */
438 #ifndef PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS
439 #   define PJSIP_ACCEPT_MULTIPLE_SDP_ANSWERS        PJ_TRUE
440 #endif
441 
442 
443 /**
444  * Specify whether "alias" param should be added to the Via header
445  * in any outgoing request with connection oriented transport.
446  *
447  * This option can also be controlled at run-time by the
448  * \a req_has_via_alias setting in pjsip_cfg_t.
449  *
450  * Default is PJ_TRUE.
451  */
452 #ifndef PJSIP_REQ_HAS_VIA_ALIAS
453 #   define PJSIP_REQ_HAS_VIA_ALIAS		    PJ_TRUE
454 #endif
455 
456 /**
457  * Resolve hostname when trying to get the network interface to be put in Via
458  * or Contact header.
459  *
460  * This option can also be controlled at run-time by the
461  * \a resolve_hostname_to_get_interface setting in pjsip_cfg_t.
462  *
463  * Default is PJ_FALSE.
464  */
465 #ifndef PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE
466 #   define PJSIP_RESOLVE_HOSTNAME_TO_GET_INTERFACE  PJ_FALSE
467 #endif
468 
469 /**
470  * Accept call replace in early state when invite is not initiated
471  * by the user agent. RFC 3891 Section 3 disallows this, however,
472  * for better interoperability reason, this might be ignored.
473  *
474  * This option can also be controlled at run-time by the
475  * \a accept_replace_in_early_state setting in pjsip_cfg_t.
476  *
477  * Default is 0 (no).
478  */
479 #ifndef PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE
480 #   define PJSIP_ACCEPT_REPLACE_IN_EARLY_STATE	    0
481 #endif
482 
483 
484 /**
485  * This setting controls the threshold of the UDP packet, which if it's
486  * larger than this value the request will be sent with TCP. This setting
487  * is useful only when PJSIP_DONT_SWITCH_TO_TCP is set to 0.
488  *
489  * Default is 1300 bytes.
490  */
491 #ifndef PJSIP_UDP_SIZE_THRESHOLD
492 #   define PJSIP_UDP_SIZE_THRESHOLD	1300
493 #endif
494 
495 
496 /**
497  * Encode SIP headers in their short forms to reduce size. By default,
498  * SIP headers in outgoing messages will be encoded in their full names.
499  * If this option is enabled, then SIP headers for outgoing messages
500  * will be encoded in their short forms, to reduce message size.
501  * Note that this does not affect the ability of PJSIP to parse incoming
502  * SIP messages, as the parser always supports parsing both the long
503  * and short version of the headers.
504  *
505  * This option can also be controlled at run-time by the
506  * \a use_compact_form setting in pjsip_cfg_t.
507  *
508  * Default is 0 (no)
509  */
510 #ifndef PJSIP_ENCODE_SHORT_HNAME
511 #   define PJSIP_ENCODE_SHORT_HNAME	0
512 #endif
513 
514 
515 /**
516  * Send Allow header in dialog establishing requests?
517  * RFC 3261 Allow header SHOULD be included in dialog establishing
518  * requests to inform remote agent about which SIP requests are
519  * allowed within dialog.
520  *
521  * Note that there is also an undocumented variable defined in sip_dialog.c
522  * to control whether Allow header should be included. The default value
523  * of this variable is PJSIP_INCLUDE_ALLOW_HDR_IN_DLG.
524  * To change PJSIP behavior during run-time, application can use the
525  * following construct:
526  *
527  \verbatim
528    extern pj_bool_t pjsip_include_allow_hdr_in_dlg;
529 
530    // do not transmit Allow header
531    pjsip_include_allow_hdr_in_dlg = PJ_FALSE;
532  \endverbatim
533  *
534  * Default is 1 (Yes)
535  */
536 #ifndef PJSIP_INCLUDE_ALLOW_HDR_IN_DLG
537 #   define PJSIP_INCLUDE_ALLOW_HDR_IN_DLG	1
538 #endif
539 
540 
541 /**
542  * Allow SIP modules removal or insertions during operation?
543  * If yes, then locking will be employed when endpoint need to
544  * access module.
545  */
546 #ifndef PJSIP_SAFE_MODULE
547 #   define PJSIP_SAFE_MODULE		1
548 #endif
549 
550 
551 /**
552  * Perform Via sent-by checking as specified in RFC 3261 Section 18.1.2,
553  * which says that UAC MUST silently discard responses with Via sent-by
554  * containing values that the UAC doesn't recognize as its transport
555  * address.
556  *
557  * In PJSIP, this will cause response to be discarded and a message is
558  * written to the log, saying something like:
559  *  "Dropping response Response msg 200/INVITE/cseq=608594373 (rdata00A99EF4)
560  *   from 1.2.3.4:5060 because sent-by is mismatch"
561  *
562  * The default behavior is yes, but when the UA supports IP address change
563  * for the SIP transport, it will need to turn this checking off since
564  * when the transport address is changed between request is sent and
565  * response is received, the response will be discarded since its Via
566  * sent-by now contains address that is different than the transport
567  * address.
568  *
569  * Update:
570  * As of version 2.1, the default value is 0. This change was part of
571  * https://trac.pjsip.org/repos/ticket/1412
572  */
573 #ifndef PJSIP_CHECK_VIA_SENT_BY
574 #   define PJSIP_CHECK_VIA_SENT_BY	0
575 #endif
576 
577 
578 /**
579  * If non-zero, SIP parser will unescape the escape characters ('%')
580  * in the original message, which means that it will modify the
581  * original message. Otherwise the parser will create a copy of
582  * the string and store the unescaped string to the new location.
583  *
584  * Unescaping in-place is faster, but less elegant (and it may
585  * break certain applications). So normally it's disabled, unless
586  * when benchmarking (to show off big performance).
587  *
588  * Default: 0
589  */
590 #ifndef PJSIP_UNESCAPE_IN_PLACE
591 #   define PJSIP_UNESCAPE_IN_PLACE	0
592 #endif
593 
594 
595 /**
596  * Specify port number should be allowed to appear in To and From
597  * header. Note that RFC 3261 disallow this, see Table 1 in section
598  * 19.1.1 of the RFC. This setting can also be altered at run-time
599  * via pjsip_cfg setting, see pjsip_cfg_t.allow_port_in_fromto_hdr
600  * field.
601  *
602  * Default: 0
603  */
604 #ifndef PJSIP_ALLOW_PORT_IN_FROMTO_HDR
605 #   define PJSIP_ALLOW_PORT_IN_FROMTO_HDR	0
606 #endif
607 
608 /**
609  * This macro controls maximum numbers of ioqueue events to be processed
610  * in a single pjsip_endpt_handle_events() poll. When PJSIP detects that
611  * there are probably more events available from the network and total
612  * events so far is less than this value, PJSIP will call pj_ioqueue_poll()
613  * again to get more events.
614  *
615  * Value 1 works best for ioqueue with select() back-end, while for IOCP it is
616  * probably best to set this value equal to PJSIP_MAX_TIMED_OUT_ENTRIES
617  * since IOCP only processes one event at a time.
618  *
619  * Default: 1
620  */
621 #ifndef PJSIP_MAX_NET_EVENTS
622 #   define PJSIP_MAX_NET_EVENTS		1
623 #endif
624 
625 
626 /**
627  * Max entries to process in timer heap per poll.
628  *
629  * Default: 10
630  */
631 #ifndef PJSIP_MAX_TIMED_OUT_ENTRIES
632 #   define PJSIP_MAX_TIMED_OUT_ENTRIES	10
633 #endif
634 
635 
636 /**
637  * Idle timeout interval to be applied to outgoing transports (i.e. client
638  * side) with no usage before the transport is destroyed. Value is in
639  * seconds.
640  *
641  * Note that if the value is put lower than 33 seconds, it may cause some
642  * pjsip test units to fail. See the comment on the following link:
643  * https://trac.pjsip.org/repos/ticket/1465#comment:4
644  *
645  * Default: 33
646  */
647 #ifndef PJSIP_TRANSPORT_IDLE_TIME
648 #   define PJSIP_TRANSPORT_IDLE_TIME	33
649 #endif
650 
651 
652 /**
653  * Idle timeout interval to be applied to incoming transports (i.e. server
654  * side) with no usage before the transport is destroyed. Server typically
655  * should let client close the connection, hence set this interval to a large
656  * value. Value is in seconds.
657  *
658  * Default: 600
659  */
660 #ifndef PJSIP_TRANSPORT_SERVER_IDLE_TIME
661 #   define PJSIP_TRANSPORT_SERVER_IDLE_TIME	600
662 #endif
663 
664 
665 /**
666  * Maximum number of usages for a transport before a new transport is
667  * created. This only applies for ephemeral transports such as TCP.
668  *
669  * Currently this is not used.
670  *
671  * Default: -1
672  */
673 #ifndef PJSIP_MAX_TRANSPORT_USAGE
674 #   define PJSIP_MAX_TRANSPORT_USAGE	((unsigned)-1)
675 #endif
676 
677 
678 /**
679  * The TCP incoming connection backlog number to be set in accept().
680  *
681  * Default: 5
682  *
683  * @see PJSIP_TLS_TRANSPORT_BACKLOG
684  */
685 #ifndef PJSIP_TCP_TRANSPORT_BACKLOG
686 #   define PJSIP_TCP_TRANSPORT_BACKLOG	5
687 #endif
688 
689 
690 /**
691  * Specify whether TCP listener should use SO_REUSEADDR option. This constant
692  * will be used as the default value for the "reuse_addr" field in the
693  * pjsip_tcp_transport_cfg structure.
694  *
695  * Default is 0 on Windows and 1 on non-Windows.
696  *
697  * @see PJSIP_TLS_TRANSPORT_REUSEADDR
698  */
699 #ifndef PJSIP_TCP_TRANSPORT_REUSEADDR
700 # if (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
701 #   define PJSIP_TCP_TRANSPORT_REUSEADDR	0
702 # else
703 #   define PJSIP_TCP_TRANSPORT_REUSEADDR	1
704 # endif
705 #endif
706 
707 
708 /**
709  * Specify whether TCP transport should skip creating the listener.
710  * Not having a listener means that application will not be able to
711  * function in server mode and accept incoming connections.
712  *
713  * When enabling this setting, if you use PJSUA, it is recommended to set
714  * pjsua_acc_config.contact_use_src_port to PJ_TRUE.
715  * Warning: If contact_use_src_port is disabled or failed (because it's
716  * unsupported in some platforms or automatically turned off due to
717  * DNS server resolution), Contact header will be generated from
718  * pj_getipinterface()/pj_gethostip(), but the address will not be
719  * able to accept connections.
720  *
721  * Default is 0 (listener will be created).
722  */
723 #ifndef PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER
724 #   define PJSIP_TCP_TRANSPORT_DONT_CREATE_LISTENER 0
725 #endif
726 
727 
728 /**
729  * Specify whether TLS transport should skip creating the listener.
730  * Not having a listener means that application will not be able to
731  * function in server mode and accept incoming connections.
732  *
733  * When enabling this setting, if you use PJSUA, it is recommended to set
734  * pjsua_acc_config.contact_use_src_port to PJ_TRUE.
735  * Warning: If contact_use_src_port is disabled or failed (because it's
736  * unsupported in some platforms or automatically turned off due to
737  * DNS server resolution), Contact header will be generated from
738  * pj_getipinterface()/pj_gethostip(), but the address will not be
739  * able to accept connections.
740  *
741  * Default is 0 (listener will be created).
742  */
743 #ifndef PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER
744 #   define PJSIP_TLS_TRANSPORT_DONT_CREATE_LISTENER 0
745 #endif
746 
747 
748 /**
749  * Set the interval to send keep-alive packet for TCP transports.
750  * If the value is zero, keep-alive will be disabled for TCP.
751  *
752  * This option can be changed in run-time by settting
753  * \a tcp.keep_alive_interval field of pjsip_cfg().
754  *
755  * Default: 90 (seconds)
756  *
757  * @see PJSIP_TCP_KEEP_ALIVE_DATA
758  */
759 #ifndef PJSIP_TCP_KEEP_ALIVE_INTERVAL
760 #   define PJSIP_TCP_KEEP_ALIVE_INTERVAL    90
761 #endif
762 
763 
764 /**
765  * Set the payload of the TCP keep-alive packet.
766  *
767  * Default: CRLF
768  */
769 #ifndef PJSIP_TCP_KEEP_ALIVE_DATA
770 #   define PJSIP_TCP_KEEP_ALIVE_DATA	    { "\r\n\r\n", 4 }
771 #endif
772 
773 
774 /**
775  * Initial timeout interval to be applied to incoming transports (i.e. server
776  * side) when no data received after a successful connection. Value is in
777  * seconds. Disable the timeout by setting it to 0.
778  *
779  * Note that even when this is disable, the connection might still get closed
780  * when it is idle or not referred anymore. Have a look at \a
781  * PJSIP_TRANSPORT_SERVER_IDLE_TIME
782  *
783  * Default: 0 (disabled)
784  */
785 #ifndef PJSIP_TCP_INITIAL_TIMEOUT
786 #   define PJSIP_TCP_INITIAL_TIMEOUT	    0
787 #endif
788 
789 /**
790  * Set the interval to send keep-alive packet for TLS transports.
791  * If the value is zero, keep-alive will be disabled for TLS.
792  *
793  * This option can be changed in run-time by settting
794  * \a tls.keep_alive_interval field of pjsip_cfg().
795  *
796  * Default: 90 (seconds)
797  *
798  * @see PJSIP_TLS_KEEP_ALIVE_DATA
799  */
800 #ifndef PJSIP_TLS_KEEP_ALIVE_INTERVAL
801 #   define PJSIP_TLS_KEEP_ALIVE_INTERVAL    90
802 #endif
803 
804 
805 /**
806  * Set the payload of the TLS keep-alive packet.
807  *
808  * Default: CRLF
809  */
810 #ifndef PJSIP_TLS_KEEP_ALIVE_DATA
811 #   define PJSIP_TLS_KEEP_ALIVE_DATA	    { "\r\n\r\n", 4 }
812 #endif
813 
814 
815 /**
816  * This macro specifies whether full DNS resolution should be used.
817  * When enabled, #pjsip_resolve() will perform asynchronous DNS SRV and
818  * A (or AAAA, when IPv6 is supported) resolution to resolve the SIP
819  * domain.
820  *
821  * Note that even when this setting is enabled, asynchronous DNS resolution
822  * will only be done when application calls #pjsip_endpt_create_resolver(),
823  * configure the nameservers with pj_dns_resolver_set_ns(), and configure
824  * the SIP endpoint's DNS resolver with #pjsip_endpt_set_resolver(). If
825  * these steps are not followed, the domain will be resolved with normal
826  * pj_gethostbyname() function.
827  *
828  * Turning off this setting will save the footprint by about 16KB, since
829  * it should also exclude dns.o and resolve.o from PJLIB-UTIL.
830  *
831  * Default: 1 (enabled)
832  *
833  * @see PJSIP_MAX_RESOLVED_ADDRESSES
834  */
835 #ifndef PJSIP_HAS_RESOLVER
836 #   define PJSIP_HAS_RESOLVER		1
837 #endif
838 
839 
840 /**
841  * Maximum number of addresses returned by the resolver. The number here
842  * will slightly affect stack usage, since each entry will occupy about
843  * 32 bytes of stack memory.
844  *
845  * Default: 16 (or 32 if IPv6 support is enabled)
846  *
847  * @see PJSIP_HAS_RESOLVER
848  */
849 #ifndef PJSIP_MAX_RESOLVED_ADDRESSES
850 #   if defined(PJ_HAS_IPV6) && PJ_HAS_IPV6
851 #       define PJSIP_MAX_RESOLVED_ADDRESSES	    32
852 #   else
853 #       define PJSIP_MAX_RESOLVED_ADDRESSES	    16
854 #   endif
855 #endif
856 
857 
858 /**
859  * Enable TLS SIP transport support. For most systems this means that
860  * OpenSSL must be installed.
861  *
862  * Default: follow PJ_HAS_SSL_SOCK setting, which is 0 (disabled) by default.
863  */
864 #ifndef PJSIP_HAS_TLS_TRANSPORT
865 #   define PJSIP_HAS_TLS_TRANSPORT          PJ_HAS_SSL_SOCK
866 #endif
867 
868 
869 /**
870  * The TLS pending incoming connection backlog number to be set in accept().
871  *
872  * Default: 5
873  *
874  * @see PJSIP_TCP_TRANSPORT_BACKLOG
875  */
876 #ifndef PJSIP_TLS_TRANSPORT_BACKLOG
877 #   define PJSIP_TLS_TRANSPORT_BACKLOG	    5
878 #endif
879 
880 
881 /**
882  * Specify whether TLS listener should use SO_REUSEADDR option.
883  *
884  * Default is 0 on Windows and 1 on non-Windows.
885  *
886  * @see PJSIP_TCP_TRANSPORT_REUSEADDR
887  */
888 #ifndef PJSIP_TLS_TRANSPORT_REUSEADDR
889 # if (defined(PJ_WIN32) && PJ_WIN32) || (defined(PJ_WIN64) && PJ_WIN64)
890 #   define PJSIP_TLS_TRANSPORT_REUSEADDR	0
891 # else
892 #   define PJSIP_TLS_TRANSPORT_REUSEADDR	1
893 # endif
894 #endif
895 
896 
897 /**
898  * Specify the maximum number of timer entries initially allocated by
899  * endpoint. If the application registers more entries during runtime,
900  * then the timer will automatically resize.
901  *
902  * Default: (2*pjsip_cfg()->tsx.max_count) + (2*PJSIP_MAX_DIALOG_COUNT)
903  */
904 #ifndef PJSIP_MAX_TIMER_COUNT
905 #   define PJSIP_MAX_TIMER_COUNT	(2*pjsip_cfg()->tsx.max_count + \
906 					 2*PJSIP_MAX_DIALOG_COUNT)
907 #endif
908 
909 /**
910  * Initial memory block for the endpoint.
911  */
912 #ifndef PJSIP_POOL_LEN_ENDPT
913 #   define PJSIP_POOL_LEN_ENDPT		(4000)
914 #endif
915 
916 /**
917  * Memory increment for endpoint.
918  */
919 #ifndef PJSIP_POOL_INC_ENDPT
920 #   define PJSIP_POOL_INC_ENDPT		(4000)
921 #endif
922 
923 
924 /* Transport related constants. */
925 
926 /**
927  * Initial memory block for rdata.
928  */
929 #ifndef PJSIP_POOL_RDATA_LEN
930 #   define PJSIP_POOL_RDATA_LEN		4000
931 #endif
932 
933 /**
934  * Memory increment for rdata.
935  */
936 #ifndef PJSIP_POOL_RDATA_INC
937 #   define PJSIP_POOL_RDATA_INC		4000
938 #endif
939 
940 /**
941  * Initial memory block for SIP transport.
942  */
943 #ifndef PJSIP_POOL_LEN_TRANSPORT
944 #   define PJSIP_POOL_LEN_TRANSPORT	512
945 #endif
946 
947 /**
948  * Memory increment for SIP transport.
949  */
950 #ifndef PJSIP_POOL_INC_TRANSPORT
951 #   define PJSIP_POOL_INC_TRANSPORT	512
952 #endif
953 
954 /**
955  * Initial memory block size for tdata.
956  */
957 #ifndef PJSIP_POOL_LEN_TDATA
958 #   define PJSIP_POOL_LEN_TDATA		4000
959 #endif
960 
961 /**
962  * Memory increment for tdata.
963  */
964 #ifndef PJSIP_POOL_INC_TDATA
965 #   define PJSIP_POOL_INC_TDATA		4000
966 #endif
967 
968 /**
969  * Initial memory size for UA layer
970  */
971 #ifndef PJSIP_POOL_LEN_UA
972 #   define PJSIP_POOL_LEN_UA		512
973 #endif
974 
975 /**
976  * Memory increment for UA layer.
977  */
978 #ifndef PJSIP_POOL_INC_UA
979 #   define PJSIP_POOL_INC_UA		512
980 #endif
981 
982 /**
983  * Initial memory block for event subscription module.
984  */
985 #ifndef PJSIP_POOL_EVSUB_LEN
986 #   define PJSIP_POOL_EVSUB_LEN		512
987 #endif
988 
989 /**
990  * Memory increment for event subscription module.
991  */
992 #ifndef PJSIP_POOL_EVSUB_INC
993 #   define PJSIP_POOL_EVSUB_INC		512
994 #endif
995 
996 
997 #define PJSIP_MAX_FORWARDS_VALUE	70
998 
999 #define PJSIP_RFC3261_BRANCH_ID		"z9hG4bK"
1000 #define PJSIP_RFC3261_BRANCH_LEN	7
1001 
1002 /* Transaction related constants. */
1003 
1004 /**
1005  * Initial memory size for transaction layer. The bulk of pool usage
1006  * for transaction layer will be used to create the hash table, so
1007  * setting this value too high will not help too much with reducing
1008  * fragmentation and the memory will most likely be wasted.
1009  */
1010 #ifndef PJSIP_POOL_TSX_LAYER_LEN
1011 #   define PJSIP_POOL_TSX_LAYER_LEN	512
1012 #endif
1013 
1014 /**
1015  * Memory increment for transaction layer. The bulk of pool usage
1016  * for transaction layer will be used to create the hash table, so
1017  * setting this value too high will not help too much with reducing
1018  * fragmentation and the memory will most likely be wasted.
1019  */
1020 #ifndef PJSIP_POOL_TSX_LAYER_INC
1021 #   define PJSIP_POOL_TSX_LAYER_INC	512
1022 #endif
1023 
1024 /**
1025  * Initial memory size for a SIP transaction object.
1026  */
1027 #ifndef PJSIP_POOL_TSX_LEN
1028 #   define PJSIP_POOL_TSX_LEN		1536 /* 768 */
1029 #endif
1030 
1031 /**
1032  * Memory increment for transaction object.
1033  */
1034 #ifndef PJSIP_POOL_TSX_INC
1035 #   define PJSIP_POOL_TSX_INC		256
1036 #endif
1037 
1038 /**
1039  * Delay for non-100 1xx retransmission, in seconds.
1040  * Set to 0 to disable this feature.
1041  *
1042  * Default: 60 seconds
1043  */
1044 #ifndef PJSIP_TSX_1XX_RETRANS_DELAY
1045 #   define PJSIP_TSX_1XX_RETRANS_DELAY	60
1046 #endif
1047 
1048 #define PJSIP_MAX_TSX_KEY_LEN		(PJSIP_MAX_URL_SIZE*2)
1049 
1050 /* User agent. */
1051 #define PJSIP_POOL_LEN_USER_AGENT	1024
1052 #define PJSIP_POOL_INC_USER_AGENT	1024
1053 
1054 /* Message/URL related constants. */
1055 #define PJSIP_MAX_CALL_ID_LEN		pj_GUID_STRING_LENGTH()
1056 #define PJSIP_MAX_TAG_LEN		pj_GUID_STRING_LENGTH()
1057 #define PJSIP_MAX_BRANCH_LEN		(PJSIP_RFC3261_BRANCH_LEN + pj_GUID_STRING_LENGTH() + 2)
1058 #define PJSIP_MAX_HNAME_LEN		64
1059 
1060 /* Dialog related constants. */
1061 #define PJSIP_POOL_LEN_DIALOG		1200
1062 #define PJSIP_POOL_INC_DIALOG		512
1063 
1064 /* Maximum header types. */
1065 #define PJSIP_MAX_HEADER_TYPES		72
1066 
1067 /* Maximum URI types. */
1068 #define PJSIP_MAX_URI_TYPES		4
1069 
1070 /*****************************************************************************
1071  *  Default timeout settings, in miliseconds.
1072  */
1073 
1074 /** Transaction T1 timeout value. */
1075 #if !defined(PJSIP_T1_TIMEOUT)
1076 #  define PJSIP_T1_TIMEOUT	500
1077 #endif
1078 
1079 /** Transaction T2 timeout value. */
1080 #if !defined(PJSIP_T2_TIMEOUT)
1081 #  define PJSIP_T2_TIMEOUT	4000
1082 #endif
1083 
1084 /** Transaction completed timer for non-INVITE */
1085 #if !defined(PJSIP_T4_TIMEOUT)
1086 #  define PJSIP_T4_TIMEOUT	5000
1087 #endif
1088 
1089 /** Transaction completed timer for INVITE */
1090 #if !defined(PJSIP_TD_TIMEOUT)
1091 #  define PJSIP_TD_TIMEOUT	32000
1092 #endif
1093 
1094 
1095 /*****************************************************************************
1096  *  Authorization
1097  */
1098 
1099 /**
1100  * If this flag is set, the stack will keep the Authorization/Proxy-Authorization
1101  * headers that are sent in a cache. Future requests with the same realm and
1102  * the same method will use the headers in the cache (as long as no qop is
1103  * required by server).
1104  *
1105  * Turning on this flag will make authorization process goes faster, but
1106  * will grow the memory usage undefinitely until the dialog/registration
1107  * session is terminated.
1108  *
1109  * Default: 0
1110  */
1111 #if !defined(PJSIP_AUTH_HEADER_CACHING)
1112 #   define PJSIP_AUTH_HEADER_CACHING	    0
1113 #endif
1114 
1115 /**
1116  * If this flag is set, the stack will proactively send Authorization/Proxy-
1117  * Authorization header for next requests. If next request has the same method
1118  * with any of previous requests, then the last header which is saved in
1119  * the cache will be used (if PJSIP_AUTH_CACHING is set). Otherwise a fresh
1120  * header will be recalculated. If a particular server has requested qop, then
1121  * a fresh header will always be calculated.
1122  *
1123  * If this flag is NOT set, then the stack will only send Authorization/Proxy-
1124  * Authorization headers when it receives 401/407 response from server.
1125  *
1126  * Turning ON this flag will grow memory usage of a dialog/registration pool
1127  * indefinitely until it is terminated, because the stack needs to keep the
1128  * last WWW-Authenticate/Proxy-Authenticate challenge.
1129  *
1130  * Default: 0
1131  */
1132 #if !defined(PJSIP_AUTH_AUTO_SEND_NEXT)
1133 #   define PJSIP_AUTH_AUTO_SEND_NEXT	    0
1134 #endif
1135 
1136 /**
1137  * Support qop="auth" directive.
1138  * This option also requires client to cache the last challenge offered by
1139  * server.
1140  *
1141  * Default: 1
1142  */
1143 #if !defined(PJSIP_AUTH_QOP_SUPPORT)
1144 #   define PJSIP_AUTH_QOP_SUPPORT	    1
1145 #endif
1146 
1147 
1148 /**
1149  * Maximum number of stale retries when server keeps rejecting our request
1150  * with stale=true.
1151  *
1152  * Default: 3
1153  */
1154 #ifndef PJSIP_MAX_STALE_COUNT
1155 #   define PJSIP_MAX_STALE_COUNT	    3
1156 #endif
1157 
1158 
1159 /**
1160  * Specify support for IMS/3GPP digest AKA authentication version 1 and 2
1161  * (AKAv1-MD5 and AKAv2-MD5 respectively).
1162  *
1163  * Note that if this is enabled, application would need to link with
1164  * <b>libmilenage</b> library from \a third_party directory.
1165  *
1166  * Default: 0 (for now)
1167  */
1168 #ifndef PJSIP_HAS_DIGEST_AKA_AUTH
1169 #   define PJSIP_HAS_DIGEST_AKA_AUTH	    0
1170 #endif
1171 
1172 
1173 /**
1174  * Specify the number of seconds to refresh the client registration
1175  * before the registration expires.
1176  *
1177  * Default: 5 seconds
1178  */
1179 #ifndef PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH
1180 #   define PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH  5
1181 #endif
1182 
1183 
1184 /**
1185  * Specify whether client registration should check for its registered
1186  * contact in Contact header of successful REGISTE response to determine
1187  * whether registration has been successful. This setting may be disabled
1188  * if non-compliant registrar is unable to return correct Contact header.
1189  *
1190  * This setting can be changed in run-time by settting \a regc.check_contact
1191  * field of pjsip_cfg().
1192  *
1193  * Default is 1
1194  */
1195 #ifndef PJSIP_REGISTER_CLIENT_CHECK_CONTACT
1196 #   define PJSIP_REGISTER_CLIENT_CHECK_CONTACT	1
1197 #endif
1198 
1199 
1200 /**
1201  * Specify whether client registration should add "x-uid" extension
1202  * parameter in all Contact URIs that it registers to assist the
1203  * matching of Contact URIs in the 200/OK REGISTER response, in
1204  * case the registrar is unable to return exact Contact URI in the
1205  * 200/OK response.
1206  *
1207  * This setting can be changed in run-time by setting
1208  * \a regc.add_xuid_param field of pjsip_cfg().
1209  *
1210  * Default is 0.
1211  */
1212 #ifndef PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM
1213 #   define PJSIP_REGISTER_CLIENT_ADD_XUID_PARAM	0
1214 #endif
1215 
1216 /**
1217  * Maximum size of pool allowed for auth client session in pjsip_regc.
1218  * After the size exceeds because of Digest authentication processing,
1219  * the pool is reset.
1220  *
1221  * Default is 20 kB
1222  */
1223 #ifndef PJSIP_AUTH_CACHED_POOL_MAX_SIZE
1224 #   define PJSIP_AUTH_CACHED_POOL_MAX_SIZE	(20 * 1024)
1225 #endif
1226 
1227 
1228 /**
1229  * Specify whether the cnonce used for SIP authentication contain digits only.
1230  * The "cnonce" value is setup using GUID generator, i.e:
1231  * pj_create_unique_string(), and the GUID string may contain hyphen character
1232  * ("-"). Some SIP servers do not like this GUID format, so this option will
1233  * strip any hyphens from the GUID string.
1234  *
1235  * Default is 1 (cnonce will not contain any hyphen characters).
1236  */
1237 #ifndef PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY
1238 #   define PJSIP_AUTH_CNONCE_USE_DIGITS_ONLY	1
1239 #endif
1240 
1241 /*****************************************************************************
1242  *  SIP Event framework and presence settings.
1243  */
1244 
1245 /**
1246  * Specify the time (in seconds) to send SUBSCRIBE to refresh client
1247  * subscription before the actual interval expires.
1248  *
1249  * Default: 5 seconds
1250  */
1251 #ifndef PJSIP_EVSUB_TIME_UAC_REFRESH
1252 #   define PJSIP_EVSUB_TIME_UAC_REFRESH		5
1253 #endif
1254 
1255 
1256 /**
1257  * Specify the time (in seconds) to send PUBLISH to refresh client
1258  * publication before the actual interval expires.
1259  *
1260  * Default: 5 seconds
1261  */
1262 #ifndef PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH
1263 #   define PJSIP_PUBLISHC_DELAY_BEFORE_REFRESH	5
1264 #endif
1265 
1266 
1267 /**
1268  * Specify the time (in seconds) to wait for the final NOTIFY from the
1269  * server after client has sent un-SUBSCRIBE request.
1270  *
1271  * Default: 5 seconds
1272  */
1273 #ifndef PJSIP_EVSUB_TIME_UAC_TERMINATE
1274 #   define PJSIP_EVSUB_TIME_UAC_TERMINATE	5
1275 #endif
1276 
1277 
1278 /**
1279  * Specify the time (in seconds) for client subscription to wait for another
1280  * NOTIFY from the server, if it has rejected the last NOTIFY with non-2xx
1281  * final response (such as 401). If further NOTIFY is not received within
1282  * this period, the client will unsubscribe.
1283  *
1284  * Default: 5 seconds
1285  */
1286 #ifndef PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY
1287 #   define PJSIP_EVSUB_TIME_UAC_WAIT_NOTIFY	5
1288 #endif
1289 
1290 
1291 /**
1292  * Specify the default expiration time for presence event subscription, for
1293  * both client and server subscription. For client subscription, application
1294  * can override this by specifying positive non-zero value in "expires"
1295  * parameter when calling #pjsip_pres_initiate(). For server subscription,
1296  * we would take the expiration value from the Expires header sent by client
1297  * in the SUBSCRIBE request if the header exists and its value is less than
1298  * this setting, otherwise this setting will be used.
1299  *
1300  * Default: 600 seconds (10 minutes)
1301  */
1302 #ifndef PJSIP_PRES_DEFAULT_EXPIRES
1303 #   define PJSIP_PRES_DEFAULT_EXPIRES		600
1304 #endif
1305 
1306 
1307 /**
1308  * Specify the status code value to respond to bad message body in NOTIFY
1309  * request for presence. Scenarios that are considered bad include non-
1310  * PIDF/XML and non-XPIDF/XML body, multipart message bodies without PIDF/XML
1311  * nor XPIDF/XML part, and bad (parsing error) PIDF and X-PIDF bodies
1312  * themselves.
1313  *
1314  * Default value is 488. Application may change this to 200 to ignore the
1315  * unrecognised content (this is useful if the application wishes to handle
1316  * the content itself). Only non-3xx final response code is allowed here.
1317  *
1318  * Default: 488 (Not Acceptable Here)
1319  */
1320 #ifndef PJSIP_PRES_BAD_CONTENT_RESPONSE
1321 #   define PJSIP_PRES_BAD_CONTENT_RESPONSE	488
1322 #endif
1323 
1324 
1325 /**
1326  * Add "timestamp" information in generated PIDF document for both server
1327  * subscription and presence publication.
1328  *
1329  * Default: 1 (yes)
1330  */
1331 #ifndef PJSIP_PRES_PIDF_ADD_TIMESTAMP
1332 #   define PJSIP_PRES_PIDF_ADD_TIMESTAMP	1
1333 #endif
1334 
1335 
1336 /**
1337  * Default session interval for Session Timer (RFC 4028) extension, in
1338  * seconds. As specified in RFC 4028 Section 4, this value must not be
1339  * less than the absolute minimum for the Session-Expires header field
1340  * 90 seconds, and the recommended value is 1800 seconds.
1341  *
1342  * Default: 1800 seconds
1343  */
1344 #ifndef PJSIP_SESS_TIMER_DEF_SE
1345 #   define PJSIP_SESS_TIMER_DEF_SE		1800
1346 #endif
1347 
1348 
1349 /**
1350  * Default delay for retrying session refresh request upon
1351  * receiving transport error (503). Set it to -1 to end the session
1352  * immediately instead.
1353  *
1354  * Default: 10 seconds
1355  */
1356 #ifndef PJSIP_SESS_TIMER_RETRY_DELAY
1357 #   define PJSIP_SESS_TIMER_RETRY_DELAY		10
1358 #endif
1359 
1360 
1361 /**
1362  * Specify whether the client publication session should queue the
1363  * PUBLISH request should there be another PUBLISH transaction still
1364  * pending. If this is set to false, the client will return error
1365  * on the PUBLISH request if there is another PUBLISH transaction still
1366  * in progress.
1367  *
1368  * Default: 1 (yes)
1369  */
1370 #ifndef PJSIP_PUBLISHC_QUEUE_REQUEST
1371 #   define PJSIP_PUBLISHC_QUEUE_REQUEST		1
1372 #endif
1373 
1374 
1375 /**
1376  * Specify the default expiration time for Message Waiting Indication
1377  * (RFC 3842) event subscription, for both client and server subscription.
1378  * For client subscription, application can override this by specifying
1379  * positive non-zero value in "expires" parameter when calling
1380  * #pjsip_mwi_initiate(). For server subscription, we would take the
1381  * expiration value from the Expires header sent by client in the SUBSCRIBE
1382  * request if the header exists and its value is less than  this setting,
1383  * otherwise this setting will be used.
1384  *
1385  * Default: 3600 seconds
1386  */
1387 #ifndef PJSIP_MWI_DEFAULT_EXPIRES
1388 #   define PJSIP_MWI_DEFAULT_EXPIRES		3600
1389 #endif
1390 
1391 
1392 /**
1393  * Specify whether transport manager should maintain a list of transmit
1394  * buffer instances, so any possible dangling instance can be cleaned up
1395  * when the transport manager is shutdown (see also ticket #1671).
1396  * Note that this feature will have slight impact on the performance as
1397  * mutex is employed in updating the list, i.e: on creation and destruction
1398  * of transmit data.
1399  *
1400  * Default: 0 (no)
1401  */
1402 #ifndef PJSIP_HAS_TX_DATA_LIST
1403 #   define PJSIP_HAS_TX_DATA_LIST		0
1404 #endif
1405 
1406 /**
1407  * Specify whether to accept INVITE/re-INVITE with unknown content type,
1408  * by default the stack will reject this type of message as specified in
1409  * RFC3261 section 8.2.3.
1410  * Application that wishes to process the body could set this to PJ_TRUE,
1411  * be informed that SDP offer/answer will still be present.
1412  *
1413  * Default: PJ_FALSE
1414  */
1415 #ifndef PJSIP_INV_ACCEPT_UNKNOWN_BODY
1416 #   define PJSIP_INV_ACCEPT_UNKNOWN_BODY    PJ_FALSE
1417 #endif
1418 
1419 PJ_END_DECL
1420 
1421 /**
1422  * @}
1423  */
1424 
1425 
1426 #include <pj/config.h>
1427 
1428 
1429 #endif	/* __PJSIP_SIP_CONFIG_H__ */
1430 
1431