Re: GJTAPI and JTAPI
Malyshev Michael <[email protected]>
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <[email protected]> |
Try to use JDK 1.4 and above -----Original Message----- From: Ian Lin [mailto:[email protected]] Sent: Wednesday, November 03, 2004 7:15 PM To: [email protected] Subject: [JTAPI] GJTAPI and JTAPI Hi all: I am new for JTAPI and GJTAPI, I got the sample code from http://java.sun.com/products/jtapi/jtapi-1.2/Overview.html And according to some search result from http://sourceforge.net/forum/forum.php?thread_id=1068830&forum_id=131056 , so I modify the JtapiPeerFactory.getJtapiPeer(null) to JtapiPeerFactory.getJtapiPeer("net.sourceforge.gjtapi.GenericJtapiPeer") and peer.getProvider(null) to peer.getProvider("Emulator"); Sample code is listed below: import javax.telephony.*; import javax.telephony.events.*; import MyOutCallObserver; /* * Places a telephone call from 476111 to 5551212 */ public class Outcall { 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. */ Provider myprovider = null; try { JtapiPeer peer = JtapiPeerFactory.getJtapiPeer ("net.sourceforge.gjtapi.GenericJtapiPeer"); myprovider = peer.getProvider("Emulator"); } catch (Exception excp) { System.out.println("Can't get Provider: " + excp.toString()); System.exit(0); } /* * We need to get the appropriate objects associated with the * originating side of the telephone call. We ask the Address for a list * of Terminals on it and arbitrarily choose one. */ Address origaddr = null; Terminal origterm = null; try { origaddr = myprovider.getAddress("4761111"); /* Just get some Terminal on this Address */ Terminal[] terminals = origaddr.getTerminals(); if (terminals == null) { System.out.println("No Terminals on Address."); System.exit(0); } origterm = terminals[0]; } catch (Exception excp) { // Handle exceptions; } /* * Create the telephone call object and add an observer. */ Call mycall = null; try { mycall = myprovider.createCall(); mycall.addObserver(new MyOutCallObserver()); } catch (Exception excp) { // Handle exceptions } /* * Place the telephone call. */ try { Connection c[] = mycall.connect(origterm, origaddr, "5551212"); } catch (Exception excp) { // Handle all Exceptions } } } And, I have downloaded the JTAPI class file(jtapi12-class.zip) and GJTAPI class(gjtapi-1.7.jar), then I put these two jar(jtapi.jar, gjtapi-1.7.jar) in C:\jdk1.3.1_13\lib folder. Then I compiler the source above. javac -classpath c:\jdk_1.3.13\lib\jtapi.jar;. Outcall.java Compiler is ok, then java -classpath c:\jdk_1.3.13\lib\jtapi.jar;c:\jdk_1.3.13\lib\gjtapi- 1.7.jar;. Outcall But error message displays Exception in thread "main" java.lang.UnsupportedClassVersionError: net/sourceforge/gjtapi/GenericJtapiPeer (unsupported major.minor version 48.0)............. Does anyone have the same experience with me? Or do I make something wrong? Thanks in advance for your kindly reply. Ian ======================================================================== === 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". =========================================================================== 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".