Advertisement
jock

opensips.cfg

Mar 27th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. # --- global parameters
  2. #
  3. debug=9
  4. fork=yes
  5. log_stderror=no
  6. log_facility=log_local7
  7. check_via=no
  8. #reply_to_via=no
  9. sip_warning=no
  10. children=10
  11. port=5060
  12. dns=no
  13. rev_dns=no
  14. disable_tcp=yes
  15.  
  16.  
  17. # --- load modules
  18. mpath="/usr/lib/opensips/modules/"
  19. loadmodule "sl.so"
  20. loadmodule "tm.so"
  21. loadmodule "rr.so"
  22. loadmodule "maxfwd.so"
  23. loadmodule "usrloc.so"
  24. loadmodule "registrar.so"
  25. loadmodule "textops.so"
  26. loadmodule "mi_fifo.so"
  27. loadmodule "db_text.so"
  28. loadmodule "nat_traversal.so"
  29. loadmodule "nathelper.so"
  30. loadmodule "signaling.so"
  31. loadmodule "uri.so"
  32. loadmodule "sipmsgops.so"
  33.  
  34. # --- module params
  35.  
  36. modparam("mi_fifo", "fifo_name", "/tmp/opensips_fifo")
  37.  
  38. modparam("db_text", "db_mode", 1)
  39.  
  40. modparam("rr", "enable_double_rr", 0)
  41.  
  42. modparam("tm", "wt_timer", 30)
  43. # this is the timer that determines how much should
  44. # wait before deciding that a dialer is down
  45. modparam("tm", "fr_timer", 3)
  46. modparam("tm", "fr_inv_timer", 120)
  47. modparam("tm", "disable_6xx_block", 1)
  48.  
  49. # request routing logic
  50. route
  51. {
  52. # xlog("L_INFO", "RECV: $rm, $fu, $ru\n");
  53.  
  54. # sanity checks
  55. if (!mf_process_maxfwd_header("10")) {
  56. sl_send_reply("483","Too Many Hops");
  57. exit;
  58. }
  59. if (msg:len >= max_len) {
  60. sl_send_reply("513", "Message too big");
  61. exit;
  62. }
  63.  
  64. # Only grab initial INVITEs
  65. if (is_method("INVITE") && !has_totag()) {
  66. record_route();
  67.  
  68. route(1);
  69. }
  70.  
  71. if (has_totag()) {
  72. # Anything else we should use the record-routing headers to handle
  73. if (loose_route()) {
  74. if (!t_relay()) {
  75. sl_reply_error();
  76. }
  77. exit;
  78. } else {
  79. if (is_method("ACK")) {
  80. if (t_check_trans()) {
  81. # non loose-route, but stateful ACK; must be an ACK after a 487 or poss. 404
  82. # from upstream server
  83. t_relay();
  84. exit;
  85. } else {
  86. # ACK without matching transaction - ignore and discard
  87. exit;
  88. }
  89. }
  90. sl_send_reply("404","Not here");
  91. }
  92. }
  93.  
  94. if (!t_relay()) {
  95. sl_reply_error();
  96. }
  97. }
  98.  
  99.  
  100. route[1] {
  101. rewritehost("Destination.Me.com");
  102.  
  103. # send it out now; use stateful forwarding as it works reliably
  104. # even for UDP2TCP
  105. if (!t_relay()) {
  106. sl_reply_error();
  107. }
  108. exit;
  109. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement