onr.cfg 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #
  2. # $Id$
  3. #
  4. # example script showing both types of forking;
  5. # incoming message is forked in parallel to
  6. # 'nobody' and 'parallel', if no positive reply
  7. # appears with final_response timer, nonsense
  8. # is retried (serial forking); than, destination
  9. # 'foo' is given last chance
  10. # ------------------ module loading ----------------------------------
  11. loadmodule "modules/sl/sl.so"
  12. loadmodule "modules/tm/tm.so"
  13. # ----------------- setting module-specific parameters ---------------
  14. # -- tm params --
  15. # set time for which ser will be waiting for a final response;
  16. # fr_inv_timer sets value for INVITE transactions, fr_timer
  17. # for all others
  18. modparam("tm", "fr_inv_timer", 15 )
  19. modparam("tm", "fr_timer", 10 )
  20. # ------------------------- request routing logic -------------------
  21. # main routing logic
  22. route{
  23. # for testing purposes, simply okay all REGISTERs
  24. if (method=="REGISTER") {
  25. log("REGISTER");
  26. sl_send_reply("200", "ok");
  27. break;
  28. };
  29. # try these two destinations first in parallel; the second
  30. # destination is targeted to sink port -- that will make ser
  31. # wait until timer hits
  32. seturi("sip:[email protected]");
  33. append_branch("sip:[email protected]:9");
  34. # if we do not get a positive reply, continue at reply_route[1]
  35. t_on_failure("1");
  36. # forward the request to all destinations in destination set now
  37. t_relay();
  38. }
  39. failure_route[1] {
  40. # forwarding failed -- try again at another destination
  41. append_branch("sip:[email protected]");
  42. log(1,"first redirection\n");
  43. # if this alternative destination fails too, proceed to reply_route[2]
  44. t_on_failure("2");
  45. t_relay();
  46. }
  47. failure_route[2] {
  48. # try out the last resort destination
  49. append_branch("sip:[email protected]");
  50. log(1, "second redirection\n");
  51. # we no more call t_on_negative here; if this destination
  52. # fails too, transaction will complete
  53. t_relay();
  54. }