config.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of SIP-router, a free SIP server.
  7. *
  8. * SIP-router 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
  12. *
  13. * SIP-router is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  21. *
  22. * History:
  23. * --------
  24. * 2003-04-05 DEFAULT_*_URL introduced (jiri)
  25. * 2003-07-04 fixed SRV lookup prefix for TLS/sips (andrei)
  26. * 2005-04-25 MAX_BRANCH_PARAM_LEN too small, fixed (andrei)
  27. *
  28. */
  29. /*!
  30. * \file
  31. * \brief SIP-router core :: Configuration options
  32. *
  33. * These settings are settable by the user before compilation
  34. *
  35. * \ingroup core
  36. * Module: \ref core
  37. */
  38. #ifndef config_h
  39. #define config_h
  40. #include "types.h"
  41. #define SIP_PORT 5060 /*!< default SIP port if none specified */
  42. #define SIPS_PORT 5061 /*!< default SIP port for TLS if none specified */
  43. #define CFG_FILE CFG_DIR NAME ".cfg"
  44. #define TLS_PKEY_FILE "cert.pem" /*!< The certificate private key file */
  45. #define TLS_CERT_FILE "cert.pem" /*!< The certificate file */
  46. #define TLS_CA_FILE 0 /*!< no CA list file by default */
  47. #define TLS_CRL_FILE 0 /*!< no CRL by default */
  48. #define MAX_LISTEN 16 /*!< maximum number of addresses on which we will listen */
  49. #define CHILD_NO 8 /*!< default number of child processes started */
  50. #define RT_NO 2 /*!< routing tables number */
  51. #define FAILURE_RT_NO RT_NO /*!< on_failure routing tables number */
  52. #define ONREPLY_RT_NO RT_NO /*!< on_reply routing tables number */
  53. #define BRANCH_RT_NO RT_NO /*!< branch_route routing tables number */
  54. #define ONSEND_RT_NO 1 /*!< onsend_route routing tables number */
  55. #define EVENT_RT_NO RT_NO /*!< event_route routing tables number */
  56. #define DEFAULT_RT 0 /*!< default routing table */
  57. #define MAX_URI_SIZE 1024 /*!< Max URI size used when rewriting URIs */
  58. #define MAX_PATH_SIZE 256 /*!< Maximum length of path header buffer */
  59. #define MAX_INSTANCE_SIZE 256 /*!< Maximum length of +sip.instance contact header param value buffer */
  60. #define MAX_RUID_SIZE 65 /*!< Maximum length of ruid for location records */
  61. #define MAX_UA_SIZE 255 /*!< Maximum length of user-agent for location records */
  62. #define MY_VIA "Via: SIP/2.0/UDP "
  63. #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
  64. #define ROUTE_PREFIX "Route: "
  65. #define ROUTE_PREFIX_LEN (sizeof(ROUTE_PREFIX) - 1)
  66. #define ROUTE_SEPARATOR ", "
  67. #define ROUTE_SEPARATOR_LEN (sizeof(ROUTE_SEPARATOR) - 1)
  68. #define CONTENT_LENGTH "Content-Length: "
  69. #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
  70. #define USER_AGENT "User-Agent: " NAME \
  71. " (" VERSION " (" ARCH "/" OS_QUOTED "))"
  72. #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
  73. #define SERVER_HDR "Server: " NAME \
  74. " (" VERSION " (" ARCH "/" OS_QUOTED "))"
  75. #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
  76. #define MAX_WARNING_LEN 256
  77. #define MY_BRANCH ";branch="
  78. #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
  79. #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
  80. #define CRLF "\r\n"
  81. #define CRLF_LEN (sizeof(CRLF) - 1)
  82. #define RECEIVED ";received="
  83. #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
  84. #define TRANSPORT_PARAM ";transport="
  85. #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
  86. #define COMP_PARAM ";comp="
  87. #define COMP_PARAM_LEN (sizeof(COMP_PARAM)-1)
  88. #define SIGCOMP_NAME "sigcomp"
  89. #define SIGCOMP_NAME_LEN (sizeof(SIGCOMP_NAME)-1)
  90. #define SERGZ_NAME "sergz"
  91. #define SERGZ_NAME_LEN (sizeof(SERGZ_NAME)-1)
  92. #define TOTAG_TOKEN ";tag="
  93. #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
  94. #define RPORT ";rport="
  95. #define RPORT_LEN (sizeof(RPORT) - 1)
  96. #define ID_PARAM ";i="
  97. #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
  98. #define SRV_UDP_PREFIX "_sip._udp."
  99. #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
  100. #define SRV_TCP_PREFIX "_sip._tcp."
  101. #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
  102. #define SRV_TLS_PREFIX "_sips._tcp."
  103. #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
  104. #define SRV_SCTP_PREFIX "_sip._sctp."
  105. #define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
  106. #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
  107. #ifndef PKG_MEM_SIZE
  108. #define PKG_MEM_SIZE 8
  109. #endif
  110. #define PKG_MEM_POOL_SIZE PKG_MEM_SIZE*1024*1024 /*!< used only if PKG_MALLOC is defined*/
  111. #define SHM_MEM_SIZE 64 /*!< used if SH_MEM is defined*/
  112. /* dimensioning buckets in q_malloc */
  113. /*! \brief size of the size2bucket table; everything beyond that asks for
  114. a variable-size kilo-bucket
  115. */
  116. #define MAX_FIXED_BLOCK 3072
  117. #define BLOCK_STEP 512 /*!< distance of kilo-buckets */
  118. #define MAX_BUCKET 15 /*!< maximum number of possible buckets */
  119. /*! \brief receive buffer size -- preferably set low to
  120. avoid terror of excessively huge messages; they are
  121. useless anyway
  122. */
  123. #define BUF_SIZE 65535
  124. #define MAX_VIA_LINE_SIZE 240 /*!< forwarding -- Via buffer dimensioning */
  125. #define MAX_RECEIVED_SIZE 59 /*!< forwarding -- Via buffer dimensioning - Received header */
  126. #define MAX_RPORT_SIZE 13 /*!< forwarding -- Via buffer dimensioning - Rport */
  127. #define MAX_BRANCHES 12 /*!< maximum number of branches per transaction */
  128. #define MAX_PRINT_TEXT 256 /*!< max length of the text of fifo 'print' command */
  129. #define MAX_REDIRECTION_LEN 512 /*!< maximum length of Contact header field in redirection replies */
  130. /*! \brief used by FIFO statistics in module to terminate line;
  131. extra whitespaces are used to overwrite remainders of
  132. previous line if longer than current one
  133. */
  134. #define CLEANUP_EOL " \n"
  135. #define MCOOKIE "z9hG4bK" /*!< magic cookie for transaction matching as defined in RFC3261 */
  136. #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
  137. /*! \brief Maximum length of values appended to Via-branch parameter */
  138. #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
  139. MD5_LEN /* max(int2hex, MD5_LEN) */ \
  140. + 1 /*sep*/ + 8 /*int2hex*/ + \
  141. 1 /*extra space, needed by t_calc_branch*/)
  142. #define DEFAULT_SER_KILL_TIMEOUT 60 /*!< Kill timeout : seconds */
  143. #define PATH_MAX_GUESS 1024 /*!< maximum path length */
  144. #if defined KAMAILIO_MOD_INTERFACE || defined OPENSER_MOD_INTERFACE || \
  145. defined MOD_INTERFACE_V1
  146. #define DEFAULT_DB_URL "mysql://kamailio:kamailiorw@localhost/kamailio"
  147. #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
  148. #define DEFAULT_RODB_URL "mysql://kamailioro:kamailioro@localhost/kamailio"
  149. #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
  150. #else
  151. #define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
  152. #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
  153. #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
  154. #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
  155. #endif
  156. #define VERSION_TABLE "version" /*!< table holding versions of other ser tables */
  157. #define VERSION_TABLE_LEN (sizeof(VERSION_TABLE) - 1)
  158. #define VERSION_COLUMN "table_version" /*!< Column holding version number in version table */
  159. #define TABLENAME_COLUMN "table_name" /*!< Column holding module name in version table */
  160. #define MIN_UDP_PACKET 32 /*!< minimum UDP packet size; smaller packets will be dropped silently */
  161. #define MIN_SCTP_PACKET MIN_UDP_PACKET /*!< minimum size of SCTP packet */
  162. #define DEFAULT_RADIUS_CONFIG "/usr/local/etc/radiusclient/radiusclient.conf" /*!< Default FreeRadius configuration file */
  163. #define DEFAULT_DID "_default"
  164. #define DEFAULT_MAX_WHILE_LOOPS 100 /*!< Maximum allowed iterations for a while (to catch runaways) */
  165. #endif