[Freeswitch-svn] [commit] r9214 - freeswitch/trunk/src/mod/languages/mod_java

Freeswitch SVN anthm at freeswitch.org
Thu Jul 31 16:16:45 EDT 2008


Author: anthm
Date: Thu Jul 31 16:16:44 2008
New Revision: 9214

Modified:
   freeswitch/trunk/src/mod/languages/mod_java/modjava.c

Log:
update mod_java to the new module api

Modified: freeswitch/trunk/src/mod/languages/mod_java/modjava.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_java/modjava.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_java/modjava.c	Thu Jul 31 16:16:44 2008
@@ -111,29 +111,6 @@
         switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error attaching thread to Java VM!\n");
 }
 
-
-static switch_application_interface_t java_application_interface = {
-	/*.interface_name */ "java",
-	/*.application_function */ java_function,
-	NULL, NULL, NULL,
-	/* flags */ SAF_NONE,
-	/* should we support no media mode here?  If so, we need to detect the mode, and either disable the media functions or indicate media if/when we need */
-	/*.next */ NULL
-};
-
-static switch_loadable_module_interface_t java_module_interface = {
-	/*.module_name */ modname,
-	/*.endpoint_interface */ NULL,
-	/*.timer_interface */ NULL,
-	/*.dialplan_interface */ NULL,
-	/*.codec_interface */ NULL,
-	/*.application_interface */ &java_application_interface,
-	/*.api_interface */ NULL,
-	/*.file_interface */ NULL,
-	/*.speech_interface */ NULL,
-	/*.directory_interface */ NULL
-};
-
 static switch_status_t load_config(JavaVMOption **javaOptions, int *optionCount)
 {
     switch_xml_t cfg, xml;
@@ -259,9 +236,11 @@
     switch_status_t status;
     JavaVMOption *options = NULL;
     int optionCount = 0;
+	switch_application_interface_t *app_interface;
+
+	*module_interface = switch_loadable_module_create_module_interface(pool, modname);
+	SWITCH_ADD_APP(app_interface, "java", NULL, NULL, java_function, NULL, SAF_SUPPORT_NOMEDIA);
 
-    /* connect my internal structure to the blank pointer passed to me */
-    *module_interface = &java_module_interface;
     switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Java Framework Loading...\n");
 
     if (javaVM != NULL)



More information about the Freeswitch-svn mailing list