config.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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 "/etc/ser/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 10 /* 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_LEN "Content-Length: 0"
  47. #define CONTENT_LEN_LEN 17
  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 SRV_PREFIX "_sip._udp."
  63. #define SRV_PREFIX_LEN 10
  64. /*used only if PKG_MALLOC is defined*/
  65. #define PKG_MEM_POOL_SIZE 1024*1024
  66. /*used if SH_MEM is defined*/
  67. #define SHM_MEM_SIZE 32
  68. #define TIMER_TICK 1
  69. /* dimensioning buckets in q_malloc */
  70. /* size of the size2bucket table; everything beyond that asks for
  71. a variable-size kilo-bucket
  72. */
  73. #define MAX_FIXED_BLOCK 3072
  74. /* distance of kilo-buckets */
  75. #define BLOCK_STEP 512
  76. /* maximum number of possible buckets */
  77. #define MAX_BUCKET 15
  78. /* receive buffer size -- preferably set low to
  79. avoid terror of excessively huge messages; they are
  80. useless anyway
  81. */
  82. #define BUF_SIZE 3040
  83. /* forwarding -- Via buffer dimensioning */
  84. #define MAX_VIA_LINE_SIZE 240
  85. #define MAX_RECEIVED_SIZE 57
  86. /* maximum number of branches per transaction */
  87. #define MAX_BRANCHES 4
  88. /* maximum length of a FIFO server command */
  89. #define MAX_FIFO_COMMAND 512
  90. /* buffer dimensions for FIFO server */
  91. #define MAX_CONSUME_BUFFER 1024
  92. /* where reply pipes may be opened */
  93. #define FIFO_DIR "/tmp/"
  94. #define FIFO_DIR_LEN 5
  95. /* max length of the text of fifo 'print' command */
  96. #define MAX_PRINT_TEXT 256
  97. /* maximum length of Contact heder field in redirection replies */
  98. #define MAX_REDIRECTION_LEN 512
  99. /* used by FIFO statistics in module to terminate line;
  100. extra whitespaces are used to overwrite remainders of
  101. previous line if longer than current one
  102. */
  103. #define CLEANUP_EOL " \n"
  104. /* how patient is ser with FIFO clients not awaiting a reply?
  105. 4 x 80ms = 0.32 sec
  106. */
  107. #define FIFO_REPLY_RETRIES 4
  108. #define FIFO_REPLY_WAIT 80000
  109. #endif