cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
711
Views
0
Helpful
7
Replies

How to use Cisco JTAPI extension & is it possible to POST "default" screen

msycha
Level 1
Level 1

Hello,

I'm writing JTAPI application to monitor incoming calls. I'm using

JTAPI 1.4. I would like to ask how can I use Cisco Jtapi extensions

classes? If I try to use it I get compiler error about types incompatibility.

My second question is following: I have posted XML document

to the IP phone, document is displayed, all is OK . But after few

minutes I want to clear phone display to "default" screen

from my Java application. Does exist any way how to do it?

Thanks

Mirek

7 Replies 7

aquina
Level 1
Level 1

I can give you a bit of help on the second problem (I think). What I did in order to return to the "default" screen is to push "SoftKey:Exit" as the URI. Hope that helps.

The Softkey:Exit is basically a good idea, and works fine.

However it leads to another problem: What if the user opened some other screens, infos, or services in the meantime? I guess whatever was "on top" would simply be closed. Is there any way of knowing what the user is currently doing on his phone, or what kind of information or url is currently displaying on the phone, so that the app can know whether to send an exit or not?

tom.

Hi Tom,

Can u help me out. I am trying to push an XML file to the IP phone using JAVA. I am facing a typical problem. The text is not displaying on the phone while the Play: working fine.

The response object i am getting from the phone says the Request Busy in the data attribute of the ResponseItem for the xml file.

I am enclosing the java program also here

can u help me out please where it is going wrong..

Thanks in advance

Shyamal Bhowmik

The java Program

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

import java.net.*;

import java.io.*;

import java.net.PasswordAuthentication;

class pushMessage

{

public pushMessage()

{

Authenticator.setDefault (new MyAuthenticator ());

setUrlContent();

}

public void setUrlContent()

{

try {

int c;

URL hp= new URL("http:///CGI/Execute");

HttpURLConnection connection = (HttpURLConnection) hp.openConnection();

connection.setRequestMethod("POST");

connection.setDoOutput(true);

PrintWriter out = new PrintWriter(connection.getOutputStream());

// encode the message

String xml="http:///Notifier/message.xml\"/>";

System.out.println(xml);

xml=URLEncoder.encode(xml,"UTF-8");

// send the encoded message

out.println("XML="+xml);

out.close();

BufferedReader in = new BufferedReader(

new InputStreamReader(connection.getInputStream()));

String line;

while ((line = in.readLine()) != null) {

System.out.println(line);

}

in.close();

}

catch (MalformedURLException e) {

System.out.println ("Invalid URL");

} catch (IOException e) {

System.out.println ("Error reading URL");

}

}

public static void main(String args[]) throws Exception

{

pushMessage abc = new pushMessage();

}

class MyAuthenticator extends Authenticator {

protected PasswordAuthentication getPasswordAuthentication() {

String username= new String();

username="user";

String password= new String();

password="password";

char [] pwd=new char[8];

int len = password.length();

for (int i=0; i

{

pwd[i]=password.charAt(i);

}

return new PasswordAuthentication (username, pwd);

}

}

}

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

and the Response i am getting is as follows:

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

http:///Notifier/notify_naraya.xml"/>

Any help will be greatly appreciated..

I was receiving "request busy" after making a push request to a page that was unavailable (i.e. the wrong page or the server was not running) I'm not sure if that's what's going on with your problem or how long "request busy" remains, but I found that doing a hard restart on the phone fixed the problem.

A hard restart of the IP Phone helped.

Thanks a lot

Regards

Shyamal

aquina
Level 1
Level 1

I think the first problem may be related to the version of Java that you're compiling/ running with. Apparently you have to use Java 1.2 in order for the cisco jtapi stuff to compile/ run.

JTAPI should work with anything prior to Java 1.4.X.

I'm successfully using Sun's 1.3.X JDKs with all version of the 3.X callmanager.