Reputation: 91
I would like to develop a Java app that logs all incoming calls to our telephone system. We use an octopus open system provided by the telekom.
After some research I found out that jtapi would be an solution but I can't find any good tutorials. Am I on the right track? Can you provide some examples to me?
Upvotes: 0
Views: 3450
Reputation: 438
public class Listener {
static Provider provider;
static JtapiPeer peer1=null;
static String myService = "";
public static void main(String args[]){
try {
peer1 = JtapiPeerFactory.getJtapiPeer("com.avaya.jtapi.tsapi.TsapiPeer");
//"com.avaya.jtapi.tsapi.TsapiPeer"
}
catch(Exception hata)
{
System.out.println("Error: "+hata.getMessage());
}
//System.out.println("Test is ok: "+peer1.getName());
String[] services = peer1.getServices();
if (services == null)
{
System.out.println("Unable to obtain the services list from JTAPI peer");
System.exit(0);
}
myService = services[0];
//System.out.println("Service is "+myService);
System.out.println("Connecting to server-:"+myService+";login=;passwd=");
provider = peer1.getProvider(myService + ";login=;passwd=;");
try {
Terminal[] terminals = provider.getTerminals();
for(int i=0;i<=terminals.length-380;i++){
String arrterminals =terminals[i].getName() ;
try {
Terminal terminal = provider.getTerminal(arrterminals);
terminal.addCallListener(new callListener());
System.out.println("Terminal added for monitoring : " + i + " : " + terminal.getName());
} catch (InvalidArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ResourceUnavailableException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (MethodNotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
} catch (ResourceUnavailableException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
}
}
Upvotes: 1
Reputation: 1135
I don't think that there is a JTAPI implementation that supports the Telekom Octopus directly. You can try JTAPI over TAPI with the gjtapi (on sourceforge).
The standard API documetation of the JTAPI can be found at the Java Comunity Process (jcp.org).
This documentation contains some sample code in the package description of javax.telephony.
Monitor/Track calls is quite easy :
In the eventhandling routines e.g. CallObserver.callCahngedEvent(CallEv ev[]) you can get all relevant information out of the event Object and do whatever you want with it.
That's all ...
Observer Listener?
Depending on your JTAPI implementation Observer may be deprecated or not.
Upvotes: 0
Reputation: 3651
If you can find an old fax card, you can just envoke a listener on the phone line and while active record. Other then that, not sure what else would work.
Upvotes: 0