Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

How to find out phone connected with a PC

Is there a way to programatically find out which IP phone is connected with a given PC? We have a need where an application will be installed on each PC, but instead of having the user manually enter the information about the PC, we want auto detect the phone connected with that PC.

7 REPLIES
New Member

Re: How to find out phone connected with a PC

Why 2 topics about this?

Find some information about CDP (Cisco Discovery Protocol). Each Cisco device sends a CDP-package every minute. This package contains information about the device, including it's MAC adres.

New Member

Re: How to find out phone connected with a PC

I have seen tools that one can install on windows box to read CDP packets, but they have a GUI interface. I was wondering if there is a way to programetically get that information, like a Java based CDP reader, etc. Thanks

New Member

Re: How to find out phone connected with a PC

reading CDP in java is pretty easy, especially with jpcap, etc. The problem is, you will need to install it on every client, and java is just too heavy to be a background service. unfortunately, we need something lightweight...

New Member

Re: How to find out phone connected with a PC

have you got a example script that this can be done with?

New Member

Re: How to find out phone connected with a PC

Old topic, but if anyone is interested I played around and got something working in VS 2005/C# using SharpPcap and the PacketCDP class from an app on codeproject called Pacanal. I had to make some changes to the PacketCDP.cs code to get it to work, but if you can get that far I believe it was relatively minor. The app I made sniffed the CDP packet for the phone devicename and then used that to call a CUAE app to log a phone into extension mobility. Here's some partial code:

PcapDeviceList devices = SharpPcap.GetAllDevices();

PcapDevice device = devices[i];

device.PcapOnPacketArrival += new SharpPcap.PacketArrivalEvent( device_PcapOnPacketArrival );

device.PcapOpen(true, 1000);

string filter = "ether host 01:00:0c:cc:cc:cc";

device.PcapSetFilter( filter );

device.PcapStartCapture();

private static void device_PcapOnPacketArrival(object sender, Packet packet)

{

EthernetPacket eth = (EthernetPacket)packet;

returnbool = PacketCDP.Parser(myTreeNode.Nodes, eth.Data, index, LItem, ref deviceName);

HttpWebRequest request = (HttpWebRequest)

WebRequest.Create("http://10.10.50.75:8000/emLogin?phone=" + deviceName + "&user=testuser");

}

New Member

Re: How to find out phone connected with a PC

whats the chances that you can email me a copy of all the files in a zip file? and the easiest way to execute it.

i tried to use a cdpr.exe that someone edited, but it doesnt work on vista and this is a little bit of an issue for us.

New Member

How to find out phone connected with a PC

I know this is an old post, but I am trying to do something very similar.  Would it be possibe to see your code from the PacketCDP class?

559
Views
5
Helpful
7
Replies
CreatePlease to create content