uas.cfg 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #
  2. # $Id$
  3. #
  4. # this example shows usage of ser as user agent
  5. # server which does some functionality (in this
  6. # example, 'log' is used to print a notification
  7. # on a new transaction) and behaves statefuly
  8. # (e.g., it retransmits replies on request
  9. # retransmissions)
  10. # ------------------ module loading ----------------------------------
  11. loadmodule "modules/sl/sl.so"
  12. loadmodule "modules/tm/tm.so"
  13. # ------------------------- request routing logic -------------------
  14. # main routing logic
  15. route{
  16. # for testing purposes, simply okay all REGISTERs
  17. if (method=="REGISTER") {
  18. log("REGISTER");
  19. sl_send_reply("200", "ok");
  20. break;
  21. };
  22. # create transaction state; abort if error occurred
  23. if ( !t_newtran()) {
  24. sl_reply_error();
  25. break;
  26. };
  27. # the following log will be only printed on receipt of
  28. # a new message; retranmissions are absorbed by t_newtran
  29. log(1, "New Transaction Arrived\n");
  30. # do what you want to do as a sever...
  31. if (uri=~"a@") {
  32. if (!t_reply("409", "Bizzar Error")) {
  33. sl_reply_error();
  34. };
  35. } else {
  36. if (!t_reply("699", "I don't want to chat with you")) {
  37. sl_reply_error();
  38. };
  39. };
  40. }