Kamailio.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. public class Kamailio
  2. {
  3. static
  4. {
  5. System.load("/opt/kamailio/lib/kamailio/modules/app_java.so");
  6. }
  7. private native void LM_GEN1(int logLevel, String s);
  8. private native void LM_GEN2(int logFacility, int logLevel, String s);
  9. private native void LM_ALERT(String s);
  10. private native void LM_CRIT(String s);
  11. private native void LM_WARN(String s);
  12. private native void LM_NOTICE(String s);
  13. private native void LM_ERR(String s);
  14. private native void LM_INFO(String s);
  15. private native void LM_DBG(String s);
  16. public Kamailio()
  17. {
  18. System.out.println("*************** constructor initialized! **********************");
  19. }
  20. // public static int child_init(int rank)
  21. public int child_init(int rank)
  22. {
  23. System.out.println("FROM JAVA: rank=" + rank);
  24. this.LM_GEN1(1, "oh yeah!!!\n");
  25. this.LM_GEN2(1, 2, "oh yeah!!!\n");
  26. this.LM_ALERT("oh yeah!!!\n");
  27. this.LM_CRIT("oh yeah!!!\n");
  28. this.LM_WARN("oh yeah!!!\n");
  29. this.LM_NOTICE("oh yeah!!!\n");
  30. this.LM_ERR("oh yeah!!!\n");
  31. this.LM_INFO("oh yeah!!!\n");
  32. this.LM_DBG("oh yeah!!!\n");
  33. return 1;
  34. }
  35. }