sf.cfg 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. #
  2. # iptel.org real world configuration
  3. #
  4. # ----------- global configuration parameters ------------------------
  5. #debug=8 # debug level (cmd line: -dddddddddd)
  6. debug=3
  7. fork=no
  8. children=2
  9. #log_stderror=no # (cmd line: -E)
  10. log_stderror=yes # (cmd line: -E)
  11. check_via=yes # (cmd. line: -v)
  12. dns=no # (cmd. line: -r)
  13. rev_dns=no # (cmd. line: -R)
  14. port=5060
  15. #port=8060
  16. fifo="/tmp/ser_fifo"
  17. # advertise IP address in Via (as opposed to advertising DNS name
  18. # which is annoying for downstream servers and some phones can
  19. # not handle DNS at all)
  20. #listen=195.37.77.100
  21. #listen=127.0.0.1
  22. # ------------------ module loading ----------------------------------
  23. loadmodule "../sip_router/modules/sl/sl.so"
  24. loadmodule "../sip_router/modules/print/print.so"
  25. loadmodule "../sip_router/modules/tm/tm.so"
  26. loadmodule "../sip_router/modules/acc/acc.so"
  27. loadmodule "../sip_router/modules/rr/rr.so"
  28. loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
  29. loadmodule "../sip_router/modules/usrloc/usrloc.so"
  30. loadmodule "../sip_router/modules/registrar/registrar.so"
  31. # ----------------- setting module-specific parameters ---------------
  32. # -- usrloc params --
  33. # -- acc params --
  34. # report ACKs too for sake of completeness -- as we account PSTN
  35. # destinations which are RR, ACKs should show up
  36. modparam("acc", "report_ack", 1)
  37. # don't bother me with early media reports (I don't like 183
  38. # too much anyway...ever thought of timer C hitting after
  39. # listening to music-on-hold for five minutes?)
  40. modparam("acc", "early_media", 0)
  41. modparam("acc", "log_level", 1)
  42. # that is the flag for which we will account -- don't forget to
  43. # set the same one :-)
  44. modparam("acc", "acc_flag", 3 )
  45. # we are interested only in succesful transactions
  46. modparam("acc", "failed_transactions", 0 )
  47. modparam("acc", "missed_flag", 2 )
  48. # -- tm params --
  49. modparam("tm", "fr_timer", 103 )
  50. modparam("tm", "retr_timer1p1", 4 )
  51. modparam("tm", "fr_inv_timer", 4 )
  52. modparam("tm", "wt_timer", 8 )
  53. modparam("tm", "noisy_ctimer", 0 )
  54. # ------------------------- request routing logic -------------------
  55. # main routing logic
  56. route{
  57. # for testing purposes, simply okay all REGISTERs
  58. if (method=="REGISTER") {
  59. log("REGISTER");
  60. sl_send_reply("200", "ok");
  61. #t_replicate("localhost", "9");
  62. break;
  63. };
  64. if (!t_relay_to("fox.iptel.org", "12345" )) {
  65. sl_reply_error();
  66. };
  67. /* t_reply("100", "trying"); */
  68. break;
  69. #rewritehost("iptel.org");
  70. if (!t_relay()) {
  71. sl_reply_error();
  72. };
  73. break;
  74. # print a message if a call was missed
  75. setflag(2);
  76. rewriteuri("[email protected]");
  77. append_branch("[email protected]");
  78. append_branch("[email protected]");
  79. # forward( "fox.iptel.org", 9 );
  80. t_relay_to("bat.iptel.org", "5088");
  81. # t_relay();
  82. }
  83. route[3] {
  84. lookup("location");
  85. }
  86. reply_route[1] {
  87. # revert to original inbound uri -- good if we want
  88. # to modify it; if we rewrite it completely as in the
  89. # line after it, it is actually useless
  90. revert_uri();
  91. # this one will return 404 too
  92. rewriteuri("sip:[email protected]");
  93. append_branch();
  94. # and if we don't yet get a positive reply (we won't --
  95. # we will receive 404", try another forking destination
  96. t_on_negative("2");
  97. }
  98. reply_route[2] {
  99. revert_uri();
  100. rewriteuri("sip:[email protected]");
  101. # give it one more try; if it fails too (it will, there
  102. # is no foo), a lowest-code message will be relayed
  103. # upstream
  104. append_branch();
  105. }