FreeSWITCH provides a mod_java module to control FreeSWITCH in JAVA. Recently just in touch with the next, it is troubled by some of the problems in, now sorted out with everyone to share: Note: has made the demo (http://wiki.freeswitch.org/wiki/Java) in the official wiki in advance into a jar package, the name is freeswitchJavaScript. jar 1. Convert the file freeswitchJavaScript. jar is uploaded to the linux directory, as follows:/usr/local/freeswitch/jar/freeswitchJavaScript. jar 2. Run the freeswitch file. jar is uploaded to this directory, as follows:/usr/local/freeswitch/scripts/freeswitch. jar 3. Convert freeswitchJavaScript. upload the jar file referenced by jar to the/javapath directory. Note: The/javapath directory is used to store the jar package referenced by a third party. 4. Configure the java module file: /usr/local/freeswitch/conf/autoload_configs/java. conf. xml mainly configures the following two content: <javavm path = "/usr/java/jdk1.6.0 _ 16/jre/lib/i386/client/libjvm. so "/> <option value ="-www.2cto. comDjava. class. path =/usr/local/freeswitch/scripts/freeswitch. jar:/javapath/axis. jar:/javapath/activation. jar:/javapath/axis-ant.jar:/javapath/commons-discovery-0.2.jar:/javapath/commons-logging-1.0.4.jar:/javapath/freeswitch. jar:/javapath/jaxrpc. jar:/javapath/log4j-1.2.8.jar:/javapath/log4j. properties:/javapath/mail. jar:/javapath/saaj. jar:/javapath/wsdl4j-1.5.1.jar:/javapath/jetty-6.1.9.jar:/javapath/jetty-util-6.1.9.jar:/javapath/servlet_jetty.jar "/> note: the classpath points to the jar File 5 referenced in step 3. Configure the www.2cto.com file in dialplan:/usr/local/freeswitch/conf/dialplan/default. xml dialing scheme: <extension name = "java_demo"> <condition field = "destination_number" expression = "^ (9000) $ "> <action application =" answer "/> <action application =" java "data ="/usr/local/freeswitch/jar/freeswitchJavaScript. jar PhoneTest "/> <action application =" sleeping "data =" 2000 "/> </condition> </extension>