config.h
e60a9728
 /*
4bd1673d
  *  $Id$
7dd0b342
  *
53c7e0f1
  * Copyright (C) 2001-2003 FhG Fokus
7dd0b342
  *
5a03489e
  * This file is part of SIP-router, a free SIP server.
7dd0b342
  *
5a03489e
  * SIP-router is free software; you can redistribute it and/or modify
7dd0b342
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version
  *
5a03489e
  * SIP-router is distributed in the hope that it will be useful,
7dd0b342
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License 
  * along with this program; if not, write to the Free Software 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
c7489e45
  *
  * History:
  * --------
5b9386d1
  * 2003-04-05  DEFAULT_*_URL introduced (jiri)
  * 2003-07-04  fixed SRV lookup prefix for TLS/sips (andrei)
e2f01751
  * 2005-04-25  MAX_BRANCH_PARAM_LEN too small, fixed (andrei)
  *
e60a9728
  */
 
5a03489e
 /*!
  * \file
  * \brief SIP-router core :: Configuration options
  *
  * These settings are settable by the user before compilation
  *
  * \ingroup core
  * Module: \ref core
  */
e60a9728
 
 
7dd0b342
 
e60a9728
 #ifndef config_h
 #define config_h
 
4bd1673d
 #include "types.h"
 
5a03489e
 #define SIP_PORT  5060 /*!< default SIP port if none specified */
 #define SIPS_PORT 5061 /*!< default SIP port for TLS if none specified */
e60a9728
 
4c969ea9
 #define CFG_FILE CFG_DIR NAME ".cfg"
e60a9728
 
5a03489e
 #define TLS_PKEY_FILE "cert.pem" 	/*!< The certificate private key file */
 #define TLS_CERT_FILE "cert.pem"	/*!< The certificate file */
 #define TLS_CA_FILE 0			/*!< no CA list file by default */
f22b996b
 
e60a9728
 
5a03489e
 #define MAX_LISTEN 16			/*!< maximum number of addresses on which we will listen */
1b1b19d8
 
5a03489e
 #define CHILD_NO    8			/*!< default number of child processes started */
1b1b19d8
 
5a03489e
 #define RT_NO 2 			/*!< routing tables number */
 #define FAILURE_RT_NO RT_NO 		/*!< on_failure routing tables number */
 #define ONREPLY_RT_NO RT_NO 		/*!< on_reply routing tables number */
 #define BRANCH_RT_NO RT_NO 		/*!< branch_route routing tables number */
 #define ONSEND_RT_NO 1  		/*!< onsend_route routing tables number */
 #define EVENT_RT_NO RT_NO 		/*!< event_route routing tables number */
 #define DEFAULT_RT 0 			/*!< default routing table */
a15c363f
 
5a03489e
 #define MAX_REC_LEV 100 		/*!< maximum number of recursive calls */
 #define ROUTE_MAX_REC_LEV 100 		/*!< maximum number of recursive calls for route()*/
a15c363f
 
5a03489e
 #define MAX_URI_SIZE 1024		/*!< Max URI size used when rewriting URIs */
7268726e
 
5a03489e
 #define MAX_PATH_SIZE 256 		/*!< Maximum length of path header buffer */
c5c2bcd6
 
b2e71d5b
 #define MY_VIA "Via: SIP/2.0/UDP "
6f451254
 #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
b2e71d5b
 
c7116226
 #define ROUTE_PREFIX "Route: "
 #define ROUTE_PREFIX_LEN (sizeof(ROUTE_PREFIX) - 1)
 
 #define ROUTE_SEPARATOR ", "
 #define ROUTE_SEPARATOR_LEN (sizeof(ROUTE_SEPARATOR) - 1)
 
82802743
 #define CONTENT_LENGTH "Content-Length: "
 #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
af64f4fb
 
7d33b809
 #define USER_AGENT "User-Agent: SIP Router "\
bc404f2b
 		"(" VERSION " (" ARCH "/" OS_QUOTED "))"
5e39b907
 #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
5655ca6f
 
7d33b809
 #define SERVER_HDR "Server: SIP Router "\
bc404f2b
 		"(" VERSION " (" ARCH "/" OS_QUOTED "))"
5e39b907
 #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
 
 #define MAX_WARNING_LEN  256
 		
caf80ae6
 #define MY_BRANCH ";branch="
6f451254
 #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
b2e71d5b
 
 #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
 #define CRLF "\r\n"
6f451254
 #define CRLF_LEN (sizeof(CRLF) - 1)
b2e71d5b
 
c55adae8
 #define RECEIVED        ";received="
6f451254
 #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
b2e71d5b
 
c55adae8
 #define TRANSPORT_PARAM ";transport="
6f451254
 #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
c55adae8
 
7a068ff3
 #define COMP_PARAM ";comp="
 #define COMP_PARAM_LEN (sizeof(COMP_PARAM)-1)
 
 #define SIGCOMP_NAME "sigcomp"
 #define SIGCOMP_NAME_LEN (sizeof(SIGCOMP_NAME)-1)
 
 #define SERGZ_NAME "sergz"
 #define SERGZ_NAME_LEN (sizeof(SERGZ_NAME)-1)
 
2c60a4c3
 #define TOTAG_TOKEN ";tag="
 #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
814bd485
 
09f7cd2c
 #define RPORT ";rport="
6f451254
 #define RPORT_LEN (sizeof(RPORT) - 1)
09f7cd2c
 
e1e6c914
 #define ID_PARAM ";i="
6f451254
 #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
e1e6c914
 
d531a5d5
 #define SRV_UDP_PREFIX "_sip._udp."
6f451254
 #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
 
d531a5d5
 #define SRV_TCP_PREFIX "_sip._tcp."
6f451254
 #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
 
5b9386d1
 #define SRV_TLS_PREFIX "_sips._tcp."
6f451254
 #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
 
887ca995
 #define SRV_SCTP_PREFIX "_sip._sctp."
 #define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
 
6f451254
 #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
1b71270a
 
5a03489e
 #define PKG_MEM_POOL_SIZE 4*1024*1024		/*!< used only if PKG_MALLOC is defined*/
22d4aa5d
 
5a03489e
 #define SHM_MEM_SIZE 32				/*!< used if SH_MEM is defined*/
628e3a5a
 
cd57180a
 
dda9dab1
 /* dimensioning buckets in q_malloc */
5a03489e
 /*! \brief size of the size2bucket table; everything beyond that asks for
dda9dab1
    a variable-size kilo-bucket
  */
 #define MAX_FIXED_BLOCK         3072
5a03489e
 #define BLOCK_STEP              512		/*!< distance of kilo-buckets */
 #define MAX_BUCKET		15		/*!< maximum number of possible buckets */
dda9dab1
 
5a03489e
 /*! \brief receive buffer size -- preferably set low to
4bd1673d
    avoid terror of excessively huge messages; they are
    useless anyway
dda9dab1
 */
bbed656b
 #define BUF_SIZE 65535
dda9dab1
 
5a03489e
 #define MAX_VIA_LINE_SIZE	240	/*!< forwarding  -- Via buffer dimensioning */
 #define MAX_RECEIVED_SIZE	57	/*!< forwarding  -- Via buffer dimensioning - Received header */
 #define MAX_RPORT_SIZE		13	/*!< forwarding  -- Via buffer dimensioning - Rport */
b2e71d5b
 
5a03489e
 #define MAX_BRANCHES    	12	/*!< maximum number of branches per transaction */
4bd1673d
 
5a03489e
 #define MAX_PRINT_TEXT 		256	/*!< max length of the text of fifo 'print' command */
fcefd3f4
 
5a03489e
 #define MAX_REDIRECTION_LEN	512	/*!< maximum length of Contact header field in redirection replies */
cafca31b
 
5a03489e
 /*! \brief used by FIFO statistics in module to terminate line;
cafca31b
    extra whitespaces are used to overwrite remainders of
    previous line if longer than current one
 */
 #define CLEANUP_EOL "      \n"
 
5a03489e
 #define MCOOKIE "z9hG4bK"		/*!< magic cookie for transaction matching as defined in RFC3261 */
7958eeae
 #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
5a03489e
 /*! \brief Maximum length of values appended to Via-branch parameter */
e2f01751
 #define MAX_BRANCH_PARAM_LEN  (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
33d814e0
 								MD5_LEN /* max(int2hex, MD5_LEN) */ \
 								+ 1 /*sep*/ + 8 /*int2hex*/ + \
e2f01751
 								1 /*extra space, needed by t_calc_branch*/)
 
5a03489e
 #define DEFAULT_SER_KILL_TIMEOUT 60 	/*!< Kill timeout : seconds */
7958eeae
 
5a03489e
 #define PATH_MAX_GUESS	1024		/*!< maximum path length */
049f64c2
 
146264f9
 #ifdef OPENSER_MOD_INTERFACE
 	#define DEFAULT_DB_URL "mysql://openser:openserrw@localhost/openser"
 	#define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
 	#define DEFAULT_RODB_URL "mysql://openserro:openserro@localhost/openser"
 	#define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
 #else
 	#define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
 	#define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
 	#define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
 	#define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
 #endif
7ec3af47
 
5a03489e
 #define VERSION_TABLE "version"			/*!< table holding versions of other ser tables */
 #define VERSION_COLUMN "table_version"		/*!< Column holding version number in version table */
 #define TABLENAME_COLUMN "table_name"		/*!< Column holding module name in version table */
c7489e45
 
5a03489e
 #define MIN_UDP_PACKET        32		/*!< minimum UDP packet size; smaller packets will be dropped silently */
32d5444c
 
5a03489e
 #define MIN_SCTP_PACKET  MIN_UDP_PACKET 	/*!< minimum size of SCTP packet */
ed990c31
 
5a03489e
 #define DEFAULT_RADIUS_CONFIG "/usr/local/etc/radiusclient/radiusclient.conf"	/*!< Default FreeRadius configuration file */
049f64c2
 
cbef671c
 #define DEFAULT_DID "_default"
 
5a03489e
 #define DEFAULT_MAX_WHILE_LOOPS 100		/*!< Maximum allowed iterations for a while (to catch runaways) */
dfda974c
 
e60a9728
 #endif