2
0

sms.cfg 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #
  2. # iptel.org real world configuration
  3. #
  4. # $Id$
  5. #
  6. # ----------- global configuration parameters ------------
  7. debug=4 # debug level (cmd line: -dddddddddd)
  8. #fork=yes
  9. fork=no
  10. #log_stderror=no # (cmd line: -E)
  11. log_stderror=yes # (cmd line: -E)
  12. check_via=yes # (cmd. line: -v)
  13. dns=on # (cmd. line: -r)
  14. rev_dns=yes # (cmd. line: -R)
  15. port=5060
  16. children=1
  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. # ------------------ module loading ----------------
  22. loadmodule "../sip_router/modules/print/print.so"
  23. #loadmodule "../sip_router/modules/tm/tm.so"
  24. loadmodule "../sip_router/modules/sl/sl.so"
  25. loadmodule "../sip_router/modules/maxfwd/maxfwd.so"
  26. # ----------------- setting module-specific parameters -------
  27. # -- tm params --
  28. modparam("tm", "fr_timer", 10 )
  29. modparam("tm", "fr_inv_timer", 10 )
  30. modparam("tm", "wt_timer", 10 )
  31. route{
  32. # filter local stateless ACK generated by authentication of mf replies
  33. sl_filter_ACK();
  34. if (len_gt( max_len )) {
  35. # if (len_gt( 100 )) {
  36. sl_send_reply("513", "Riesengross -- Message too large");
  37. log("XXX Riessengross: dropped\n");
  38. break;
  39. };
  40. # filter too old messages
  41. # log("LOG: Checking maxfwd\n");
  42. # if (!mf_process_maxfwd_header("0")) {
  43. # log("LOG: Too many hops\n");
  44. # sl_send_reply("483","Too Many Hops");
  45. # break;
  46. # };
  47. # UAS script implementation
  48. # if that is not a new transaction... (t_newtran is a new
  49. # function which atomicaly adds a transaction if there is
  50. # none)
  51. if (! t_newtran()) {
  52. # retransmit whatever we have
  53. t_retransmit_reply();
  54. } else {
  55. # do what you want to do
  56. # if (send_sms()) {
  57. # this is just a thing which stands for sth real
  58. if (len_gt( max_len )) {
  59. # things went well, send ok upstream
  60. if (!t_send_reply("200", "yes sir, SMS sent over")) {
  61. # if replying failed, retry statelessly
  62. sl_reply_error();
  63. };
  64. } else {
  65. if (!t_send_reply("500", "SMS error :-(")) {
  66. # if replying failed, retry statelessly
  67. sl_reply_error();
  68. };
  69. };
  70. # transaction conclude it -- junk it now (it will
  71. # stay there until WAIT timer hits)
  72. t_release();
  73. };
  74. t_unref();
  75. }