Link to home
Create AccountLog in
Java

Java

--

Questions

--

Followers

Top Experts

Avatar of LeanMoreTryMore
LeanMoreTryMore

jtapi sample application?
I have spent hours and hours surfing google but can't find any sample tutorail.

I download sourceForge but doesnt tell me how to make it run and work

anyone who points me any web sites i can find information would be greatly apprciated

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of VenabiliVenabili🇧🇬


Avatar of Tomas Helgi JohannssonTomas Helgi Johannsson🇮🇸

   Hi!

Have you looked at these sites (found them using Google :) )
http://www.zurich.ibm.com/csc/distribsys/j323/j323-8.html
http://www.amazon.com/Essential-JTAPI-Spencer-E-Roberts/dp/013080360X

Regards,
  Tomas Helgi

Avatar of VenabiliVenabili🇧🇬

Tomas,

The first site is also in my list and the second is the paper book the sources for which are in my first link :)

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


   Venabil,
I didn't see your post until after I posted mine.

Regards,
  Tomas Helgi

Avatar of VenabiliVenabili🇧🇬

:) Yep - saw the timestamps. :) That's why I just mentioned it - haven't said you had copied them

Avatar of LeanMoreTryMoreLeanMoreTryMore

ASKER

I look at those but not working.

We are using phone CISCO
my computer has already been connected to my telephone.

My question is do i need to download the emulator DDL file from the CISCO for that phone type.

cos no matter what i try i still got the following message

net.xjtapi.XJtapiPeer could not be instantiated.

i has increase the points hopefully you experts can give me some hints
thankyou

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


   Hi!

Does this link help : http://forum.java.sun.com/thread.jspa?threadID=469061&start=0

Regards,
   Tomas Helgi

Not help at all.
That is what I have been trying

Do i need to download SIP provider DDL in order to create an instance using jtapi??


Avatar of VenabiliVenabili🇧🇬

Most probably yes. I had not done anything with this for a while.

And you never answered my question - which implementation of jtapi are you using?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Sorry I dont quite understand the question 'which implementation of jtapi are you using"

Answer
Java

using java.sun.com example

I have checked my PC  Control Panel|Service and found one entry

Telephony - Provides telephony API (TAPI) support for progams that control telephony devices and IP based voice

My question is why i got the following error

net.xjtapi.XJtapiPeer could not be instantiated.

Avatar of VenabiliVenabili🇧🇬

JTAPI is an API. You need an implementation. Which one are you using? From the class names it seems like you use:
http://sourceforge.net/projects/xtapi/

Can you confirm?

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Yes. I 'm using sourceforge.net/projects/xtapi

I follow the info from the above link but i get the error net.xjtapi.XJtapiPeer could not be instantiated.

Do i need to install any JTAPI client software?

Avatar of VenabiliVenabili🇧🇬

Depends. :)
First - had you seen this? - http://sourceforge.net/docman/display_doc.php?docid=10406&group_id=49686
 and had you followed it? Especially the part for the provider.

Can you also tellme which example from here: http://sourceforge.net/docman/?group_id=49686 you try?

I download the sample1. from the below link

http://sourceforge.net/project/showfiles.php?group_id=49686&package_id=43589&release_id=98523

and include jtapi-1.3.1.jar in the class path

I run again and got the following error

Can't get Provider: javax.telephony.JtapiPeerUnavailableException: JtapiPeer: net.xtapi.XJtapiPeer could not be instantiated.

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


I think i choose the MSTAPI provider as we are using WindowXMP

# Newer NT Based OS’s such as Windows 2000 and XP work fine.
# You must create the provider as such to invoke the MSTAPI provider:

    * myprovider = peer.getProvider(null);


My Incall program in which I have created a log file using Log4j
========================================
public class InCall {
 
  private static CreateLog4J sLog = new CreateLog4J();
  public static final void main(String args[]) {
        /*
     * Create a provider by first obtaining the default implementation of
     * JTAPI and then the default provider of that implementation.
     */
         try {
            sLog.LaunchLogFile();
        } catch (Exception e) {
            // TODO
        }
        Provider provider = null;
    try {
      JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
      //  JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("net.xtapi.XJtapiPeer");
       
      provider = peer.getProvider(null);
    } catch (Exception excp) {
      System.out.println("Can't get Provider: " + excp.toString());
      System.exit(0);
    }

===========================================================


Now i get different errors like below

xception in thread main
java.lang.NoClassDefFoundError: org/apache/log4j/Logger
      at net.sourceforge.gjtapi.test.tapi3.Tapi3Logger.<clinit>(Tapi3Logger.java:37)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:164)
      at net.sourceforge.gjtapi.raw.tapi3.Tapi3Provider.configureLogger(Tapi3Provider.java:235)
      at net.sourceforge.gjtapi.raw.tapi3.Tapi3Provider.initialize(Tapi3Provider.java:382)
      at net.sourceforge.gjtapi.raw.ProviderFactory.initialize(ProviderFactory.java:305)
      at net.sourceforge.gjtapi.GenericJtapiPeer.getProvider(GenericJtapiPeer.java:189)
      at InCall.main(InCall.java:26)
Process exited with exit code 1.


====================================
I run the debugger, the error is caused by

provider = peer.getProvider(null);

Please advise. It seems to be getting better at least it net.xtapi.XJtapiPeer can be instantiated.



Avatar of VenabiliVenabili🇧🇬

Do you have log4j jar in your class path? This is what it complains about. :)

The classpath does include log4j.jar

That's why i dont understand


-classpath C:\jdevstudio1013\jdev\mywork\JTelephoneAppl\JTelephoneAppl\classes;
D:\Jtapi-phone\jtapi-1.3.1.jar;D:\Jtapi-phone\log4j-1.2.11.jar;
D:\Jtapi-phone\Example\sourceForge\mstapi\mstapisp.jar;
D:\Jtapi-phone\Example\sourceForge\mstapi

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of VenabiliVenabili🇧🇬

This is strange.

log4j.xml should contain basically only the log4j configuration.
How do you invoke your program?

It would be a reason but i dont know how to do it.

Have you worked on the tapi using SourceForge.net before?

I can't find the tapi3Provider.dll as the specification mentioned it before

There is nothing to install in order to use the Tapi3 provider. Just make sure that all jars
and needed props files (GenericResources.props, GenericCapabilities.props, Tapi3.props
etc.) are in your classpath and that Tapi3Provider.dll is in your java.library.path

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.




I add the below, but i got the same error:

-Dlog4j.configuration=C:\log4j.properties


Exception in thread main
java.lang.NoClassDefFoundError: org.apache.log4j.Appender

log4j.properties

log4j.rootLogger=INFO, CON
log4j.appender.CON=org.apache.log4j.ConsoleAppender
log4j.appender.CON.layout=org.apache.log4j.PatterLayout
log4j.appender.CON.layout=ConversionPattern=%-5p -%m%n


***********************************************
***   I think the problem is

log4j is failing in trying to load
the org.apache.log4j.ConsoleAppender class from the same classloader,
sun.misc.Launcher$AppClassLoader@12f6684.  This classloader, of course,
cannot be a child of both of the Junit classloaders.



It fails in loading ConsoleAppender class

Exception breakpoint occurred at line 205 of URLClassLoader.java.

Avatar of VenabiliVenabili🇧🇬

>>Have you worked on the tapi using SourceForge.net before?
Yeah - 3 years ago :)

The problem most likely is the version of the log4j or that it is simply missing ( or you have 2 of these)... :(So can you post the full line you start your programn with

As for the dll - I remember creating it. Here are some hints how: https://sourceforge.net/tracker/index.php?func=detail&aid=1578794&group_id=40963&atid=429338

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Very thanks for the hints.

I've posted two questions re this. I will give all points to you. No matter this is solved or not.
I do appricate your help

Thought you can copy the dll file, Tapi3Provider.dll

I know nothing about visual studio. We are Oracle and java developer.

Do you mind send me the dll file?

Would you please give me some hints how to find the right version of the log4j
or check if i have 2 of these files...

. would you give me the step how to create a dll? The problem is I dont have visual studio

What version of the log4j are u using ??

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of VenabiliVenabili🇧🇬

>>Do you mind send me the dll file?
Unfortunatelly I do not have it. As I said somewhere - I worked on this quite a while ago.:(

With the JTApi? I do not really remember - I do not have it installed here..I have like 7 versions in my system

Wait a second. What does the method CreateLog4J does?

Venabili

This is the one to create a log file
i really hope i can solve this problem as i have already spent alot of effort and your help

i remote the create log bean
==
to Test i use sourceForget given code

======================================================
package net.sourceforge.gjtapi.test;

import java.io.*;

import javax.telephony.callcontrol.CallControlCall;
import javax.telephony.events.*;
import javax.telephony.*;
/**
 * Simple test script for the emulator raw provider that tests if Address.addCallObserver() and
 * Address.addCallListener() are both working properly.
 * Creation date: (2000-02-03 15:40:58)
 * @author: Richard Deadman
 */
public class TestIncomingCallListenerObserver implements ConnectionListener, CallObserver {
/**
 * callActive method comment.
 */
public void callActive(javax.telephony.CallEvent event) {
    System.out.println("5.1.1: Active Call event with cause: " + this.causeToString(event.getCause()));
}
/**
 * callEventTransmissionEnded method comment.
 */
public void callEventTransmissionEnded(javax.telephony.CallEvent event) {
    System.out.println("5.1.3: Event Transmission Ended Call event with cause: " + this.causeToString(event.getCause()));
}
/**
 * callInvalid method comment.
 */
public void callInvalid(javax.telephony.CallEvent event) {
    System.out.println("5.1.2: Invalid Call event with cause: " + this.causeToString(event.getCause()));
}
/**
 * Convert the event cause string to a cause.
 * Creation date: (2000-05-01 9:58:39)
 * @author: Richard Deadman
 * @return English description of the cause
 * @param cause The Event cause id.
 */
public String causeToString(int cause) {
    switch (cause) {
        case Event.CAUSE_CALL_CANCELLED: {
            return "Call cancelled";
        }
        case Event.CAUSE_DEST_NOT_OBTAINABLE: {
            return "Destination not obtainable";
        }
        case Event.CAUSE_INCOMPATIBLE_DESTINATION: {
            return "Incompatable destination";
        }
        case Event.CAUSE_LOCKOUT: {
            return "Lockout";
        }
        case Event.CAUSE_NETWORK_CONGESTION: {
            return "Network congestion";
        }
        case Event.CAUSE_NETWORK_NOT_OBTAINABLE: {
            return "Network not obtainable";
        }
        case Event.CAUSE_NEW_CALL: {
            return "New call";
        }
        case Event.CAUSE_NORMAL: {
            return "Normal";
        }
        case Event.CAUSE_RESOURCES_NOT_AVAILABLE: {
            return "Resource not available";
        }
        case Event.CAUSE_SNAPSHOT: {
            return "Snapshot";
        }
        case Event.CAUSE_UNKNOWN: {
            return "Unknown";
        }
    }
    return "Cause mapping error: " + cause;
}
/**
 * Starts the application.
 * @param args an array of command-line arguments
 */
public static void main(java.lang.String[] args) {
    // Report error if insufficient parameters passed in
    if (args.length < 2) {
        System.err.println("Usage: java net.sourceforge.gjtapi.test.TestCallListener Provider listeningAddress");
        System.exit(1);
    }

    test(args[0], args[1]);
}
/**
 * multiCallMetaMergeEnded method comment.
 */
public void multiCallMetaMergeEnded(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall merge ended event with cause: " + this.causeToString(event.getCause()));
}
/**
 * multiCallMetaMergeStarted method comment.
 */
public void multiCallMetaMergeStarted(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall merge started event with cause: " + this.causeToString(event.getCause()));
}
/**
 * multiCallMetaTransferEnded method comment.
 */
public void multiCallMetaTransferEnded(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall transfer ended event with cause: " + this.causeToString(event.getCause()));
}
/**
 * multiCallMetaTransferStarted method comment.
 */
public void multiCallMetaTransferStarted(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall transfer started event with cause: " + this.causeToString(event.getCause()));
}
/**
 * Prompt for user input.
 * Creation date: (2000-02-17 10:49:50)
 * @author: Richard Deadman
 */
protected static void prompt() throws IOException {
    InputStream in = System.in;

    System.out.println("Hit return to continue...");
    // wait
    in.read();
    in.skip(in.available());
}
/**
 * singleCallMetaProgressEnded method comment.
 */
public void singleCallMetaProgressEnded(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall progress ended event with cause: " + this.causeToString(event.getCause()));
}
/**
 * singleCallMetaProgressStarted method comment.
 */
public void singleCallMetaProgressStarted(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Multicall progress started event with cause: " + this.causeToString(event.getCause()));
}
/**
 * singleCallMetaSnapshotEnded method comment.
 */
public void singleCallMetaSnapshotEnded(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Singlecall snapshot ended event with cause: " + this.causeToString(event.getCause()));
}
/**
 * singleCallMetaSnapshotStarted method comment.
 */
public void singleCallMetaSnapshotStarted(javax.telephony.MetaEvent event) {
    System.out.println("X.X: Singlecall snapshot started event with cause: " + this.causeToString(event.getCause()));
}
/**
 * Performs a series of unit tests
 * @param args an array of command-line arguments
 */
public static void test(String providerName, String listeningAddr) {
    java.io.PrintStream out = System.out;

    // Get a JTAPI Peer
    JtapiPeer peer = null;
    try {
        peer = JtapiPeerFactory.getJtapiPeer("net.sourceforge.gjtapi.GenericJtapiPeer");
        out.println("1.1: Successfully loaded the JTapi Peer");
    } catch (JtapiPeerUnavailableException jpue) {
        out.println("1.1: Failed to locate Peer with the factory");
        jpue.printStackTrace();
        System.exit(1);
    }

    // Ask it for the Emulator Provider
    Provider prov = null;
    try {
        System.out.println("TestIncomingCallListenerObserver.test()-providerName:" + providerName);
        System.exit(1);
        prov = peer.getProvider(providerName);
        out.println("1.2: Successfully loaded Provider");
    } catch (ProviderUnavailableException pue) {
        out.println("1.2: Failed to load Provider");
        pue.printStackTrace();
        System.exit(1);
    }
   
    try {
        // Load the Address
        out.print("2.1: Attempting to get address...");
        Address addr = prov.getAddress(listeningAddr);
        out.println(" success.");

            TestIncomingCallListenerObserver obsListener = new TestIncomingCallListenerObserver();
            
        // assocate an observer with the Address
        out.print("1.0: Setting an observer on the address...");
        addr.addCallObserver(obsListener);
        out.println("success.");
       
        // associate a listener with the Address
        out.print("1.1: Setting a listener on the address...");
        addr.addCallListener(obsListener);
        out.println(" success.");
       
        // Notify progress
        System.out.println("Waiting for incoming calls. Press enter to shut down...");
        prompt();
        System.out.println("Provider shutting down");
        prov.shutdown();
        Thread.sleep(1000);
    } catch (Exception e) {
        out.println(" failure: " + e);
        e.printStackTrace();
    }
}
/**
 * Describe myself
 * @return a string representation of myself
 */
public String toString() {
    return "Simple test class for testing call listeners and observers on an Address";
}
      /**
       * Report old-style observer events on a call attached to the Address.
       * @see javax.telephony.CallObserver#callChangedEvent(javax.telephony.events.CallEv)
       */
      public void callChangedEvent(CallEv[] eventList) {
            String event = null;
            int id = eventList[0].getID();
            switch(id) {
                  case CallActiveEv.ID: {
                        event = "call active";
                        break;
                  }
                  case CallInvalidEv.ID: {
                        event = "call invalid";
                        break;
                  }
                  case ConnAlertingEv.ID: {
                        event = "Connection alerting";
                        break;
                  }
                  case ConnConnectedEv.ID: {
                        event = "Connection connected";
                        break;
                  }
                  case ConnCreatedEv.ID: {
                        event = "Connection created";
                        break;
                  }
                  case ConnDisconnectedEv.ID: {
                        event = "Connection disconnected";
                        break;
                  }
                  case ConnFailedEv.ID: {
                        event = "Connection failed";
                        break;
                  }
                  case ConnInProgressEv.ID: {
                        event = "Connection in progress";
                        break;
                  }
                  case ConnUnknownEv.ID: {
                        event = "Connection unknown";
                        break;
                  }
                  case TermConnActiveEv.ID: {
                        event = "Terminal Connection active";
                        break;
                  }
                  case TermConnCreatedEv.ID: {
                        event = "Terminal Connection created";
                        break;
                  }
                  case TermConnDroppedEv.ID: {
                        event = "Terminal Connection dropped";
                        break;
                  }
                  case TermConnPassiveEv.ID: {
                        event = "Terminal Connection passive";
                        break;
                  }
                  case TermConnRingingEv.ID: {
                        event = "Terminal Connection ringing";
                        break;
                  }
                  case TermConnUnknownEv.ID: {
                        event = "Terminal Connection unknown";
                        break;
                  }
                  default: event = "unknown: " + id;
            }
            System.out.println("Observer event: " + event);
      }
/**
 * connectionAlerting method comment.
 */
public void connectionAlerting(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.3: Alerting Connection event with cause: " + this.causeToString(event.getCause()));
}

/**
 * connectionConnected method comment.
 */
public void connectionConnected(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.4: Connection Connected event with cause: " + this.causeToString(event.getCause()));
    CallControlCall call = (CallControlCall)event.getCall();
    System.out.println("CallingAddress: " + call.getCallingAddress().getName());
    System.out.println("CalledAddress: " + call.getCalledAddress().getName());
}

/**
 * connectionCreated method comment.
 */
public void connectionCreated(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.1: Connection Created event with cause: " + this.causeToString(event.getCause()));
}

/**
 * connectionDisconnected method comment.
 */
public void connectionDisconnected(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.5: Connection Disconnected event with cause: " + this.causeToString(event.getCause()));
}

/**
 * connectionFailed method comment.
 */
public void connectionFailed(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.6: Connection Failed event with cause: " + this.causeToString(event.getCause()));
}

/**
 * connectionInProgress method comment.
 */
public void connectionInProgress(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.2: Connection in Progress event with cause: " + this.causeToString(event.getCause()));
}

/**
 * connectionUnknown method comment.
 */
public void connectionUnknown(javax.telephony.ConnectionEvent event) {
    System.out.println("5.3.7: Connection Unknown event with cause: " + this.causeToString(event.getCause()));
}


}
===========================================================================

you are right i think i have duplicate log4j i have removed the createJlog bean

not i got different error associated with Tapi3Provider
That's understandable as i dont have Tapi3Provider.dll

which sites i can find or how to i build one please help


Caused by: java.lang.UnsatisfiedLinkError: no Tapi3Provider in java.library.path
      at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
      at java.lang.Runtime.loadLibrary0(Runtime.java:822)
      at java.lang.System.loadLibrary(System.java:992)
      at net.sourceforge.gjtapi.raw.tapi3.Tapi3NativeImpl.<clinit>(Tapi3NativeImpl.java:45)
      ... 8 more

Free T-shirt

Get a FREE t-shirt when you ask your first question.

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of VenabiliVenabili🇧🇬

I gave you an isntruction how to build it above, And I do not think it exists built somewhere :(

So just some few hints:
- Use the 2003 Windows Platform SDK, not the newer R2
- Use Visual Studio 6
- Include the platform sdk files as the very first in
visual studio. Sequence matters.


I do not understand the above instruction at all

ASKER CERTIFIED SOLUTION
Avatar of VenabiliVenabili🇧🇬

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

Thanks Venabili.
Look like I wont be able to do it as I have no technical backgroud for building a DLL. ( No development tool as well)

Do you have any suggestion i can use such as SIP,etc?

It doesnt matter what methods we use. the most important i need to build a program to capture the incoming phone number.

Thanks

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


Avatar of VenabiliVenabili🇧🇬

I'd say that I gave him the answers of the initial questions... but a delete is also ok

Thanks Venabill. even thought it doesn't really work cos i dont know how to create the DLL ..
but very thanks for giving me all the useful info.
I was sick for a few days so I can't update.
Java

Java

--

Questions

--

Followers

Top Experts

Java is a platform-independent, object-oriented programming language and run-time environment, designed to have as few implementation dependencies as possible such that developers can write one set of code across all platforms using libraries. Most devices will not run Java natively, and require a run-time component to be installed in order to execute a Java program.