Author Message
imraan7862
Joined: Oct 6, 2017
Messages: 20
Offline
hi,

can someone please show me an example of how to use the agent interface in a console app

here is a sample of the code i am using

package avaya_connection;


/**
*
* @author imraan
*/
import javax.telephony.*;
import com.avaya.jtapi.tsapi.*;
import static com.avaya.jtapi.tsapi.CSTACauseVariant.override;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.avaya.jtapi.tsapi.adapters.CallListenerAdapter;
import com.avaya.jtapi.tsapi.LucentProvider;
import com.avaya.jtapi.tsapi.csta1.AgentState;
import javax.telephony.callcenter.ACDAddress;
import javax.telephony.callcenter.ACDManagerAddress;
import javax.telephony.callcenter.Agent;
import sun.management.resources.agent;
import com.avaya.jtapi.tsapi.impl.events.*;
import java.util.logging.Level;
import javax.telephony.callcenter.*;



public class Avaya_Connection {



public void agentUpdate(Agent agentState)//checking agent state

{

agentState.getAgentID();
int previousAgentState = LucentAgent.UNKNOWN;

if (agentState.getState() == previousAgentState)
return ;

previousAgentState = agentState.getState();


String msg = "AgentState: ";
switch (previousAgentState) {

case Agent.LOG_OUT:
System.out.println("Agent is logged out");
break;

case Agent.READY:
System.out.println("Agent is ready");
break;

case Agent.NOT_READY:
System.out.println("Agent is not ready");
break;

case Agent.WORK_NOT_READY:
System.out.println("Agent work not ready");
break;

case Agent.BUSY:
System.out.println("Agent is busy");
break;

default:
// Received an event which is not to be processed.
ACDAddress ad;
}


}
public static void main(String[] args)
{
//other code
Avaya_Connection ac = new Avaya_Connection();
ac.agentUpdate(agentState);[color=red]<--- the error returned is cannot find symbol[/color]
}
}
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
The JTAPI sample application, AgentView, requests agent state at regular intervals, you can take a look at the code it uses to do this. You can download the sample application from the Devconnect website.

Martin
imraan7862
Joined: Oct 6, 2017
Messages: 20
Offline
yes that is where i originally got the idea of how to use the agent interface but that is a GUI application and for some reason it works differently in a console application, what i meant by example is could you take a look at my code and maybe tell me how to improve on it to make it work or if there is an error with it
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
The code that gets the agent state is not tied to the GUI so it should work as part of a console application quite happily.

I do not have time to give your code anything but a cursory glance. Two comments that I generally make are:

1. Be careful of threading issues. Don't use a JTAPI event thread to make an API call.

2. Agent.getState() sends a request to Communication Manager via AE Services so you should consider it "expensive" and blocks the thread for some time. Your code makes an unnecessary call to Agent.getState().

Martin
imraan7862
Joined: Oct 6, 2017
Messages: 20
Offline
Okay thank you i think i get where you're going with this
Ahmadqadri
Joined: Oct 8, 2018
Messages: 54
Offline
Trying to do similar thing with dmcc .net sdk
1) Are there any events that gets trigger when agent state changes.
2) Any Licence requirment

Thank you
imraan7862
Joined: Oct 6, 2017
Messages: 20
Offline
Hi, going the jtapi route would use up tsapi licenses but using DMCC would require a different license called a DMCC license it will allow a similar way to interact however this was not really meant for the purpose of agent states, this is more to do with the recording side of things as I understand it but you could still use it for agent states it is just a very expensive solution. I would recommend using JTAPI because the licenses are much cheaper than using DMCC.

Hope this helps
Go to:   
Mobile view