Incoming Telephone Number

Pavel Vesely <[email protected]> Mon, 12 Jun 2006 12:09:36 -0600
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <LISTSERV%[email protected]>
Hi All,

I would like to get a telephone number of incoming calls. I am able to make
a call and I am getting events - it means the instalation should be OK.

I am using GJTAPI with TAPI 3.0 Provider. And I have an optiPoint 500 /
HiPath 3000 / CallBridge TU TAPI. If I use directly the TAPI with C++
everything is fine but with JAVA I don't get the telephone number.

Please, could you help me?

Thanks a lot,
Pavel

I am using two ideas that I have found on this forum but no success:

if (ev instanceof TermConnRingingEv) {
    // first try
    String A_number;
    String B_number;
    CallControlCall call = (CallControlCall)ev.getCall();
    if(call instanceof CallControlCall) {
        Address myCalledAddress =
              ((CallControlCall)call).getCalledAddress();
        Address myCallingAddress =
              ((CallControlCall)call).getCallingAddress();
        A_number=myCallingAddress.getName();
        B_number=myCalledAddress.getName();
        System.out.println("\n\nA="+A_number+"  B="+B_number);
    }

    // second try
    TerminalConnection tc = ((TermConnEv)ev).getTerminalConnection();
    try {
        Call c = ev.getCall();
        Connection m_connections[] = c.getConnections();
        TerminalConnection termCons[] =
            m_connections[0].getTerminalConnections();
        TerminalConnection termCon = termCons[0];
        Terminal t = termCon.getTerminal();
        Address a[] = t.getAddresses();
        String incoming = a[0].getName();
        System.out.println("address is "+incoming);
        System.out.println("terminal is "+t.getName());
        System.out.println("the phone is ringing");
     } catch (Exception excp) {
        excp.printStackTrace();
     }
 }

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".