WrappedMethods.java 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import java.lang.*;
  2. import java.io.*;
  3. import org.siprouter.*;
  4. import org.siprouter.NativeInterface.*;
  5. public class WrappedMethods extends NativeMethods
  6. {
  7. public static boolean is_method(String method)
  8. {
  9. if (KamExec("is_method", method) == -1)
  10. return false;
  11. else
  12. return true;
  13. }
  14. public static boolean t_check_trans()
  15. {
  16. if (KamExec("t_check_trans") == -1)
  17. return false;
  18. else
  19. return true;
  20. }
  21. public static boolean t_relay()
  22. {
  23. if (KamExec("t_relay") == -1)
  24. return false;
  25. else
  26. return true;
  27. }
  28. public static void record_route()
  29. {
  30. KamExec("record_route");
  31. }
  32. public static void append_hf(String txt)
  33. {
  34. KamExec("append_hf", txt);
  35. }
  36. public static void append_hf(String txt, String hdr)
  37. {
  38. KamExec("append_hf", txt, hdr);
  39. }
  40. public static void remove_hf(String hname)
  41. {
  42. KamExec("remove_hf", hname);
  43. }
  44. public static void sl_send_reply(String replycode, String replymsg)
  45. {
  46. KamExec("sl_send_reply", replycode, replymsg);
  47. }
  48. public static void sl_reply_error()
  49. {
  50. KamExec("sl_reply_error");
  51. }
  52. public static boolean has_totag()
  53. {
  54. if (KamExec("has_totag") == -1)
  55. return false;
  56. else
  57. return true;
  58. }
  59. public static boolean loose_route()
  60. {
  61. if (KamExec("loose_route") == -1)
  62. return false;
  63. else
  64. return true;
  65. }
  66. public static boolean save(String location)
  67. {
  68. if (KamExec("save", location) == -1)
  69. return false;
  70. else
  71. return true;
  72. }
  73. }