2 * $Id: config.h,v 1.61.2.2 2005/11/29 19:39:45 andrei Exp $
4 * Copyright (C) 2001-2003 FhG Fokus
6 * This file is part of ser, a free SIP server.
8 * ser is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version
13 * For a license to use the ser software under conditions
14 * other than those described here, or to purchase support for this
15 * software, please contact iptel.org by e-mail at the following addresses:
18 * ser is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 * 2003-04-05 DEFAULT_*_URL introduced (jiri)
30 * 2003-07-04 fixed SRV lookup prefix for TLS/sips (andrei)
31 * 2005-04-25 MAX_BRANCH_PARAM_LEN too small, fixed (andrei)
42 /* default sip port if none specified */
44 #define SIPS_PORT 5061
46 #define CFG_FILE CFG_DIR "ser.cfg"
48 #define TLS_PKEY_FILE CFG_DIR "cert.pem"
49 #define TLS_CERT_FILE CFG_DIR "cert.pem"
50 #define TLS_CA_FILE 0 /* no CA list file by default */
53 /* maximum number of addresses on which we will listen */
56 /* default number of child processes started */
59 #define RT_NO 20 /* routing tables number */
60 #define FAILURE_RT_NO RT_NO /* on_failure routing tables number */
61 #define ONREPLY_RT_NO RT_NO /* on_reply routing tables number */
62 #define DEFAULT_RT 0 /* default routing table */
64 #define MAX_REC_LEV 100 /* maximum number of recursive calls */
65 #define ROUTE_MAX_REC_LEV 100 /* maximum number of recursive calls
68 #define MAX_URI_SIZE 1024 /* used when rewriting URIs */
70 #define MY_VIA "Via: SIP/2.0/UDP "
71 #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
73 #define CONTENT_LENGTH "Content-Length: "
74 #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
76 #define USER_AGENT "User-Agent: Sip EXpress router"\
77 "(" VERSION " (" ARCH "/" OS"))"
78 #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
80 #define SERVER_HDR "Server: Sip EXpress router "\
81 "(" VERSION " (" ARCH "/" OS"))"
82 #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
84 #define MAX_WARNING_LEN 256
86 #define MY_BRANCH ";branch="
87 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
89 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
91 #define CRLF_LEN (sizeof(CRLF) - 1)
93 #define RECEIVED ";received="
94 #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
96 #define TRANSPORT_PARAM ";transport="
97 #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
99 #define TOTAG_TOKEN ";tag="
100 #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
102 #define RPORT ";rport="
103 #define RPORT_LEN (sizeof(RPORT) - 1)
105 #define ID_PARAM ";i="
106 #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
108 #define SRV_UDP_PREFIX "_sip._udp."
109 #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
111 #define SRV_TCP_PREFIX "_sip._tcp."
112 #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
114 #define SRV_TLS_PREFIX "_sips._tcp."
115 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
117 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
119 /*used only if PKG_MALLOC is defined*/
120 #define PKG_MEM_POOL_SIZE 1024*1024
122 /*used if SH_MEM is defined*/
123 #define SHM_MEM_SIZE 32
127 /* dimensioning buckets in q_malloc */
128 /* size of the size2bucket table; everything beyond that asks for
129 a variable-size kilo-bucket
131 #define MAX_FIXED_BLOCK 3072
132 /* distance of kilo-buckets */
133 #define BLOCK_STEP 512
134 /* maximum number of possible buckets */
135 #define MAX_BUCKET 15
137 /* receive buffer size -- preferably set low to
138 avoid terror of excessively huge messages; they are
141 #define BUF_SIZE 65535
143 /* forwarding -- Via buffer dimensioning */
144 #define MAX_VIA_LINE_SIZE 240
145 #define MAX_RECEIVED_SIZE 57
146 #define MAX_RPORT_SIZE 13
148 /* maximum number of branches per transaction */
149 #define MAX_BRANCHES 12
151 /* maximum length of a FIFO server command */
152 #define MAX_FIFO_COMMAND 512
154 /* buffer dimensions for FIFO server */
155 #define MAX_CONSUME_BUFFER 1024
156 /* where reply pipes may be opened */
157 #define DEFAULT_FIFO_DIR "/tmp/"
158 /* max length of the text of fifo 'print' command */
159 #define MAX_PRINT_TEXT 256
161 /* maximum length of Contact header field in redirection replies */
162 #define MAX_REDIRECTION_LEN 512
164 /* used by FIFO statistics in module to terminate line;
165 extra whitespaces are used to overwrite remainders of
166 previous line if longer than current one
168 #define CLEANUP_EOL " \n"
170 /* how patient is ser with FIFO clients not awaiting a reply?
173 #define FIFO_REPLY_RETRIES 4
174 #define FIFO_REPLY_WAIT 80000
176 /* magic cookie for transaction matching as defined in RFC3261 */
177 #define MCOOKIE "z9hG4bK"
178 #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
179 /* Maximum length of values appended to Via-branch parameter */
180 #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
181 MD5_LEN /* max(int2hex, MD5_LEN) */ \
182 + 1 /*sep*/ + 8 /*int2hex*/ + \
183 1 /*extra space, needed by t_calc_branch*/)
186 /* maximum path length */
187 #define PATH_MAX_GUESS 1024
189 #define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
190 #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
192 #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
193 #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
195 /* table holding versions of other ser tables */
196 #define VERSION_TABLE "version"
197 #define VERSION_COLUMN "table_version"
198 #define TABLENAME_COLUMN "table_name"
200 /* minimum packet size; smaller packets will be dropped silently */
201 #define MIN_UDP_PACKET 32