serial_183.cfg 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # $Id$
  3. #
  4. # this example shows how to use forking on failure
  5. #
  6. log_stderror=1
  7. fork=no
  8. listen=192.168.2.16
  9. debug=3
  10. # ------------------ module loading ----------------------------------
  11. # Uncomment this if you want to use SQL database
  12. loadmodule "modules/tm/tm.so"
  13. loadmodule "modules/sl/sl.so"
  14. loadmodule "modules/maxfwd/maxfwd.so"
  15. # ------------------------- request routing logic -------------------
  16. # main routing logic
  17. route{
  18. # initial sanity checks -- messages with
  19. # max_forwards==0, or excessively long requests
  20. if (!mf_process_maxfwd_header("10")) {
  21. sl_send_reply("483","Too Many Hops");
  22. break;
  23. };
  24. if (len_gt( max_len )) {
  25. sl_send_reply("513", "Message too big");
  26. break;
  27. };
  28. /* skip register for testing purposes */
  29. if (method=="REGISTER") { sl_send_reply("200", "ok"); break; };
  30. if (!method=="ACK")
  31. log(1, "forwarding now to primary destination\n");
  32. if (method=="INVITE") {
  33. rewriteuri("sip:[email protected]:5064");
  34. # if transaction broken, try other an alternative
  35. # route
  36. t_on_failure("1");
  37. # if a provisional came, stop alternating
  38. t_on_reply("1");
  39. };
  40. t_relay();
  41. }
  42. failure_route[1] {
  43. log(1, "trying at alternate destination\n");
  44. append_branch("sip:[email protected]:5064");
  45. t_relay();
  46. }
  47. onreply_route[1] {
  48. log(1, "reply came in\n");
  49. if (status=~"18[0-9]") {
  50. log(1, "provisional -- resetting negative failure\n");
  51. t_on_failure("0");
  52. };
  53. }