cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
288
Views
0
Helpful
0
Comments
cdnadmin
Community Member
This document was generated from CDN thread

Created by: Scott Belnap on 27-02-2012 06:50:14 PM
I am trying to write an application that will get a specific call by iterating through all the calls from the provider.  My issue is everytime I call provider.getCalls() is returns null.  I've looked on the forums and haven't found much information.  The application user that I am using has been granted CTI control permission but I'm still not seeing any calls.  Any help would be greatly appreciated.  

Subject: RE: provider.getCalls()
Replied by: Mohan Potluri on 27-02-2012 06:56:34 PM
Applications can access only the calls that are on the devices in the control list. Also callobservers need to be added to all addresses or terminals that you want to observe.
 
provider.getCalls() will return the calls that are on addresses or terminals where application added callobservers. How many devices do you have in user control list and how many calls are active when application called provider.getCalls()? Check if you have callobservers. 

Subject: RE: provider.getCalls()
Replied by: Scott Belnap on 27-02-2012 07:08:17 PM
I have my testing device to the control list and have placed a call to it but I don't see the call.  So I have one device and have placed one call to that device.  Here is the logic that I have implemented.

private Call findCall(String netId) throws Exception {
  provider.addObserver(this);
  conditionInService.waitTrue();
  Terminal[] ts = provider.getTerminals();
  Terminal term = provider.getTerminals()[0];
                term.addCallObserver(this);
                term.addObserver(this);
  Call[] cs = provider.getCalls();
  return return cs[0];
}

Subject: RE: provider.getCalls()
Replied by: Mohan Potluri on 27-02-2012 07:13:43 PM
You need to wait till the terminal goes into inservice state. After that if you have calls on the terminal the call observer will start getting the events. Check the jtrace sample code. This is available in the folder where JTAPI is installed. 
calling provider.getCalls() immedeately after adding callobserver will not get you the correct calls. Add some delay after addCallObservers and retry.

Subject: RE: provider.getCalls()
Replied by: Scott Belnap on 28-02-2012 08:40:14 PM
My code now waits for the CiscoTermInServiceEv event to happen before continuing but when I call the provider.getCalls() I still don't see any calls. 

I found out that I can add a CallObserver and then just wait for the CallCtlConnEstablishedEv event and get the call that way.

Subject: RE: provider.getCalls()
Replied by: James Wagner on 29-02-2012 12:59:13 PM
I found out that I can add a CallObserver and then just wait for the CallCtlConnEstablishedEv event and get the call that way.

 
This is slightly off-topic from your original question, but believe it would help me immensely with a problem I've been working on.  Could you post a code sample of how you wait for the CallCtlConnEstablishedEv event?

Subject: RE: provider.getCalls()
Replied by: Scott Belnap on 29-02-2012 01:14:19 PM
You need to add a CallObserver to the Address object.  Then just wait for the callChangedEvent to fire.

public class MyCallObserver implements CallControlCallObserver {

public synchronized void callChangedEvent( CallEv[] eventList ){
   for ( int i = 0; i < eventList.length; i++ )
   {
                                if( eventList.getID() ==  CallCtlConnEstablishedEv.ID) {
      //do something cool here
    }
   }
        }

}
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Quick Links