09-07-2007 10:11 AM - edited 03-14-2019 11:25 PM
Does anyone happen to have a sample on setting up an external directory with CME - CallManager Express using xml and asp...cgi...etc that can query a xml, test file or database?
I created an XML file named services.xml that I put on a web server and pointed the services URL to.
In the services URL I have a couple items one of which is the directory. Under the directry url then points to another xml file that is named directory.xml That seems to work in the sense of now if I go to services then Directory, it will return all the entries in the xml file. But what I am trying to do is set it up so I can input the first three characters of the name and have it pull that name out of an xml or text file.
Here is what I have so far....
Services Url
url services http://192.168.61.121/services.xml
##################################
Services.xml
<?xml version="1.0"?>
<!-- File Name: services.xml -->
<CiscoIPPhoneMenu>
<Title>SERVICES</Title>
<Prompt>SELECT AN OPTION</Prompt>
<MenuItem>
<Name>DIRECTORY</Name>
<URL>http://192.168.61.121/directorylookup.xml</URL>
</MenuItem>
<MenuItem>
<Name>CUSTOMERS</Name>
<URL>http://192.168.61.121/directory.xml</URL>
</MenuItem>
<MenuItem>
<Name>Berbee</Name>
<URL>http://phone-xml.berbee.com/menu.xml</URL>
</MenuItem>
<MenuItem>
<Name>SHOW ITEM</Name>
<URL>http://192.168.0.71/lj.xml</URL>
</MenuItem>
</CiscoIPPhoneMenu>
##################################
directorylookup.xml
<?xml version="1.0"?>
<!-- File Name: directorylookup.xml -->
<CiscoIPPhoneInput>
<Title>Customer Lookup</Title>
<Prompt>Enter first letters of name</Prompt>
<URL>http://192.168.61.121/directory.xml</URL>
<InputItem>
<DisplayName>Name</DisplayName>
<QueryStringParam>DATAFLD</QueryStringParam>
<InputFlags>A</InputFlags>
<DefaultValue />
</InputItem>
</CiscoIPPhoneInput>
##################################
<?xml version="1.0"?>
<!-- File Name: Directory.xml -->
<CiscoIPPhoneDirectory>
<Title>CVE Directory</Title>
<Prompt></Prompt>
<DirectoryEntry>
<Name>Craig</Name>
<Telephone>3611</Telephone>
</DirectoryEntry>
</CiscoIPPhoneDirectory>
####################################
Solved! Go to Solution.
09-10-2007 07:08 AM
I have an Excel file wwwroot\excel\directory.xls which looks like this:
Name Number
Smith 0123456
Jones 0246810
etc.
I have a range defined as follows:
=Dalen1!$A$1:$B$213
(There are 212 entries in my directory).
The other files are stored in wwwroot.
My menu is as follows:
excel.xml is defined as follows:
excel.asp is defined as follows:
<%
Response.ContentType = "text/xml"
' Get parameter
param1 = Request.QueryString("param1")
' Set up the connection
Set oConn = Server.CreateObject("ADODB.connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\Inetpub\wwwroot\Excel\Directory.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""
' Run the SQL Query
Set RS=Server.CreateObject("ADODB.recordset")
selstr = "SELECT * FROM my_range WHERE Name LIKE '" & param1 & "%' ORDER BY Name"
RS.open selstr, oConn
' Get record count
iCount = 0
do until RS.EOF
iCount = iCount + 1
RS.movenext
Loop
If iCount > 0 Then
RS.movefirst
End If
' Create XML Directory
Response.Write ( "
Response.Write ( "
If iCount = 1 Then
Response.Write ( "
Else
Response.Write ( "
End If
'note maximum 32 entries in CiscoIPPhoneDirectory object
iLoop = 0
do until RS.EOF or iLoop = 32
iLoop = iLoop + 1
Response.Write ( "
Response.Write ( "
Response.Write ( "" )
RS.movenext
Loop
Response.Write ( "")
' Close the recordset/connection
RS.Close
Set RS = Nothing
oConn.Close
Set oConn = Nothing
%>
09-10-2007 07:08 AM
I have an Excel file wwwroot\excel\directory.xls which looks like this:
Name Number
Smith 0123456
Jones 0246810
etc.
I have a range defined as follows:
=Dalen1!$A$1:$B$213
(There are 212 entries in my directory).
The other files are stored in wwwroot.
My menu is as follows:
excel.xml is defined as follows:
excel.asp is defined as follows:
<%
Response.ContentType = "text/xml"
' Get parameter
param1 = Request.QueryString("param1")
' Set up the connection
Set oConn = Server.CreateObject("ADODB.connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\Inetpub\wwwroot\Excel\Directory.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes"""
' Run the SQL Query
Set RS=Server.CreateObject("ADODB.recordset")
selstr = "SELECT * FROM my_range WHERE Name LIKE '" & param1 & "%' ORDER BY Name"
RS.open selstr, oConn
' Get record count
iCount = 0
do until RS.EOF
iCount = iCount + 1
RS.movenext
Loop
If iCount > 0 Then
RS.movefirst
End If
' Create XML Directory
Response.Write ( "
Response.Write ( "
If iCount = 1 Then
Response.Write ( "
Else
Response.Write ( "
End If
'note maximum 32 entries in CiscoIPPhoneDirectory object
iLoop = 0
do until RS.EOF or iLoop = 32
iLoop = iLoop + 1
Response.Write ( "
Response.Write ( "
Response.Write ( "" )
RS.movenext
Loop
Response.Write ( "")
' Close the recordset/connection
RS.Close
Set RS = Nothing
oConn.Close
Set oConn = Nothing
%>
09-10-2007 06:44 PM
AWESOME.... Thanks, I will give that a shot.
Thanks again.
08-08-2010 08:45 AM
Hi julian
I'm trying your solution but I noticed that if I set the new url services or url directories I lost the default url services ( url services http:///voiceview/common/login.do ) or local directory.
I would like to preserve voiceview and local directory, and have the additional external directory
In you solution should I set url services or url directories?, is is possible to preserve the default options?
regards
11-26-2013 09:08 AM
Works like Magic
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