Author Message
KhoaBui2
Joined: Feb 17, 2016
Messages: 7
Offline
I am using the following jtapi code to make a call and I am told 7 seconds or so is not acceptable... Is there a supported way to make a call using jtapi where I can decrease the time to create the provider? (Maybe stay logged in or something?)

public void makeCall() {
Address address = null;
Call call = null;

if (provider != null) {
try {
try {
// In order to make a call, we need to obtain an Address and
// a Terminal
// object that represent the dialing extension. In Avaya's
// implementation
// of JTAPI, there is a one-to-one relationship between the
// Terminal and
// Address objects that represent an extension number.

// create Address
address = provider.getAddress(data.getCaller());
System.out.println("Address " + data.getCaller()
+ " created successfully.\n\n");

// create Terminal
terminal = provider.getTerminal(data.getCaller());
System.out.println("Terminal " + data.getCaller()
+ " created successfully.\n\n");
} catch (Exception e) {
System.out.println("\nPlease verify that the dialing extension number is correct.\n\n");
throw (e);
}

System.out.println("Adding a callListener to the terminal.\n\n");

try {
// add calllistener to terminal
terminal.addCallListener(listener);

// create Call
call = provider.createCall();
} catch (Exception e) {
throw (e);
}

try {
// makecall by using the connect method of the Call object
System.out.println("Making call from " + data.getCaller()
+ " to " + data.getCallee() + "...\n\n");
call.connect(terminal, address, data.getCallee());
} catch (Exception e) {
System.out.println("\nPlease verify that the phone that you're " +
"dialing from is ready to initiate calls.\n\n");
throw (e);
}

} catch (Exception e) {
System.out.println("makecall() caught " + e + "\n");
System.out.println("Message: " + e.getMessage() + "\n\n");
System.exit(0);

return;
}
} else {
System.out.println("Unable to make call - provider was not created " +
"successfully.\n\n");
System.exit(0);
}
return;
}

MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
I am sorry, I do not understand your question:

o Why did you mention 7 seconds?
o You mentioned "the time to create the provider" as though you created a provider every time you make a call. However, your code snippet does not create a provider. Normal behaviour is to create a provider when the application starts up and to remain logged in - as your snippet seems to do.

Martin
KhoaBui2
Joined: Feb 17, 2016
Messages: 7
Offline
I have a c# app calling the java command line to make the call...it passes in the id, password, from_number and to_number. The 7 seconds is from logon to the makecall.

You say I should stay logged in... If I call the java from a .net application when a person selects call from Skype...how would I be able to stay logged in and pass a new to_number to the make call routine? Would I have to stay in a wait loop or something in the java to wait for a new number and then some how call that?



KhoaBui2
Joined: Feb 17, 2016
Messages: 7
Offline
Also to clarify...I have an application that hooks into Skype for click-to-call...so when a user selects a user, this application starts and places the call. So in a way it is creating the provider for the app, but when they hang up, the app ends. Do you know of a way to pass in the number from a c# program to an existing Java app that has already created the provider...so it would wait and look for a phone number and then place the call?

MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
What you are doing is going to take quite a long time for each call. I think you are 'misusing' the JTAPI client. As I said, the JTAPI application should connect to AE Services upon initialization and then, later, make calls as a response to an impulse, such as a user clicking a button.

You could implement something like the following:

1. Write a standalone JTAPI application which logs into AE Services upon startup and can then receive/send messages to/from your Skype plugin. How it communicates with your Skype plugin is up to you - it's a standard Inter Process Communication (IPS) paradigm.

2. Your Skype plugin can then send a request to the JTAPI application when it wants to make a call. It should also receive responses (and maybe events) from the JTAPI application

3. You will need to start the JTAPI application before you can make any calls. You could run it as a service or start it up when the Skype application starts.

Martin
KhoaBui2
Joined: Feb 17, 2016
Messages: 7
Offline
This is the actual makecall

public MakeCall(String args[]) {
service = new MCService(getMCData(args), this);

service.updateData(getMCData(args));
try {
service.login();
} catch (Exception e1) {
}
service.makeCall();


}

it seems to login each time...is there a way I can just call service.updateData after I login...so I can do the login and then run service.updateData for each call?
MartinFlynn
Joined: Nov 30, 2009
Messages: 1922
Online
I do not think MCService is from the JTAPI Client. You would need to consult with the owner of MCService to know what it does.

Martin
Go to:   
Mobile view