Author Message
mikedarretta
Joined: Mar 22, 2016
Messages: 9
Offline
I have a web app that uses java object to open connection to TSAPI service.
when the user logs out i use session listener to call java object to close the connection.
but i am seeing connections get left open even though the use is logged off.
this hangs up Tomcat server from shutting down.

is there another way to drop connections to TSAPI service?


public void shutDown(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
PhoneService obj = (PhoneService)request.getSession().getAttribute("object");
obj.hangup();
obj.shutProvider();
}
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
I don't see any mention of PhoneService in the JTAPI Javadocs so I think it may be your class. In this case, I do not know what it does.

The correct way of ending a JTAPI session seems to be Provider.shutdown(); At lease, that is what the AgentView sample application does.

Martin
mikedarretta
Joined: Mar 22, 2016
Messages: 9
Offline
yes, i am using Provider.shutdown(); but seems like it's not getting called sometimes. that is part of my app.
because the connection has a heartbeat it will never time out on tomcat side or TSAPI side.
in order to call Provider.shutdown(); it needs to use the java object that is instantiated.

PID for connection is Tomcat server. i do not want to kill server.
also tomcat does not come down when there is an open connection/thread running.

is there another way to close or kill connections?

MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
These APIs are connection based so I do not think they are really suitable for use directly in a web service or webserver. Quite apart from your problem, opening a new connection to AE Services for every interaction is very time consuming.

I suggest you think about putting your JTAPI code into a separate process. Open a single connection to AE Services and use it for all requests. Then use your tomcat code to send requests to this process.

Martin
mikedarretta
Joined: Mar 22, 2016
Messages: 9
Offline
Thanks for the reply.

the first time a user clicks on a phone number it opens a new connection.
that connection stays open for that users session. when they dial again it uses same connection.
you are saying to open one connection for all users? not sure how to do that but i will look into it.
when the user logs off or session times out the session listener calls Provider.shutdown(); from
the java object (phone service) that is help in the Web Session.
Go to:   
Mobile view