2 * Copyright (C) 2001-2003 FhG Fokus
4 * This file is part of Kamailio, a free SIP server.
6 * Kamailio 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
11 * Kamailio 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.
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24 * \brief Kamailio core :: Configuration options
25 * \author jiri, andrei
27 * These settings are settable by the user before compilation
38 #include "crypto/md5utils.h"
40 #define SIP_PORT 5060 /*!< default SIP port if none specified */
41 #define SIPS_PORT 5061 /*!< default SIP port for TLS if none specified */
43 #define CFG_FILE CFG_DIR NAME ".cfg"
45 #define TLS_PKEY_FILE "cert.pem" /*!< The certificate private key file */
46 #define TLS_CERT_FILE "cert.pem" /*!< The certificate file */
47 #define TLS_CA_FILE 0 /*!< no CA list file by default */
48 #define TLS_CRL_FILE 0 /*!< no CRL by default */
50 #define CHILD_NO 8 /*!< default number of child processes started */
52 #define RT_NO 2 /*!< routing tables number */
53 #define FAILURE_RT_NO RT_NO /*!< on_failure routing tables number */
54 #define ONREPLY_RT_NO RT_NO /*!< on_reply routing tables number */
55 #define BRANCH_RT_NO RT_NO /*!< branch_route routing tables number */
56 #define ONSEND_RT_NO 1 /*!< onsend_route routing tables number */
57 #define EVENT_RT_NO RT_NO /*!< event_route routing tables number */
58 #define DEFAULT_RT 0 /*!< default routing table */
60 #define MAX_URI_SIZE 1024 /*!< Max URI size used when rewriting URIs */
62 #define MAX_PATH_SIZE 256 /*!< Maximum length of path header buffer */
64 #define MAX_INSTANCE_SIZE 256 /*!< Maximum length of +sip.instance contact header param value buffer */
66 #define MAX_RUID_SIZE 65 /*!< Maximum length of ruid for location records */
68 #define MAX_UA_SIZE 255 /*!< Maximum length of user-agent for location records */
70 #define MY_VIA "Via: SIP/2.0/UDP "
71 #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
73 #define ROUTE_PREFIX "Route: "
74 #define ROUTE_PREFIX_LEN (sizeof(ROUTE_PREFIX) - 1)
76 #define ROUTE_SEPARATOR ", "
77 #define ROUTE_SEPARATOR_LEN (sizeof(ROUTE_SEPARATOR) - 1)
79 #define CONTENT_LENGTH "Content-Length: "
80 #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
82 #define SRVAPP_SIGNATURE NAME \
83 " (" VERSION " (" ARCH "/" OS_QUOTED "))"
84 #define SRVAPP_SIGNATURE_LEN (sizeof(SRVAPP_SIGNATURE)-1)
87 #define USER_AGENT "User-Agent: " SRVAPP_SIGNATURE
88 #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
90 #define SERVER_HDR "Server: " SRVAPP_SIGNATURE
91 #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
93 #define MAX_WARNING_LEN 256
95 #define MY_BRANCH ";branch="
96 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
98 #define MAX_PORT_VAL 65535
99 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
102 #define CRLF_LEN (sizeof(CRLF) - 1)
103 #define CRLFCRLF "\r\n\r\n"
104 #define CRLFCRLF_LEN (sizeof(CRLFCRLF) - 1)
106 #define RECEIVED ";received="
107 #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
109 #define TRANSPORT_PARAM ";transport="
110 #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
112 #define COMP_PARAM ";comp="
113 #define COMP_PARAM_LEN (sizeof(COMP_PARAM)-1)
115 #define SOCKNAME_ATTR "sn"
116 #define SOCKNAME_ATTR_LEN (sizeof(SOCKNAME_ATTR)-1)
118 #define SOCKNAME_PARAM ";" SOCKNAME_ATTR "="
119 #define SOCKNAME_PARAM_LEN (sizeof(SOCKNAME_PARAM)-1)
121 #define SIGCOMP_NAME "sigcomp"
122 #define SIGCOMP_NAME_LEN (sizeof(SIGCOMP_NAME)-1)
124 #define SERGZ_NAME "sergz"
125 #define SERGZ_NAME_LEN (sizeof(SERGZ_NAME)-1)
127 #define TOTAG_TOKEN ";tag="
128 #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
130 #define RPORT ";rport="
131 #define RPORT_LEN (sizeof(RPORT) - 1)
133 #define ID_PARAM ";i="
134 #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
136 #define SRV_UDP_PREFIX "_sip._udp."
137 #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
139 #define SRV_TCP_PREFIX "_sip._tcp."
140 #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
142 #define SRV_TLS_PREFIX "_sips._tcp."
143 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
145 #define SRV_SCTP_PREFIX "_sip._sctp."
146 #define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
148 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
151 #define PKG_MEM_SIZE 8
153 #define PKG_MEM_POOL_SIZE PKG_MEM_SIZE*1024*1024 /*!< used only if PKG_MALLOC is defined*/
155 #define SHM_MEM_SIZE 64 /*!< used if SH_MEM is defined*/
156 #define SHM_MEM_POOL_SIZE SHM_MEM_SIZE*1024*1024
158 /* dimensioning buckets in q_malloc */
159 /*! \brief size of the size2bucket table; everything beyond that asks for
160 a variable-size kilo-bucket
162 #define MAX_FIXED_BLOCK 3072
163 #define BLOCK_STEP 512 /*!< distance of kilo-buckets */
164 #define MAX_BUCKET 15 /*!< maximum number of possible buckets */
166 /*! \brief receive buffer size -- preferably set low to
167 avoid terror of excessively huge messages; they are
170 #define BUF_SIZE 65535
172 #define MAX_VIA_LINE_SIZE 240 /*!< forwarding -- Via buffer dimensioning */
173 #define MAX_RECEIVED_SIZE 59 /*!< forwarding -- Via buffer dimensioning - Received header */
174 #define MAX_RPORT_SIZE 13 /*!< forwarding -- Via buffer dimensioning - Rport */
176 #define MAX_BRANCHES_DEFAULT 12 /*!< default maximum number of branches per transaction */
177 #define MAX_BRANCHES_LIMIT 32 /*!< limit of maximum number of branches per transaction */
179 #define MAX_PRINT_TEXT 256 /*!< max length of the text of fifo 'print' command */
181 #define MAX_REDIRECTION_LEN 4096 /*!< maximum length of Contact header field in redirection replies */
183 /*! \brief used by FIFO statistics in module to terminate line;
184 extra whitespaces are used to overwrite remainders of
185 previous line if longer than current one
187 #define CLEANUP_EOL " \n"
189 #define MCOOKIE "z9hG4bK" /*!< magic cookie for transaction matching as defined in RFC3261 */
190 #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
191 /*! \brief Maximum length of values appended to Via-branch parameter */
192 #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
193 MD5_LEN /* max(int2hex, MD5_LEN) */ \
194 + 1 /*sep*/ + 8 /*int2hex*/ + \
195 1 /*extra space, needed by t_calc_branch*/)
197 #define DEFAULT_SER_KILL_TIMEOUT 60 /*!< Kill timeout : seconds */
199 #define PATH_MAX_GUESS 1024 /*!< maximum path length */
201 #define DEFAULT_DB_URL "mysql://kamailio:kamailiorw@localhost/kamailio"
202 #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
203 #define DEFAULT_RODB_URL "mysql://kamailioro:kamailioro@localhost/kamailio"
204 #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
206 #define VERSION_TABLE "version" /*!< table holding versions of other ser tables */
207 #define VERSION_TABLE_LEN (sizeof(VERSION_TABLE) - 1)
208 #define VERSION_COLUMN "table_version" /*!< Column holding version number in version table */
209 #define TABLENAME_COLUMN "table_name" /*!< Column holding module name in version table */
211 #define MIN_UDP_PACKET 32 /*!< minimum UDP packet size; smaller packets will be dropped silently */
213 #define MIN_SCTP_PACKET MIN_UDP_PACKET /*!< minimum size of SCTP packet */
215 #define DEFAULT_RADIUS_CONFIG "/usr/local/etc/radiusclient/radiusclient.conf" /*!< Default FreeRadius configuration file */
217 #define DEFAULT_DID "_default"
219 #define DEFAULT_MAX_WHILE_LOOPS 100 /*!< Maximum allowed iterations for a while (to catch runaways) */