dbtext.cfg 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. #
  2. # $Id$
  3. #
  4. # simple quick-start config script
  5. #
  6. # ----------- global configuration parameters ------------------------
  7. debug=3 # debug level (cmd line: -dddddddddd)
  8. fork=yes
  9. log_stderror=no # (cmd line: -E)
  10. /*
  11. debug=7
  12. fork=no
  13. log_stderror=yes
  14. */
  15. check_via=no # (cmd. line: -v)
  16. dns=no # (cmd. line: -r)
  17. rev_dns=no # (cmd. line: -R)
  18. port=5060
  19. children=4
  20. fifo="/tmp/sip-router_fifo"
  21. # ------------------ module loading ----------------------------------
  22. # Uncomment this if you want to use SQL database
  23. loadmodule "./modules/dbtext/dbtext.so"
  24. loadmodule "./modules/sl/sl.so"
  25. loadmodule "./modules/tm/tm.so"
  26. loadmodule "./modules/rr/rr.so"
  27. loadmodule "./modules/maxfwd/maxfwd.so"
  28. loadmodule "./modules/usrloc/usrloc.so"
  29. loadmodule "./modules/registrar/registrar.so"
  30. # Uncomment this if you want digest authentication
  31. # mysql.so must be loaded !
  32. loadmodule "./modules/auth/auth.so"
  33. loadmodule "./modules/auth_db/auth_db.so"
  34. # ----------------- setting module-specific parameters ---------------
  35. # -- usrloc params --
  36. #modparam("usrloc", "db_mode", 0)
  37. # Uncomment this if you want to use SQL database
  38. # for persistent storage and comment the previous line
  39. modparam("usrloc", "db_mode", 1)
  40. modparam("usrloc", "db_url", "/home/janakj/sip-router")
  41. modparam("auth_db", "db_url", "/home/janakj/sip-router")
  42. # -- auth params --
  43. # Uncomment if you are using auth module
  44. #
  45. modparam("auth_db", "calculate_ha1", yes)
  46. #
  47. # If you set "calculate_ha1" parameter to yes (which true in this config),
  48. # uncomment also the following parameter)
  49. #
  50. modparam("auth_db", "plain_password_column", "password")
  51. # ------------------------- request routing logic -------------------
  52. # main routing logic
  53. route{
  54. # initial sanity checks -- messages with
  55. # max_forwards==0, or excessively long requests
  56. if (!mf_process_maxfwd_header("10")) {
  57. sl_send_reply("483","Too Many Hops");
  58. break;
  59. };
  60. if (len_gt( max_len )) {
  61. sl_send_reply("513", "Message too big");
  62. break;
  63. };
  64. # Do strict routing if pre-loaded route headers present
  65. loose_route();
  66. # if the request is for other domain use UsrLoc
  67. # (in case, it does not work, use the following command
  68. # with proper names and addresses in it)
  69. if (uri==myself) {
  70. if (method=="REGISTER") {
  71. if (!www_authorize("", "subscriber")) {
  72. www_challenge("", "0");
  73. break;
  74. };
  75. save("location");
  76. break;
  77. };
  78. # native SIP destinations are handled using our USRLOC DB
  79. if (!lookup("location")) {
  80. sl_send_reply("404", "Not Found");
  81. break;
  82. };
  83. };
  84. # forward to current uri now
  85. if (!t_relay()) {
  86. sl_reply_error();
  87. };
  88. }