Showing results for 
Search instead for 
Did you mean: 

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 7


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.

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

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

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


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 );


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("" + deviceName + "&user=testuser");


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.

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?

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:

Recognize Your Peers