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)
43 /* default sip port if none specified */
45 #define SIPS_PORT 5061
47 #define CFG_FILE CFG_DIR "ser.cfg"
49 #define TLS_PKEY_FILE "cert.pem"
50 #define TLS_CERT_FILE "cert.pem"
51 #define TLS_CA_FILE 0 /* no CA list file by default */
54 /* maximum number of addresses on which we will listen */
57 /* default number of child processes started */
60 #define RT_NO 2 /* routing tables number */
61 #define FAILURE_RT_NO RT_NO /* on_failure routing tables number */
62 #define ONREPLY_RT_NO RT_NO /* on_reply routing tables number */
63 #define BRANCH_RT_NO RT_NO /* branch_route routing tables number */
64 #define ONSEND_RT_NO 1 /* onsend_route routing tables number */
65 #define DEFAULT_RT 0 /* default routing table */
67 #define MAX_REC_LEV 100 /* maximum number of recursive calls */
68 #define ROUTE_MAX_REC_LEV 100 /* maximum number of recursive calls
71 #define MAX_URI_SIZE 1024 /* used when rewriting URIs */
73 #define MY_VIA "Via: SIP/2.0/UDP "
74 #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
76 #define CONTENT_LENGTH "Content-Length: "
77 #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
79 #define USER_AGENT "User-Agent: Sip EXpress router"\
80 "(" VERSION " (" ARCH "/" OS_QUOTED "))"
81 #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
83 #define SERVER_HDR "Server: Sip EXpress router "\
84 "(" VERSION " (" ARCH "/" OS_QUOTED "))"
85 #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
87 #define MAX_WARNING_LEN 256
89 #define MY_BRANCH ";branch="
90 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
92 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
94 #define CRLF_LEN (sizeof(CRLF) - 1)
96 #define RECEIVED ";received="
97 #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
99 #define TRANSPORT_PARAM ";transport="
100 #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
102 #define COMP_PARAM ";comp="
103 #define COMP_PARAM_LEN (sizeof(COMP_PARAM)-1)
105 #define SIGCOMP_NAME "sigcomp"
106 #define SIGCOMP_NAME_LEN (sizeof(SIGCOMP_NAME)-1)
108 #define SERGZ_NAME "sergz"
109 #define SERGZ_NAME_LEN (sizeof(SERGZ_NAME)-1)
111 #define TOTAG_TOKEN ";tag="
112 #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
114 #define RPORT ";rport="
115 #define RPORT_LEN (sizeof(RPORT) - 1)
117 #define ID_PARAM ";i="
118 #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
120 #define SRV_UDP_PREFIX "_sip._udp."
121 #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
123 #define SRV_TCP_PREFIX "_sip._tcp."
124 #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
126 #define SRV_TLS_PREFIX "_sips._tcp."
127 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
129 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
131 /*used only if PKG_MALLOC is defined*/
132 #define PKG_MEM_POOL_SIZE 4*1024*1024
134 /*used if SH_MEM is defined*/
135 #define SHM_MEM_SIZE 32
138 /* dimensioning buckets in q_malloc */
139 /* size of the size2bucket table; everything beyond that asks for
140 a variable-size kilo-bucket
142 #define MAX_FIXED_BLOCK 3072
143 /* distance of kilo-buckets */
144 #define BLOCK_STEP 512
145 /* maximum number of possible buckets */
146 #define MAX_BUCKET 15
148 /* receive buffer size -- preferably set low to
149 avoid terror of excessively huge messages; they are
152 #define BUF_SIZE 65535
154 /* forwarding -- Via buffer dimensioning */
155 #define MAX_VIA_LINE_SIZE 240
156 #define MAX_RECEIVED_SIZE 57
157 #define MAX_RPORT_SIZE 13
159 /* maximum number of branches per transaction */
160 #define MAX_BRANCHES 12
162 /* max length of the text of fifo 'print' command */
163 #define MAX_PRINT_TEXT 256
165 /* maximum length of Contact header field in redirection replies */
166 #define MAX_REDIRECTION_LEN 512
168 /* used by FIFO statistics in module to terminate line;
169 extra whitespaces are used to overwrite remainders of
170 previous line if longer than current one
172 #define CLEANUP_EOL " \n"
174 /* magic cookie for transaction matching as defined in RFC3261 */
175 #define MCOOKIE "z9hG4bK"
176 #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
177 /* Maximum length of values appended to Via-branch parameter */
178 #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
179 MD5_LEN /* max(int2hex, MD5_LEN) */ \
180 + 1 /*sep*/ + 8 /*int2hex*/ + \
181 1 /*extra space, needed by t_calc_branch*/)
183 #define DEFAULT_SER_KILL_TIMEOUT 60 /* seconds */
185 /* maximum path length */
186 #define PATH_MAX_GUESS 1024
188 #define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
189 #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
191 #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
192 #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
194 /* table holding versions of other ser tables */
195 #define VERSION_TABLE "version"
196 #define VERSION_COLUMN "table_version"
197 #define TABLENAME_COLUMN "table_name"
199 /* minimum packet size; smaller packets will be dropped silently */
200 #define MIN_UDP_PACKET 32
202 #define MIN_SCTP_PACKET MIN_UDP_PACKET
204 #define DEFAULT_RADIUS_CONFIG "/usr/local/etc/radiusclient/radiusclient.conf"
206 #define DEFAULT_DID "_default"