08-20-2004 03:24 PM - edited 03-13-2019 06:06 AM
Hi. Friends. I am just new to JTAPI. Currently, I try to get the controlled phones from a user object. However, I always get an error from the LDAP provider class. I don't know what to do now. Here is my code.
LDAPProvider ldapProv = new LDAPProvider(callmanager, username, password, 8404, "");
I just follow the document of LDAPProvider class. But in the function signature, I am not sure about the fifth parameter rootDn, so I just use "". Does anybody know what it means?? Thank you for your help very much. Have a nice weekend.
public LDAPProvider(java.lang.String ldapServer,
java.lang.String ldapUserId,
java.lang.String ldapPassword,
int ldapPort,
java.lang.String rootDn)
The details of the error is
Problem looking up name:javax.naming.CommunicationException: [LDAP: error code 2
- Protocol error]
08-22-2004 07:47 PM
Hi,
String rootDN = "o=cisco.com, ou=users";
String ldapUserId = "cn=Directory Manager, o=cisco.com";
that should do the trick..
08-23-2004 10:04 AM
Sascha:
Thank you very much for your help. According to your method, it does work for the phone name. However, I got an SAXParseException exception when I queried the phone attributes for each phone. I checked the code and can not find anything wrong. Here is my code and exception output. Any idea about it? I appreciate your help very much.
AXLProvider axlProv;
try
{
axlProv = new AXLProvider(callmanager, ccmAdmin, ccmPS);
}
catch(Exception ex)
{
System.out.println("-1 "+ex.toString());
}
Phone[] phone = null;
try
{
phone = user.getControlledPhones(ldapProv, null);
}
catch(Exception ex)
{
System.out.println("0 ex = "+ex.toString());
}
for(int i =0; i
{
try
{
phone[i].loadAttributes(axlProv, true);
}
catch(Exception ex)
{
System.out.println("1 ex = "+ex.toString());
}
Extension[] tEx = null;
try
{
tEx = phone[i].getExtensions();
}
catch(Exception ex)
{
System.out.println(" 2ex = "+ex.toString());
}
System.out.println("Phone = "+phone[i].getDeviceName());
System.out.println("tEx.length = "+tEx.length);
}
ldapUserId = cn=Directory Manager, o=cisco.com
rootDn = o=cisco.com, ou=users
sucess? true
Hello. user = jtapi
Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.
Phone = SEP00036BAACA4D
tEx.length = 0
Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.
Phone = SEP00036BAACE55
tEx.length = 0
Exception:org.xml.sax.SAXParseException: Missing whitespace before SYSTEM literal URI.
Phone = SEP000F8F1B5BC4
tEx.length = 0
08-23-2004 10:23 AM
Sascha:
For my previous post! I already solved the problem. I provide the wrong call manager user name. Thank you very much for your help.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide