Advertisement
Guest User

kamailio.cfg

a guest
Oct 5th, 2011
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.79 KB | None | 0 0
  1. ####### Global Parameters #########
  2.  
  3. debug=2
  4. log_stderror=no
  5.  
  6. memdbg=5
  7. memlog=5
  8.  
  9. log_facility=LOG_LOCAL0
  10.  
  11. fork=yes
  12. children=4
  13.  
  14. port=5060
  15.  
  16. ####### Modules Section ########
  17.  
  18. # set paths to location of modules
  19. mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
  20.  
  21. loadmodule "tm.so"
  22. loadmodule "sl.so"
  23. loadmodule "pv.so"
  24. loadmodule "maxfwd.so"
  25. loadmodule "dispatcher.so"
  26.  
  27. # ----------------- setting module-specific parameters ---------------
  28.  
  29. # ----- tm params -----
  30. # auto-discard branches from previous serial forking leg
  31. modparam("tm", "failure_reply_mode", 3)
  32. # default retransmission timeout: 30sec
  33. modparam("tm", "fr_timer", 30000)
  34. # default invite retransmission timeout after 1xx: 120sec
  35. modparam("tm", "fr_inv_timer", 120000)
  36.  
  37. # ----- dispatcher params -----
  38. modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")
  39. modparam("dispatcher", "flags", 2)
  40. modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
  41. modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
  42. modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
  43.  
  44. ####### Routing Logic ########
  45.  
  46. # Main SIP request routing logic
  47. route {
  48. if ( !mf_process_maxfwd_header("10") )
  49. {
  50. sl_send_reply("483","To Many Hops");
  51. exit;
  52. }
  53.  
  54. # select from first dst group by round-robin
  55. if(!ds_select_dst("1", "4"))
  56. {
  57. sl_send_reply("500", "No destination available");
  58. exit;
  59. }
  60.  
  61. t_on_failure("RTF_DISPATCH");
  62. if(!t_relay())
  63. {
  64. sl_reply_error();
  65. exit;
  66. }
  67. }
  68.  
  69. # dispatcher failure routing block
  70. failure_route[RTF_DISPATCH] {
  71. if (t_is_canceled()) {
  72. exit;
  73. }
  74. # select next destination only for local timeout
  75. if (t_branch_timeout() && !t_branch_replied())
  76. {
  77. if(ds_next_dst())
  78. {
  79. t_on_failure("RTF_DISPATCH");
  80. t_relay();
  81. exit;
  82. }
  83. }
  84. }
  85.  
  86.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement