Garry Adkins
2003-Sep-08 09:58 UTC
[Asterisk-Users] Question about using AGI - over network (with Java)?
I'm originally a Perl programmer, but have moved to java in the last few years.... I've played around with the AGI stuff under perl, as it's very easy.... Since I prefer Java, I started experimenting a bit, but was concerned about the huge startup times for the JVM. I tried something a bit weird, and it worked fine, but I'm interested in feedback, (i.e. is this a stupid idea?) Wrote a simple threaded JVM server process, that would accept incoming connections and process them. (new thread for each incoming connection) I spawned netcat from a dialplan, and had it connect through the network to the java server process STDIN and STDOUT were connected to the pipe Java program was already started, and just had to start a new thread to process the AGI data, and send it back over the network to be connected to asterisk Java program was on a different machine, and could connect to a database, etc. Worked fine.... But then I noticed that there was a management interface that was network accessable as well... I don't even know if this is useful or not. Here's what I was thinking: 1) Java has a big startup load, could overwhelm an asterisk machine and cause scalability problems 2) netcat seemed like a nifty solution so I could run the AGI on a different machine, and have the database on a third! 3) If performance became a problem, I could set up an intermediate machine that would forward connections to the least loaded "AGI Server", transparently to asterisk. 4) Later I could add ssl into the mix for a bit of protection to the network traffic Interesting idea for scalability or stupid idea (reinventing the wheel, etc)? I'd be happy to provide the sample code that I used if anyone's interested. It's quite ugly, though.... I made it a quick hack. Any feedback very appreciated. -G
Seemingly Similar Threads
- Libvirt java binding crash Tomcat
- [PATCH] configure: add java-8-openjdk and java-7-openjdk as locations for java
- Starting tomcat5: /usr/bin/rebuild-jar-repository: error: Could not find jdbc-stdext Java extension for this JVM
- [PATCH] m4: Add java search path for Gentoo
- agi with java?