Advertisement
Guest User

kamailio.cfg

a guest
Sep 30th, 2011
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. ####### Defined Values #########
  2.  
  3. #!define MULTIDOMAIN 0
  4.  
  5. # - flags
  6. # FLT_ - per transaction (message) flags
  7. # FLB_ - per branch flags
  8. #!define FLT_ACC 1
  9. #!define FLT_ACCMISSED 2
  10. #!define FLT_ACCFAILED 3
  11. #!define FLT_NATS 5
  12.  
  13. #!define FLB_NATB 6
  14. #!define FLB_NATSIPPING 7
  15.  
  16. ####### Global Parameters #########
  17.  
  18. debug=2
  19. log_stderror=no
  20.  
  21. memdbg=5
  22. memlog=5
  23.  
  24. log_facility=LOG_LOCAL0
  25.  
  26. fork=yes
  27. children=4
  28.  
  29. /* port to listen to
  30. * - can be specified more than once if needed to listen on many ports */
  31. port=5060
  32.  
  33. ####### Modules Section ########
  34.  
  35. # set paths to location of modules
  36. mpath="/usr/local/lib64/kamailio/modules_k/:/usr/local/lib64/kamailio/modules/"
  37.  
  38. loadmodule "mi_fifo.so"
  39. loadmodule "kex.so"
  40. loadmodule "tm.so"
  41. loadmodule "tmx.so"
  42. loadmodule "sl.so"
  43. loadmodule "rr.so"
  44. loadmodule "pv.so"
  45. loadmodule "maxfwd.so"
  46. loadmodule "usrloc.so"
  47. loadmodule "registrar.so"
  48. loadmodule "textops.so"
  49. loadmodule "siputils.so"
  50. loadmodule "xlog.so"
  51. loadmodule "sanity.so"
  52. loadmodule "ctl.so"
  53. loadmodule "mi_rpc.so"
  54. loadmodule "acc.so"
  55. loadmodule "dispatcher.so"
  56.  
  57. # ----------------- setting module-specific parameters ---------------
  58.  
  59.  
  60. # ----- mi_fifo params -----
  61. modparam("mi_fifo", "fifo_name", "/tmp/kamailio_fifo")
  62.  
  63.  
  64. # ----- tm params -----
  65. # auto-discard branches from previous serial forking leg
  66. modparam("tm", "failure_reply_mode", 3)
  67. # default retransmission timeout: 30sec
  68. modparam("tm", "fr_timer", 30000)
  69. # default invite retransmission timeout after 1xx: 120sec
  70. modparam("tm", "fr_inv_timer", 120000)
  71.  
  72.  
  73. # ----- rr params -----
  74. # add value to ;lr param to cope with most of the UAs
  75. modparam("rr", "enable_full_lr", 1)
  76. # do not append from tag to the RR (no need for this script)
  77. modparam("rr", "append_fromtag", 0)
  78.  
  79.  
  80. # ----- registrar params -----
  81. modparam("registrar", "method_filtering", 1)
  82. /* uncomment the next line to disable parallel forking via location */
  83. # modparam("registrar", "append_branches", 0)
  84. /* uncomment the next line not to allow more than 10 contacts per AOR */
  85. #modparam("registrar", "max_contacts", 10)
  86.  
  87.  
  88. # ----- acc params -----
  89. /* what special events should be accounted ? */
  90. modparam("acc", "early_media", 0)
  91. modparam("acc", "report_ack", 0)
  92. modparam("acc", "report_cancels", 0)
  93. /* by default ww do not adjust the direct of the sequential requests.
  94. if you enable this parameter, be sure the enable "append_fromtag"
  95. in "rr" module */
  96. modparam("acc", "detect_direction", 0)
  97. /* account triggers (flags) */
  98. modparam("acc", "log_flag", FLT_ACC)
  99. modparam("acc", "log_missed_flag", FLT_ACCMISSED)
  100. modparam("acc", "log_extra",
  101. "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd")
  102. modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)
  103.  
  104.  
  105. # ----- dispatcher params -----
  106. modparam("dispatcher", "list_file", "/usr/local/etc/kamailio/dispatcher.list")
  107. modparam("dispatcher", "flags", 2)
  108. modparam("dispatcher", "dst_avp", "$avp(AVP_DST)")
  109. modparam("dispatcher", "grp_avp", "$avp(AVP_GRP)")
  110. modparam("dispatcher", "cnt_avp", "$avp(AVP_CNT)")
  111.  
  112. ####### Routing Logic ########
  113.  
  114.  
  115. # Main SIP request routing logic
  116. route {
  117. if ( !mf_process_maxfwd_header("10") )
  118. {
  119. sl_send_reply("483","To Many Hops");
  120. exit;
  121. }
  122.  
  123. # select from first dst group by round-robin
  124. if(!ds_select_dst("1", "4"))
  125. {
  126. sl_send_reply("500", "No destination available");
  127. exit;
  128. }
  129.  
  130. t_on_failure("RTF_DISPATCH");
  131. if(!t_relay())
  132. {
  133. sl_reply_error();
  134. exit;
  135. }
  136. }
  137.  
  138. # dispatcher failure routing block
  139. failure_route[RTF_DISPATCH] {
  140. if (t_is_canceled()) {
  141. exit;
  142. }
  143. # select next destination only for local timeout
  144. if (t_branch_timeout() && !t_branch_replied())
  145. {
  146. if(ds_next_dst())
  147. {
  148. t_on_failure("RTF_DISPATCH");
  149. t_relay();
  150. exit;
  151. }
  152. }
  153. }
  154.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement