Author Message
MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
Hi All,

Starting I would like to depict my case:
I successfully call
"ACDAddress acd = (ACDAddress)myProv.getAddress(ext);",
where ext is my hunt-group exteneion and I can invoke
"acd.getLoggedOnAgents()"
to see logged on agents.
But when I logoff that agent (1st) and login another (2nd) on the same station I get still information about 1st agent. My JTAPI application simple checks it every 10sek.
On CM i see proper current state of logged on agents


It sounds like cache problem (https://devconnect.avaya.com/public/forum/d_forum_3.jsp?t=4458&f=44)...
In addition I can't every time shutdown/create provider in order to get list of agents.
I would like to use only one object Provider during lifetime of my application.
When I stop and restart my app only then I get proper current state of agents.

Is there any solution for this problem? It sounds like bug

Brgs
Michal
sagardhemre
Joined: Oct 21, 2009
Messages: 0
Offline
JTAPI does not return cached addresses when ACDAddress.getLoggedOnAgents() API is invoked.

If you check the JTAPI logs with debugLevel set to '6', you will see that every time the ACDAddress.getLoggedOnAgents() API is invoked, JTAPI sends a 'LucentQueryAgentLogin' request to TSAPI to fetch the agents logged into a split.

Alternately, to get Agent logged on/logged off events, you may consider adding an AddressListener on the ACDAddress to get the ACDAddrLoggedOnEv or the ACDAddrLoggedOffEv.
MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
thanks sagar,

but in some way data are "cached". Plz make test that I mentioned in 1st post.
sagardhemre
Joined: Oct 21, 2009
Messages: 0
Offline
Is Expert Agent Selection enabled on your Communication Manager?

The ACDAddress.getLoggedOnAgents() API returns an array of Agents. Check whether Agent.getAgentID() API returns the correct agent ID of the logged in agent.
MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
As I wrote in my first post:
When I call ACDAddress.getLoggedOnAgents() at first time i returns correct amount of agetns logged in in given ACDAddress, but when I change amount of logged in agent in that ACDAddress during lifetime of my JTAPI application (I logged in and out manualy from given phone) it returns all the time state from 1st call of that method.
Lifetime means that I use this same Provider durring whole process.


My test application is very simple:
-getProvider
-provider.getACDAddress
-ACdAddress.getLoggedOnAgents

MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
My code is:

LucentProvider myProv = null;

public class ACDtest {

public void createProvider(){

   JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
   myProv = (LucentProvider)peer.getProvider(myServ + ";login="+login+ ";passwd=" + password);

}

public void doTestIsAvail(String ext){

   ACDAddress acd = null;
   try {

            
         acd = (ACDAddress)myProv.getAddress(ext);

         if (acd.getLoggedOnAgents()!=null ){
            if (acd.getLoggedOnAgents().length!=0) {
               System.out.println("Agent : " + acd.getLoggedOnAgents()[0].getAgentID());
               System.out.println("Terminal : " + acd.getLoggedOnAgents()[0].getAgentTerminal().getName());
               System.out.println("Status : " + acd.getLoggedOnAgents()[0].getState());
            } else {
               System.out.println("Agent = 0 ");
            }
            
         }else {
            System.out.println("Agent null ");
         }
      } catch (Exception e) {
         // TODO: handle exception
         e.printStackTrace();
      }
      



}

public static void main(String args[]){

   ACDtest tst = new ACDtest();
      
      String ext = "500630";
      
      tst.doTestIsAvail(ext);
      
      for (int i = 0 ; i <3;i++) {
         try {
            Thread.sleep(15000);
         } catch (InterruptedException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
         }
      
         System.out.println("--------");
      
         tst.doTestIsAvail(ext);
      
      }
      
      tst.myProv.shutdown();
   }

}



}
MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
Sorry, I wrote previous post in hurry.

Code below should be fine:

plz try durring that 15000ms sleep logged in and logged out agent few times.
In my application during first sleep I logged out my test agent and next call returns that agent is still logged in

//////

My code is:



public class ACDtest {

LucentProvider myProv = null;

public void createProvider(){

JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
myProv = (LucentProvider)peer.getProvider(myServ + ";login="+login+ ";passwd=" + password);

}

public void doTestIsAvail(String ext){

ACDAddress acd = null;
try {


acd = (ACDAddress)myProv.getAddress(ext);

if (acd.getLoggedOnAgents()!=null ){
if (acd.getLoggedOnAgents().length!=0) {
System.out.println("Agent : " + acd.getLoggedOnAgents()[0].getAgentID());
System.out.println("Terminal : " + acd.getLoggedOnAgents()[0].getAgentTerminal().getName());
System.out.println("Status : " + acd.getLoggedOnAgents()[0].getState());
} else {
System.out.println("Agent = 0 ");
}

}else {
System.out.println("Agent null ");
}
} catch (Exception e) {
// TODO: handle exception
e.printStackTrace();
}




}

public static void main(String args[]){

ACDtest tst = new ACDtest();
tst.createProvider();

String ext = "500630";

tst.doTestIsAvail(ext);

for (int i = 0 ; i <3;i++) {
try {
Thread.sleep(15000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

System.out.println("--------");

tst.doTestIsAvail(ext);

}

tst.myProv.shutdown();
}

}

sagardhemre
Joined: Oct 21, 2009
Messages: 0
Offline
I recommend invoking ACDAddress.getLoggedOnAgents() API only once and saving the Agent array in some variable. Perform all operations on this reference variable. This will help improve performance.

Also use the APIs getAgentID() and getState() to verify if the returned Agent object was in a transition state from LOG_IN/NOT_READY state to LOG_OUT state.
MichalWawiorko
Joined: Nov 12, 2013
Messages: 15
Offline
I've tried it already - no luck...
sagardhemre
Joined: Oct 21, 2009
Messages: 0
Offline
This is not a known issue.

Please raise a ticket for technical support.
Micha³Rusinek
Joined: Feb 28, 2013
Messages: 1
Offline
I had the same problem (aes5.2)
Add AddressListener to ACDAddress (even without implementation) .
getLoggedOnAgents will return correct data.
Go to:   
Mobile view