I am trying to run the outcall.java example and I keep getting the below error
javax.telephony.InvalidArgumentException
java.lang.NullPointerException
MyOutCallObserver.callChangedEvent
java.lang.NullPointerException
I have all the correct jar files and other files in my classpath. It complies with no problem but I just keep getting the above error. Below is the code.
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(null);
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("net.xtapi.XJtapiPeer");
//myprovider = peer.getProvider(null);
myprovider = peer.getProvider(null);
System.out.println("got provider");
} 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("0");
//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;
System.err.println( excp) ;
}
// 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
System.err.println(excp) ;
}
/*
* Place the telephone call.
*/
try {
Connection c[] = mycall.connect(origterm, origaddr, "6788939416");
} catch (Exception excp) {
System.out.println(excp.toString());
}
}
}
I wasn't sure which forum this went in so I posted it here. I have searched the web for about 2 days and there is very little information regarding xtapi errors. I have found several regarding the classpath issues which I corrected but not much else. Any help at all would be apprectiated