config.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. #ifndef config_h
  28. #define config_h
  29. #include "types.h"
  30. /* default sip port if none specified */
  31. #define SIP_PORT 5060
  32. #define CFG_FILE CFG_DIR "ser.cfg"
  33. /* maximum number of addresses on which we will listen */
  34. #define MAX_LISTEN 16
  35. /* default number of child processes started */
  36. #define CHILD_NO 8
  37. #define RT_NO 10 /* routing tables number */
  38. #define REPLY_RT_NO 10 /* reply routing tables number */
  39. #define DEFAULT_RT 0 /* default routing table */
  40. #define MAX_REC_LEV 100 /* maximum number of recursive calls */
  41. #define ROUTE_MAX_REC_LEV 100 /* maximum number of recursive calls
  42. for route()*/
  43. #define MAX_URI_SIZE 1024 /* used when rewriting URIs */
  44. #define MY_VIA "Via: SIP/2.0/UDP "
  45. #define MY_VIA_LEN 17
  46. #define CONTENT_LENGTH "Content-Length: "
  47. #define CONTENT_LENGTH_LEN (sizeof(CONTENT_LENGTH)-1)
  48. #define USER_AGENT "User-Agent: Sip EXpress router"\
  49. "(" VERSION " (" ARCH "/" OS"))"
  50. #define USER_AGENT_LEN (sizeof(USER_AGENT)-1)
  51. #define SERVER_HDR "Server: Sip EXpress router "\
  52. "(" VERSION " (" ARCH "/" OS"))"
  53. #define SERVER_HDR_LEN (sizeof(SERVER_HDR)-1)
  54. #define MAX_WARNING_LEN 256
  55. #define MY_BRANCH ";branch="
  56. #define MY_BRANCH_LEN 8
  57. #define MAX_PORT_LEN 7 /* ':' + max 5 letters + \0 */
  58. #define CRLF "\r\n"
  59. #define CRLF_LEN 2
  60. #define RECEIVED ";received="
  61. #define RECEIVED_LEN 10
  62. #define TOTAG_TOKEN ";tag="
  63. #define TOTAG_TOKEN_LEN (sizeof(TOTAG_TOKEN)-1)
  64. #define SRV_PREFIX "_sip._udp."
  65. #define SRV_PREFIX_LEN 10
  66. /*used only if PKG_MALLOC is defined*/
  67. #define PKG_MEM_POOL_SIZE 1024*1024
  68. /*used if SH_MEM is defined*/
  69. #define SHM_MEM_SIZE 32
  70. #define TIMER_TICK 1
  71. /* dimensioning buckets in q_malloc */
  72. /* size of the size2bucket table; everything beyond that asks for
  73. a variable-size kilo-bucket
  74. */
  75. #define MAX_FIXED_BLOCK 3072
  76. /* distance of kilo-buckets */
  77. #define BLOCK_STEP 512
  78. /* maximum number of possible buckets */
  79. #define MAX_BUCKET 15
  80. /* receive buffer size -- preferably set low to
  81. avoid terror of excessively huge messages; they are
  82. useless anyway
  83. */
  84. #define BUF_SIZE 3040
  85. /* forwarding -- Via buffer dimensioning */
  86. #define MAX_VIA_LINE_SIZE 240
  87. #define MAX_RECEIVED_SIZE 57
  88. /* maximum number of branches per transaction */
  89. #define MAX_BRANCHES 4
  90. /* maximum length of a FIFO server command */
  91. #define MAX_FIFO_COMMAND 512
  92. /* buffer dimensions for FIFO server */
  93. #define MAX_CONSUME_BUFFER 1024
  94. /* where reply pipes may be opened */
  95. #define FIFO_DIR "/tmp/"
  96. #define FIFO_DIR_LEN 5
  97. /* max length of the text of fifo 'print' command */
  98. #define MAX_PRINT_TEXT 256
  99. /* maximum length of Contact heder field in redirection replies */
  100. #define MAX_REDIRECTION_LEN 512
  101. /* used by FIFO statistics in module to terminate line;
  102. extra whitespaces are used to overwrite remainders of
  103. previous line if longer than current one
  104. */
  105. #define CLEANUP_EOL " \n"
  106. /* how patient is ser with FIFO clients not awaiting a reply?
  107. 4 x 80ms = 0.32 sec
  108. */
  109. #define FIFO_REPLY_RETRIES 4
  110. #define FIFO_REPLY_WAIT 80000
  111. /* magic cookie for transaction matching as defined in RFC3261 */
  112. #define MCOOKIE "z9hG4bK"
  113. #define MCOOKIE_LEN (sizeof(MCOOKIE)-1)
  114. /* Maximum length of values appended to Via-branch parameter */
  115. #define MAX_BRANCH_PARAM_LEN (MCOOKIE_LEN+48)
  116. #endif