config.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. /*
  2. * $Id$
  3. *
  4. * Copyright (C) 2001-2003 FhG Fokus
  5. *
  6. * This file is part of ser, a free SIP server.
  7. *
  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
  12. *
  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:
  16. * [email protected]
  17. *
  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.
  22. *
  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
  26. *
  27. * History:
  28. * --------
  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)
  32. *
  33. */
  34. #ifndef config_h
  35. #define config_h
  36. #include "types.h"
  37. /* default sip port if none specified */
  38. #define SIP_PORT 5060
  39. #define SIPS_PORT 5061
  40. #define CFG_FILE CFG_DIR "ser.cfg"
  41. #define TLS_PKEY_FILE "cert.pem"
  42. #define TLS_CERT_FILE "cert.pem"
  43. #define TLS_CA_FILE 0 /* no CA list file by default */
  44. /* maximum number of addresses on which we will listen */
  45. #define MAX_LISTEN 16
  46. /* default number of child processes started */
  47. #define CHILD_NO 8
  48. #define RT_NO 2 /* routing tables number */
  49. #define FAILURE_RT_NO RT_NO /* on_failure routing tables number */
  50. #define ONREPLY_RT_NO RT_NO /* on_reply routing tables number */
  51. #define BRANCH_RT_NO RT_NO /* branch_route routing tables number */
  52. #define ONSEND_RT_NO 1 /* onsend_route routing tables number */
  53. #define DEFAULT_RT 0 /* default routing table */
  54. #define MAX_REC_LEV 100 /* maximum number of recursive calls */
  55. #define ROUTE_MAX_REC_LEV 100 /* maximum number of recursive calls
  56. for route()*/
  57. #define MAX_URI_SIZE 1024 /* used when rewriting URIs */
  58. #define MY_VIA "Via: SIP/2.0/UDP "
  59. #define MY_VIA_LEN (sizeof(MY_VIA) - 1)
  60. #define ROUTE_PREFIX "Route: "
  61. #define ROUTE_PREFIX_LEN (sizeof(ROUTE_PREFIX) - 1)
  62. #define ROUTE_SEPARATOR ", "
  63. #define ROUTE_SEPARATOR_LEN (sizeof(ROUTE_SEPARATOR) - 1)
  64. #define CONTENT_LENGTH "Content-Length: "
  65. #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
  66. #define USER_AGENT "User-Agent: Sip EXpress router"\
  67. "(" VERSION " (" ARCH "/" OS_QUOTED "))"
  68. #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
  69. #define SERVER_HDR "Server: Sip EXpress router "\
  70. "(" VERSION " (" ARCH "/" OS_QUOTED "))"
  71. #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
  72. #define MAX_WARNING_LEN 256
  73. #define MY_BRANCH ";branch="
  74. #define MY_BRANCH_LEN (sizeof(MY_BRANCH) - 1)
  75. #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
  76. #define CRLF "\r\n"
  77. #define CRLF_LEN (sizeof(CRLF) - 1)
  78. #define RECEIVED ";received="
  79. #define RECEIVED_LEN (sizeof(RECEIVED) - 1)
  80. #define TRANSPORT_PARAM ";transport="
  81. #define TRANSPORT_PARAM_LEN (sizeof(TRANSPORT_PARAM) - 1)
  82. #define COMP_PARAM ";comp="
  83. #define COMP_PARAM_LEN (sizeof(COMP_PARAM)-1)
  84. #define SIGCOMP_NAME "sigcomp"
  85. #define SIGCOMP_NAME_LEN (sizeof(SIGCOMP_NAME)-1)
  86. #define SERGZ_NAME "sergz"
  87. #define SERGZ_NAME_LEN (sizeof(SERGZ_NAME)-1)
  88. #define TOTAG_TOKEN ";tag="
  89. #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
  90. #define RPORT ";rport="
  91. #define RPORT_LEN (sizeof(RPORT) - 1)
  92. #define ID_PARAM ";i="
  93. #define ID_PARAM_LEN (sizeof(ID_PARAM) - 1)
  94. #define SRV_UDP_PREFIX "_sip._udp."
  95. #define SRV_UDP_PREFIX_LEN (sizeof(SRV_UDP_PREFIX) - 1)
  96. #define SRV_TCP_PREFIX "_sip._tcp."
  97. #define SRV_TCP_PREFIX_LEN (sizeof(SRV_TCP_PREFIX) - 1)
  98. #define SRV_TLS_PREFIX "_sips._tcp."
  99. #define SRV_TLS_PREFIX_LEN (sizeof(SRV_TLS_PREFIX) - 1)
  100. #define SRV_SCTP_PREFIX "_sip._sctp."
  101. #define SRV_SCTP_PREFIX_LEN (sizeof(SRV_SCTP_PREFIX) - 1)
  102. #define SRV_MAX_PREFIX_LEN SRV_TLS_PREFIX_LEN
  103. /*used only if PKG_MALLOC is defined*/
  104. #define PKG_MEM_POOL_SIZE 4*1024*1024
  105. /*used if SH_MEM is defined*/
  106. #define SHM_MEM_SIZE 32
  107. /* dimensioning buckets in q_malloc */
  108. /* size of the size2bucket table; everything beyond that asks for
  109. a variable-size kilo-bucket
  110. */
  111. #define MAX_FIXED_BLOCK 3072
  112. /* distance of kilo-buckets */
  113. #define BLOCK_STEP 512
  114. /* maximum number of possible buckets */
  115. #define MAX_BUCKET 15
  116. /* receive buffer size -- preferably set low to
  117. avoid terror of excessively huge messages; they are
  118. useless anyway
  119. */
  120. #define BUF_SIZE 65535
  121. /* forwarding -- Via buffer dimensioning */
  122. #define MAX_VIA_LINE_SIZE 240
  123. #define MAX_RECEIVED_SIZE 57
  124. #define MAX_RPORT_SIZE 13
  125. /* maximum number of branches per transaction */
  126. #define MAX_BRANCHES 12
  127. /* max length of the text of fifo 'print' command */
  128. #define MAX_PRINT_TEXT 256
  129. /* maximum length of Contact header field in redirection replies */
  130. #define MAX_REDIRECTION_LEN 512
  131. /* used by FIFO statistics in module to terminate line;
  132. extra whitespaces are used to overwrite remainders of
  133. previous line if longer than current one
  134. */
  135. #define CLEANUP_EOL " \n"
  136. /* magic cookie for transaction matching as defined in RFC3261 */
  137. #define MCOOKIE "z9hG4bK"
  138. #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
  139. /* Maximum length of values appended to Via-branch parameter */
  140. #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+8 /*int2hex*/ + 1 /*sep*/ + \
  141. MD5_LEN /* max(int2hex, MD5_LEN) */ \
  142. + 1 /*sep*/ + 8 /*int2hex*/ + \
  143. 1 /*extra space, needed by t_calc_branch*/)
  144. #define DEFAULT_SER_KILL_TIMEOUT 60 /* seconds */
  145. /* maximum path length */
  146. #define PATH_MAX_GUESS 1024
  147. #define DEFAULT_DB_URL "mysql://ser:heslo@localhost/ser"
  148. #define DEFAULT_DB_URL_LEN (sizeof(DEFAULT_DB_URL) - 1)
  149. #define DEFAULT_RODB_URL "mysql://serro:47serro11@localhost/ser"
  150. #define DEFAULT_RODB_URL_LEN (sizeof(DEFAULT_RODB_URL) - 1)
  151. /* table holding versions of other ser tables */
  152. #define VERSION_TABLE "version"
  153. #define VERSION_COLUMN "table_version"
  154. #define TABLENAME_COLUMN "table_name"
  155. /* minimum packet size; smaller packets will be dropped silently */
  156. #define MIN_UDP_PACKET 32
  157. #define MIN_SCTP_PACKET MIN_UDP_PACKET
  158. #define DEFAULT_RADIUS_CONFIG "/usr/local/etc/radiusclient/radiusclient.conf"
  159. #define DEFAULT_DID "_default"
  160. #endif