acc.cfg 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #
  2. # $Id$
  3. #
  4. # example: accounting calls to nummerical destinations
  5. #
  6. # ------------------ module loading ----------------------------------
  7. loadmodule "modules/tm/tm.so"
  8. loadmodule "modules/acc/acc.so"
  9. loadmodule "modules/sl/sl.so"
  10. loadmodule "modules/maxfwd/maxfwd.so"
  11. loadmodule "modules/rr/rr.so"
  12. # ----------------- setting module-specific parameters ---------------
  13. # -- acc params --
  14. # set the reporting log level
  15. modparam("acc", "log_level", 1)
  16. # number of flag, which will be used for accounting; if a message is
  17. # labeled with this flag, its completion status will be reported
  18. modparam("acc", "log_flag", 1 )
  19. # ------------------------- request routing logic -------------------
  20. # main routing logic
  21. route{
  22. /* ********* ROUTINE CHECKS ********************************** */
  23. # filter too old messages
  24. if (!mf_process_maxfwd_header("10")) {
  25. log("LOG: Too many hops\n");
  26. sl_send_reply("483","Too Many Hops");
  27. break;
  28. };
  29. if (len_gt( max_len )) {
  30. sl_send_reply("513", "Wow -- Message too large");
  31. break;
  32. };
  33. # Process record-routing
  34. if (loose_route()) { t_relay(); break; };
  35. # labeled all transaction for accounting
  36. setflag(1);
  37. # record-route INVITES to make sure BYEs will visit our server too
  38. if (method=="INVITE") record_route();
  39. # forward the request statefuly now; (we need *stateful* forwarding,
  40. # because the stateful mode correlates requests with replies and
  41. # drops retranmissions; otherwise, we would have to report on
  42. # every single message received)
  43. if (!t_relay()) {
  44. sl_reply_error();
  45. break;
  46. };
  47. }