cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
235
Views
0
Helpful
1
Replies

getdeviceip() maybe there is a solution!!!

KingdomHeart
Level 1
Level 1

I finally think of a way to get a around it. It is not very efficient, but it kind of work.

what I did was I save the text from cisco devicelistx to an xml file in my computer. I wrote a function the load that xml file and parse the ip out and return it. Here is my version of getIP()

[CODE]

function getIP(phone){

var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");

var IPaddr

xmlDoc.async = "false";

xmlDoc.load("c:\\CiscoIPservices\\ASP\\includes\\devicelist.xml");

var xmlObj = xmlDoc.documentElement;

for(var i=0; i<xmlObj.childNodes.length; i++){

//look for the correct phone

if(xmlObj.childNodes(i).getAttribute("n") == phone){

//find the phone. "i" holding the position of where the phone is in the filelist

IPaddr = xmlObj.childNodes(i).getAttribute("i");

return IPaddr;

}

}

return false;

}

[/CODE]

1 Reply 1

stephan.steiner
Spotlight
Spotlight

A solution for what? You'll still have to update that XML file regularly or your getIP method returns stale data.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: