Author Message
simbu.nv

Joined: Nov 9, 2021
Messages: 1
Offline
Dear Team,

I try with below code to login agent

jtapiPeer = JtapiPeerFactory.getJtapiPeer(isNull(data.getPeer()) ? null : data.getPeer());

provider = jtapiPeer.getProvider(providerString);

terminal = provider.getTerminal(stationId);

terminal.addCallListener(listener);

after execution of above code. App created below threads. when next agent login, again 5 threads got created.
Daemon Thread [GetEventThread] (Running)

Daemon Thread [ShutdownThread] (Running)
Daemon Thread [DistributeCSTAEvent] (Running)
Daemon Thread [AuditThread] (Running)
Daemon Thread [TsapiProReader] (Running)

when i do the log-off properly with below code. The above 5 threads got closed. but the agent accidently closed the browser or vpn disconnect or shut down the machine (with out log-out) then How can i close these threads. please help me on this issue.


//log-out
provider.getTerminal(stationId).getCallListeners()
terminal.removeCallListener(callListener[i]);
provider.shutdown();


one more final question
How can i close all connection? ( why i am asking is 12 hours one I will clean up atleast)
[Thumb - LoginIssue.PNG]
Filename LoginIssue.PNG [Disk] Download
Description Login_multi_thread_issue
Filesize 19 Kbytes
Downloaded: 73 time(s)

MartinFlynn

Joined: Nov 30, 2009
Messages: 1796
Online
In order to remove those threads the application must either shutdown the provider or the application must end.

I take it that your JTAPI application is running on a (web?) server and the agent's access it via a web connection. The problem seems to be that you have not put in place a mechanism to allow the server to know that the agent has disconnected. I suggest you consider implementing some sort of heartbeat between the client and server. If the server does not receive heartbeats from the application, it should shutdown the provider.

Martin
Go to:   
Mobile view