This document was generated from CDN thread
Created by: Rami Abbas on 14-07-2009 08:33:24 AM
Hi
I am new at jtapi and i'm trying to develop an application in order to get the active calls
The problem is that after the provider is "successfuly"created via the CallerInfoServer, i am receiveing the follwing error " com.cisco.jtapi.PlatformExceptionImpl Terminal Restricted"
when i'm trying to acces the terminals. In fact, i guess i'm doing it wrong :
CallerInfoServer infoServer = CallerInfoServer.getCallerInfoServer(callManager, jtapiUserId, jtapiPassword, noticetodisplay);
Provider p = null;
Terminal[] terminal;
try {
terminal = p.getTerminals();
System.out.println("Terminals");
} catch (ResourceUnavailableException ex) {
Logger.getLogger(ActiveCall.class.getName()).log(Level.SEVERE, null, ex);
}
Can anyone help me please???
Txs a lot!
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Anitha V on 14-07-2009 02:04:41 PM
Hi Rami,
Could you please check whether 'CTI controllable' is checked or not? We need to certainly look into the JTAPI logs to find out why the terminals are restricted?
Could you please let us know what phones are you using? If you are using RT or Goped phones then there are various checks and conditions where these might get restricted.
Thanks and Regards,
Anitha
Cisco Developer Services
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Rami Abbas on 15-07-2009 06:24:27 AM
Hi anitha!
Txs a lot for your answer but i tried this morning to recompile it and it worked (i didn't get the erroe" terminal restricted") alone without doing anything...
But i still have one problem, after i get connected with the call manager, i need to get all the devices names through the method ".getTerminals()" in order to use its return as an argument to the method ".getActiveCallPartyNumbers(phone name)".
This is what i'm trying to do to get the phone names, i guess it is wrong... but i'm new a t jtapi and i didn't find how to do it in the "jtapi classes and interfaces" book.
CallerInfoServer infoServer = CallerInfoServer.getCallerInfoServer(callManager, jtapiUserId, jtapiPassword, noticetodisplay);
Provider p = null;
try {
p = JtapiPeerFactory.getJtapiPeer("test").getProvider("test");
} catch (JtapiPeerUnavailableException ex) {
Logger.getLogger(ActiveCall.class.getName()).log(Level.SEVERE, null, ex);
}
Terminal[] terminal;
try {
terminal = p.getTerminals();
} catch (ResourceUnavailableException ex) {
Logger.getLogger(ActiveCall.class.getName()).log(Level.SEVERE, null, ex);
}
Txs a lot in advance for any help you provide.
Best Regards
Rami
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Anitha V on 15-07-2009 07:02:23 AM
Hi Rami,
You need to pass the server info and the user credentials in .getProvider.
Could you please try this?
Thanks and Regards,
Anitha
Cisco Developer Services
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Rami Abbas on 15-07-2009 10:03:52 AM
Hi Anitha,
I did what you told me and it works... butt Sorry to bother you again, but i have a new problem. When i'm using getTerminals(); i am having the "nullpointerexception"...
I made sure that my jtapi use has control over all the phones and the provider is being created...
I even rebooted the CCM and tried to check with a specific device through the method getTerminal("phone name")...
I don't know what to do anymore... I'm pretty sure that my code is correct this time...
CallerInfoServer infoServer = CallerInfoServer.getCallerInfoServer(callManager, jtapiUserId, jtapiPassword, noticetodisplay);
Provider p = null;
try {
p = JtapiPeerFactory.getJtapiPeer(null).getProvider("ccmlab;login=acmichele;passwd=activecall;appinfo=CiscoSoftphone");
} catch (JtapiPeerUnavailableException ex) {
Logger.getLogger(ActiveCall.class.getName()).log(Level.SEVERE, null, ex);
}
try {
Terminal [] terminal = null;
String []phoneName=null;
String [] numbers=null;
terminal=p.getTerminals();
System.out.println(terminal.length);
for(int j=0;j<terminal.length;j++)
{
phoneName =terminal.getName();
numbers =infoServer.getActiveCallPartyNumbers(phoneName );
}
System.out.println("Terminals");
} catch (ResourceUnavailableException ex) {
Logger.getLogger(ActiveCall.class.getName()).log(Level.SEVERE, null, ex);
}
And i'm getting this error:
Provider successfully opened.
CallerInfoServer successfully created and running.
Exception in thread "main" java.lang.NullPointerException
at activecalltest.ActiveCall.<init>(ActiveCall.java:44)
at activecalltest.Main.main(Main.java:15)
Txs a lot Anitha!
Regards,
Rami
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Anitha V on 15-07-2009 10:48:42 AM
Hi Rami,
This is a basic NullPinterException. Looks like, you are invoking a method on some null object.
Can you check the line number 44 in the file ActiveCall.java?
Thanks and Regards,
Anitha
Cisco Developer Services
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Rami Abbas on 15-07-2009 10:59:40 AM
This error is due to the terminal table..I can't get the terminals from the ccm...(The line 44 is when i'm calling terminal.lengh)...
Do you have any idea what can be done?
I tried to do it with a specific device name and i'm getting the error "terminal is not in the provider's domain"...although i'm sure that tje jtapi user has control ovr this phone and that this phone is well configured...
Txs for your support
Rami
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: David Staudt on 20-07-2009 03:53:38 PM
I'm not sure terminal.length is a valid property?
Things to check if an expected device is not in the domain:
- Username/password are incorrect for UCM CTI user
- IP is incorrect for CTI Manager node (or DNS issues, if using host name)
- CTI user has 'Standard CTI Secure' permission, but app isn't connecting securely (fails)
- Phone is disabled for CTI use in admin config
- Phone is 7935 configured in roll-over mode (only non-rollover mode supported)
You can attach detailed/all-types JTAPI logs which should show the reason for JTAPI connect failure and/or to confirm if the device is in the control list.
Subject: RE: com.cisco.jtapi.PlatformExceptionImpl
Replied by: Rami Abbas on 21-07-2009 06:14:19 AM
Hi David!
I've resolved the problem... I couldn't get the terminals in my domain because of the status of the provider... So it was really a nullpointerexception...
As soon as the provider was created, its status was out of service (17). So i had to made him wait for a while and then add an observer in order that its status change to in (16).
Anyway, txs a lot!
Regards,
Rami