Author Message
PraveenGopi
Joined: Sep 5, 2014
Messages: 31
Offline
1) Which API should we use to listen softcodes to know the getCalledAddress() and getCallingAddress() call details.

2) Which API is used to get incoming call details from a PBX ? Scenario is a user from his personal mobile will call to a number 108 which is PBX.This PBX will forward that call to some Avaya Agent.This Avaya Agent is not able to capture the incoming call details from PBX.However if directly call is made to this Avaya Agent then it correctly returns the getCalledAddress() and getCallingAddress(). Below is the code we implemented to achieve it :

Terminal terminal = myprovider.getTerminal(agentNumber);
terminal.addCallListener(new IncomingCallListener(postURL, agentNumber));


public class IncomingCallListener implements CallControlTerminalConnectionListener {

String agentNumber;
public static final Map<String, String> InfoMap = new HashMap<String, String>();
int flag = 0;

public static void appendStrToFile(String fileName,String str) {
try {
// Open given file in append mode.
BufferedWriter out = new BufferedWriter(
new FileWriter(fileName, true));
out.write(str);
out.close();
} catch (IOException e) {
System.out.println("exception occoured" + e);
}
}

public IncomingCallListener(String postURL, String agentNumber) {

if (flag == 0) {
flag = 1;
// Let us create a sample file with some text
String fileName = "d:\\writeoutput.txt";
try {
BufferedWriter out = new BufferedWriter(
new FileWriter(fileName));
out.write("HStarting to write now \n");
out.close();
} catch (IOException e) {
System.out.println("Exception Occurred" + e);
}
}
InfoMap.put(agentNumber, postURL);
this.agentNumber = agentNumber;
}

@Override
public void terminalConnectionActive(TerminalConnectionEvent event) {
}

@Override
public void terminalConnectionCreated(TerminalConnectionEvent event) {

}

@Override
public void terminalConnectionDropped(TerminalConnectionEvent event) {
// System.exit(0);
}

@Override
public void terminalConnectionPassive(TerminalConnectionEvent event) {
}

@Override
public void terminalConnectionUnknown(TerminalConnectionEvent event) {
}

@Override
public void connectionAlerting(ConnectionEvent event) {

}

@Override
public void connectionConnected(ConnectionEvent event) {

}

@Override
public void connectionCreated(ConnectionEvent event) {
}

public void connectionDisconnected(ConnectionEvent event) {

}

public void connectionFailed(ConnectionEvent event) {
}

public void connectionInProgress(ConnectionEvent event) {
}

public void connectionUnknown(ConnectionEvent event) {
}

public void callActive(CallEvent event) {
}

public void callInvalid(CallEvent event) {
}

public void callEventTransmissionEnded(CallEvent event) {

}

public void singleCallMetaProgressStarted(MetaEvent event) {

}

public void singleCallMetaProgressEnded(MetaEvent event) {

}

public void singleCallMetaSnapshotStarted(MetaEvent event) {

}

public void singleCallMetaSnapshotEnded(MetaEvent event) {

}

public void multiCallMetaMergeStarted(MetaEvent event) {

}

public void multiCallMetaMergeEnded(MetaEvent event) {
}

public void multiCallMetaTransferStarted(MetaEvent event) {

}

public void multiCallMetaTransferEnded(MetaEvent event) {
}

public void connectionAlerting(CallControlConnectionEvent event) {
}

public void connectionDialing(CallControlConnectionEvent event) {

}

public void connectionDisconnected(CallControlConnectionEvent event) {
}

public void connectionEstablished(CallControlConnectionEvent event) {
}

public void connectionFailed(CallControlConnectionEvent event) {
}

public void connectionInitiated(CallControlConnectionEvent event) {
}

public void connectionNetworkAlerting(CallControlConnectionEvent event) {
}

public void connectionNetworkReached(CallControlConnectionEvent event) {
}

public void connectionOffered(CallControlConnectionEvent event) {
}

public void connectionQueued(CallControlConnectionEvent event) {
}

public void connectionUnknown(CallControlConnectionEvent event) {
}

public void terminalConnectionBridged(CallControlTerminalConnectionEvent event) {
}

public void terminalConnectionDropped(CallControlTerminalConnectionEvent event) {

appendStrToFile("writeoutput", "In terminalConnectionDropped Incomingcalllistener... ");
appendStrToFile("writeoutput", "callingFromPhoneNumber... "+event.getCallingAddress().getName());
appendStrToFile("writeoutput", "callingToPhoneNumber... "+event.getCalledAddress().getName());

String callingFromPhoneNumber = null;
String callingToPhoneNumber = null;

if (event.getCallingAddress() != null) {
callingFromPhoneNumber = event.getCallingAddress().getName();
}
if (event.getCalledAddress() != null) {
callingToPhoneNumber = event.getCalledAddress().getName();
}
if (callingFromPhoneNumber != null && callingFromPhoneNumber != null) {

String url = InfoMap.get(callingToPhoneNumber).toString();

if (!(url.trim().equals("BLANKURL"))) {
// PostDataUtil.uploadData(url, callingFromPhoneNumber, agentNumber, callingToPhoneNumber, "Connection is Dropped", 104);
}
}
}

public void terminalConnectionHeld(CallControlTerminalConnectionEvent event) {

appendStrToFile("writeoutput", "In terminalConnectionHeld Incomingcalllistener... ");
appendStrToFile("writeoutput", "callingFromPhoneNumber... "+event.getCallingAddress().getName());
appendStrToFile("writeoutput", "callingToPhoneNumber... "+event.getCalledAddress().getName());

String callingFromPhoneNumber = null;
String callingToPhoneNumber = null;

if (event.getCallingAddress() != null) {
callingFromPhoneNumber = event.getCallingAddress().getName();
}
if (event.getCalledAddress() != null) {
callingToPhoneNumber = event.getCalledAddress().getName();
}

String url = InfoMap.get(callingToPhoneNumber).toString();

if (!(url.trim().equals("BLANKURL"))) {
// PostDataUtil.uploadData(url, callingFromPhoneNumber, agentNumber, callingToPhoneNumber, "Connection is on Hold", 103);
}
}

public void terminalConnectionInUse(CallControlTerminalConnectionEvent event) {
appendStrToFile("writeoutput", "In terminalConnectionInUse Incomingcalllistener... ");
appendStrToFile("writeoutput", "callingFromPhoneNumber... "+event.getCallingAddress().getName());
appendStrToFile("writeoutput", "callingToPhoneNumber... "+event.getCalledAddress().getName());


}

public void terminalConnectionRinging(CallControlTerminalConnectionEvent event) {

appendStrToFile("writeoutput", "In terminalConnectionRinging Incomingcalllistener... ");
appendStrToFile("writeoutput", "callingFromPhoneNumber... "+event.getCallingAddress().getName());
appendStrToFile("writeoutput", "callingToPhoneNumber... "+event.getCalledAddress().getName());

String callingFromPhoneNumber = null;
String callingToPhoneNumber = null;

if (event.getCallingAddress() != null) {
callingFromPhoneNumber = event.getCallingAddress().getName();
}
if (event.getCalledAddress() != null) {
callingToPhoneNumber = event.getCalledAddress().getName();
}

String url = InfoMap.get(callingToPhoneNumber).toString();

if (!(url.trim().equals("BLANKURL"))) {
//PostDataUtil.uploadData(url, callingFromPhoneNumber, agentNumber, callingToPhoneNumber, "Connection is Ringing", 101);
}
}

public void terminalConnectionTalking(CallControlTerminalConnectionEvent event) {

appendStrToFile("writeoutput", "In terminalConnectionTalking Incomingcalllistener... ");
appendStrToFile("writeoutput", "callingFromPhoneNumber... "+event.getCallingAddress().getName());
appendStrToFile("writeoutput", "callingToPhoneNumber... "+event.getCalledAddress().getName());

String callingFromPhoneNumber = null;
String callingToPhoneNumber = null;

if (event.getCallingAddress() != null) {
callingFromPhoneNumber = event.getCallingAddress().getName();
}
if (event.getCalledAddress() != null) {
callingToPhoneNumber = event.getCalledAddress().getName();
}

String url = InfoMap.get(callingToPhoneNumber).toString();
if (!(url.trim().equals("BLANKURL"))) {
//PostDataUtil.uploadData(url, callingFromPhoneNumber, agentNumber, callingToPhoneNumber, "Connection is Talking", 102);
}
}

public void terminalConnectionUnknown(CallControlTerminalConnectionEvent event) {
}

@Override
public void terminalConnectionRinging(TerminalConnectionEvent tce) {

}
}


3) What are the parameters required for a DMCC provider object to create ?

4) How to resolve the SSLHandshake exception comes when creating the provider object of Avaya DMCC ?

5) Which API has to be used for knowing that an Avaya Agent has made a conference call or forwarded or transfered a call ? Scenario is we are listening a Terminal object of an Avaya agent and we need to add a correct listener to capture the events related to whether a conference call is made / transferred / forwarded.
Also the getCallControlCause() always returns 100 and never gives the proper value whether conference is made or call is transferred.Please suggest how to overcome this problem.

6) Are sample programs for all above scenarios available ?

7) Any video/tutorial can be shared explaining the details on to how to use the Avaya API's with their significance ?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
Your questions relate to DMCC but the code you included is JTAPI. Which API are you asking about?

Martin
PraveenGopi
Joined: Sep 5, 2014
Messages: 31
Offline
I have requested customer to reply on this thread
PraveenGopi
Joined: Sep 5, 2014
Messages: 31
Offline
For some reason the customer is not able to follow the thread. They have this query:
Which avaya API is used to get incoming call details from a PBX ? Scenario is a user from his personal mobile will call to a number 108 which is PBX.This PBX will forward that call to some Avaya Agent.This Avaya Agent is not able to capture the incoming call details from PBX.However if directly call is made to this Avaya Agent then it correctly returns the getCalledAddress() and getCallingAddress(). Below is the code we implemented to achieve it :

Terminal terminal = myprovider.getTerminal(agentNumber);
terminal.addCallListener(new IncomingCallListener(postURL, agentNumber));


public class IncomingCallListener implements CallControlTerminalConnectionListener {

String agentNumber;
public static final Map<String, String> InfoMap = new HashMap<String, String>();
int flag = 0;

public static void appendStrToFile(String fileName,String str) {
try {
// Open given file in append mode.
BufferedWriter out = new BufferedWriter(
new FileWriter(fileName, true));
out.write(str);
out.close();
} catch (IOException e) {
System.out.println("exception occoured" + e);
}
}

public IncomingCallListener(String postURL, String agentNumber) {

if (flag == 0) {
flag = 1;
// Let us create a sample file with some text
String fileName = "d:\\writeoutput.txt";
try {
BufferedWriter out = new BufferedWriter(
new FileWriter(fileName));
out.write("HStarting to write now \n");
out.close();
} catch (IOException e) {
System.out.println("Exception Occurred" + e);
}
}
InfoMap.put(agentNumber, postURL);
this.agentNumber = agentNumber;
}

@Override
public void terminalConnectionActive(TerminalConnectionEvent event) {
}

@Override
public void terminalConnectionCreated(TerminalConnectionEvent event) {

}

@Override
public void terminalConnectionDropped(TerminalConnectionEvent event) {
// System.exit(0);
}

@Override
public void terminalConnectionPassive(TerminalConnectionEvent event) {
}

@Override
public void terminalConnectionUnknown(TerminalConnectionEvent event) {
}

@Override
public void connectionAlerting(ConnectionEvent event) {

}

@Override
public void connectionConnected(ConnectionEvent event) {

}

@Override
public void connectionCreated(ConnectionEvent event) {
}

public void connectionDisconnected(ConnectionEvent event) {

}

public void connectionFailed(ConnectionEvent event) {
}

public void connectionInProgress(ConnectionEvent event) {
}

public void connectionUnknown(ConnectionEvent event) {
}

public void callActive(CallEvent event) {
}

public void callInvalid(CallEvent event) {
}

public void callEventTransmissionEnded(CallEvent event) {

}

public void singleCallMetaProgressStarted(MetaEvent event) {

}

public void singleCallMetaProgressEnded(MetaEvent event) {

}

public void singleCallMetaSnapshotStarted(MetaEvent event) {

}

public void singleCallMetaSnapshotEnded(MetaEvent event) {

}

public void multiCallMetaMergeStarted(MetaEvent event) {

}

public void multiCallMetaMergeEnded(MetaEvent event) {
}

public void multiCallMetaTransferStarted(MetaEvent event) {

}

public void multiCallMetaTransferEnded(MetaEvent event) {
}

public void connectionAlerting(CallControlConnectionEvent event) {
}

public void connectionDialing(CallControlConnectionEvent event) {

}

public void connectionDisconnected(CallControlConnectionEvent event) {
}

public void connectionEstablished(CallControlConnectionEvent event) {
}

public void connectionFailed(CallControlConnectionEvent event) {
}

public void connectionInitiated(CallControlConnectionEvent event) {
}

public void connectionNetworkAlerting(CallControlConnectionEvent event) {
}

public void connectionNetworkReached(CallControlConnectionEvent event) {
}

public void connectionOffered(CallControlConnectionEvent event) {
}

public void connectionQueued(CallControlConnectionEvent event) {
}

public void connectionUnknown(CallControlConnectionEvent event) {
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
An application can get real-time call information using the TSAPI, JTAPI or DMCC APIs.

If there is a period where a call is not being monitored by an application, then some information (e.g calling number) will not be provided when it does become monitored. In your case, I suspect the application has a monitor on the agent's phone but there is no monitor on 108. I presume 108 is a VDN.

In this case, a call directly to the agent's phone will have always been monitored so the information is available. A call to 108 is not monitored so the information is lost. When the call is later delivered to the agent's phone, the agent's monitor gets events but the calling number is not available.

The solution to this is to make sure that incoming calls are always monitored. Assuming 108 is a VDN, the application should place a monitor on it.

Martin
PraveenGopi
Joined: Sep 5, 2014
Messages: 31
Offline
Sorry to comeback to you on this.
They came to me asking "which Avaya API has to be used to place a monitor on VDN"
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Offline
You can monitor a VDN using any of the APIs - TSAPI, JTAPI or DMCC. The exact mechanism will depend on the API and you should be able to find out more in the appropriate SDK documentation.

For example, with JTAPI, I think you would use a CallListener (same as when monitoring a station) but, you would start listening using LucentCallCenterAddress.addCallListener() instead of Terminal.addCallListener() or Address.addCallListener().

Martin
Go to:   
Mobile view