Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. And see here for current known issues.

New Member

JTAPI - Call.connect() behaviour differes when runs in Java 1.4 and 1.5

Hi all,

When I run application using two different versions of Java I get different behaviour.

This is function (make call)

private void makeCall(String from, String to) throws ResourceUnavailableException, InvalidStateException, PrivilegeViolationException, MethodNotSupportedException, InvalidPartyException, InvalidArgumentException {

Call call = provider.createCall();

System.out.println("Making cal from=" + from + ", to=" + to);

Address addr = provider.getAddress(from);

Terminal term = addr.getTerminals()[0];

try {

call.connect(term, addr, to);

System.out.println("call.connect() succeeded");

}

catch(PlatformExceptionImpl ex) {

System.out.println("Clearing connection.");

call.getConnections()[0].disconnect();

}

}

During test I call busy CTI port

When I start program using java 1.4.2.05 call.connect() does not throw exception (and I hear busy sound).

If I use Java 1.5.0.04, call.connect() throws exception and code inside exception handler clears connection (I am using 7960 phone and I could se that calls imediately disconnects)

Here is portion of log file from java 1.4:

Making cal from=1001, to=1020

call.connect() succeeded

The same test in java 1.5 gives this result:

Making cal from=1001, to=1020

Clearing connection.

Code is compiled using Java 1.4.

Does anyone know what is going on?

Zdenko

5 REPLIES
New Member

Re: JTAPI - Call.connect() behaviour differes when runs in Java

if you are seeing the string "Clearing connection" then your exception handler is being called, which means that a PlatformExceptionImpl exception must be being thrown by your call to Call.connect().

Put the following in your exception handler:

ex.printStackTrace()

the output will help you to determine what's going wrong. you could also call the getErrorName() and getErrorDescription() methods of the PlatformExceptionImpl class to get more info.

c

New Member

Re: JTAPI - Call.connect() behaviour differes when runs in Java

It is not problem that I get exception, problem is "Why I do not get exception when using Java 1.4?".

SUN says: " Write once, run everywhere".

What is inside Cisco JTAPI that forses different versions of Java to behave differently?

When I start test program I do not specify rt.jar in classpath. Each version of java will take rt.jar from its own lib folder.

Is it something in rt.jar or in jtapi.jar?

New Member

Re: JTAPI - Call.connect() behaviour differes when runs in Java

if you want to answer the question "Why I do not get exception when using Java 1.4?", a good place to start is to determine the reason for the exception you get.

New Member

Re: JTAPI - Call.connect() behaviour differes when runs in Java

I was confident that code writen in Java will behave the same way on every OS with every version os Java.

I would like to know what guys from Cisco did and same byte code executes differently on two different version of java on same OS.

Is it some problem in Java (I do not belewe) or Cisco Jtapi?

This is stack trace

com.cisco.jtapi.PlatformExceptionImpl: Could not meet post conditions of connect()

at com.cisco.jtapi.CallImpl.connect(com/cisco/jtapi/CallImpl)

at com.cisco.jtapi.CallImpl.connect(com/cisco/jtapi/CallImpl)

... user code ...

JTAPI documentation specifies connection states when calling busy number. It is as described.

Attached:

CiscoJTapi log

New Member

Re: JTAPI - Call.connect() behaviour differes when runs in Java

well, as the message says, post conditions weren't being met, but I can't see why from your code or log. I knocked up a quick makeCall program myself, and it works fine with both Java 1.4.2(07) and Java 1.5.0(02) against CCM 3.3(3).

What version of CallManager are you using?

c

1131
Views
0
Helpful
5
Replies