cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1501
Views
5
Helpful
3
Replies

CURRI - Sample code to modify CUCM Calling number and number ?

fleclair
Cisco Employee
Cisco Employee

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

3 Replies 3

fleclair
Cisco Employee
Cisco Employee
Sorry...small mistake in the title. should read : "Calling Name and Number". Thank you.

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\">&lt;cixml version=\"1.0\"&gt;&lt;continue&gt;&lt;modify callingnumber=\"12345678\"/&gt;&lt;/continue&gt; &lt;/cixml&gt;</AttributeValue></AttributeAssignment> </Obligation></Obligations></Result> </Response>";

response.getWriter().print(strXML);
//response.setStatus(HttpServletResponse.SC_OK);

}

}

 

Regards,

Umesh

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".