07-14-2020 06:24 AM
Hi team,
Wondering if one of you would share some sample code that does the following :
Query MS AD based on a calling number, get some field like Calling name and Calling number and then replace the current CUCM fields with what we got from AD.
Would you have something in that range by any chance please ?
Many thanks...Francois
07-14-2020 06:26 AM
07-21-2020 10:00 PM
May be this will help you. You need to write JAVA Servlet which will read info from database/AD. Configure Servlet URL in CUCM -
import java.io.IOException;
import java.io.InputStream;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import org.dom4j.Document;
import org.dom4j.io.SAXReader;
import org.xml.sax.SAXException;
public class CLIModifier extends HttpServlet {
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
System.out.println("Request Received From CURRI");
response.setContentType("text/xml");//;charset=UTF-8
String strXML="<?xml encoding=\"UTF-8\" version=\"1.0\"?> <Response><Result><Decision>Permit</Decision><Obligations> <Obligation FulfillOn=\"Permit\" ObligationId=\"continue.simple\"><AttributeAssignment AttributeId=\"Route:continue.simple\"><AttributeValue DataType=\"http://www.w3.org/2001/XMLSchema#string\"><cixml version=\"1.0\"><continue><modify callingnumber=\"12345678\"/></continue> </cixml></AttributeValue></AttributeAssignment> </Obligation></Obligations></Result> </Response>";
response.getWriter().print(strXML);
//response.setStatus(HttpServletResponse.SC_OK);
}
}
Regards,
Umesh
12-18-2020 05:02 AM
Be mindful though that for internal calls, only hardphones will show that modified information. Softphones (jabber) won't.. they'll merrily show the information that was there before you started changing things with CURRI. According to the response I got on one of my cases, that's "by design".
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