Re: [Asterisk-java-devel] Integrating live AsteriskServer with Apache Tomcat
Brought to you by:
srt
From: Ngo-Vi Hoai-A. <ho...@gm...> - 2010-06-23 11:47:20
|
I've tested. It seems to be no need to wrap the DefaultAsteriskServer in an extra thread. I've defined a DefaultAsteriskServer as a Spring bean as ... <bean id="defaultAsteriskServer" class="org.asteriskjava.live.DefaultAsteriskServer" init-method="initialize" destroy-method="shutdown"> <constructor-arg index="0" value="localhost" /> <constructor-arg index="1" value="5038" /> <constructor-arg index="2" value="amiuser" /> <constructor-arg index="3" value="amipwd" /> </bean> ... When I start Apache Tomcat with Spring ContextLoaderListener. An instance of DefaultAsteriskServer with an established ami connection is created and Tomcat does not hang. Since Spring container create the DefaultAsteriskServer as a singleton by default multiple connection to Asterisk is also avoided. Timothy Rodriguez schrieb: > Since asterisk Ami works best with one app talking to it (though this > has recently been remedied somewhat I'm told). I create a connection > on the init of one of the servlets and use static methods. This has a > few benefits in that ensures only one connection is made to asterisk > and that connection is maintained for the life of the servlet. > > So far that's worked for me. I'd be interested to see what others on > this list are doing, but you might want to start there. > > -Tim > > On Jun 23, 2010, at 4:35 AM, Ngo-Vi Hoai-Anh <ho...@gm...> wrote: > > >> Dear experts, >> >> If I want to integrate a live AsteriskServer with Apache Tomcat. >> Should >> I start the live server in a separate thread like with the AGI one? >> >> Thank you. >> Hoai-Anh >> >> --- >> --- >> --- >> --------------------------------------------------------------------- >> ThinkGeek and WIRED's GeekDad team up for the Ultimate >> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the >> lucky parental unit. See the prize list and enter to win: >> http://p.sf.net/sfu/thinkgeek-promo >> _______________________________________________ >> Asterisk-java-devel mailing list >> Ast...@li... >> https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel >> > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > Asterisk-java-devel mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-devel > > |