File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Incall using JTAPI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Incall using JTAPI" Watch "Incall using JTAPI" New topic

Incall using JTAPI

yspl india

Joined: Aug 08, 2005
Posts: 8
I am shobana i am very new to JTAPI.I am trying to make an Incall using JTAPI for which i have installed JTAPI 1.4,JMF2.1.e and J323 engine.The erroe which i get is:

Can't get Terminal: javax.telephony.InvalidArgumentException: unknown terminal 52317702

where 52317702 is the phone no which is connected to the modem of the computer.

The source code which i have used is:

import javax.telephony.*;

* Create a provider and monitor a particular terminal for an incoming call.
public class aInCall {

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("");
myprovider = peer.getProvider("H.323 Endpoint;login=52317702");
} catch (Exception excp) {
System.out.println("Can't get Provider: " + excp.toString());

* Get the terminal we wish to monitor and add a call observer to that
* Terminal. This will place a call observer on all call which come to
* that terminal. We are assuming that Terminals are named after some
* primary telephone number on them.
try {
Terminal terminal = myprovider.getTerminal("52317702");
terminal.addCallObserver(new aInCallObserver());
} catch (Exception excp) {
System.out.println("Can't get Terminal: " + excp.toString());

class aInCallObserver implements CallObserver {

public void callChangedEvent(CallEv[] evlist) {
TerminalConnection termconn;
String name;
for (int i = 0; i < evlist.length; i++) {

if (evlist[i] instanceof TermConnEv) {
termconn = null;
name = null;

try {
TermConnEv tcev = (TermConnEv)evlist[i];
Terminal term = termconn.getTerminal();
termconn = tcev.getTerminalConnection();
name = term.getName();
} catch (Exception excp) {
// Handle exceptions.
System.out.println("Error on event "+excp);

String msg = "TerminalConnection to Terminal: " + name + " is ";

if (evlist[i].getID() == TermConnActiveEv.ID) {
System.out.println(msg + "ACTIVE");
else if (evlist[i].getID() == TermConnRingingEv.ID) {
System.out.println(msg + "RINGING");

/* Answer the telephone Call using "inner class" thread */
try {
final TerminalConnection _tc = termconn;
Runnable r = new Runnable() {
public void run(){
} catch (Exception excp){
// handle answer exceptions

Thread T = new Thread(r);
} catch (Exception excp) {
// Handle Exceptions;
} else if (evlist[i].getID() == TermConnDroppedEv.ID) {
System.out.println(msg + "DROPPED");

Please give me a solution for this i am trying to find a solution for this for past 10 days.I need to finish it within 2 days.If anybody knows the solution please drop me.Thanks in advance.


It is sorta covered in the JavaRanch Style Guide.
subject: Incall using JTAPI
It's not a secret anymore!