0

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?

tshepang
  • 12,111
  • 21
  • 91
  • 136
Arne Kröger
  • 91
  • 1
  • 6

3 Answers3

1
  • Download JTAPI library files "ECsjtapia.jar" add it to your project.
  • Add tsapi.pro file to your project. change the below line in your tsapi.pro file 10.100.100.110 (your cms server ip)=450 (port)
  • create listener.java with below code ` import javax.telephony.*;

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();
    } 




}   

}

Krishna
  • 438
  • 5
  • 18
0

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.

Matt Westlake
  • 3,499
  • 7
  • 39
  • 80
  • imo there's a difference between logging calls (start time - from - to - duration) and recording calls, maybe OP should clarify what he wants to do? – fvu Jul 13 '12 at 16:42
  • @fvu that's easy enough, when signal detected, system.getTimeMillis(). When signal dropped, system.getTimeMillis() again, subtract the 2, and you have your start time, duration, and endtime. – Matt Westlake Jul 13 '12 at 16:45
0

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 :

  • Connect to you Phone system (details depend on the implementation), this will result in a Connection
  • Get the Extension you want to observe : Connection.getTerminal or Connection.getAddress
  • Implement CallObserver or CallListener
  • Now you can add your CallObserver or CallListener : e.g. Address.addCallObserver.

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.

Hajo Thelen
  • 1,095
  • 1
  • 11
  • 16