How to find out phone connected with a PC

Unanswered Question
Nov 27th, 2007

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.

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 2.5 (2 ratings)
Mike-1985 Tue, 11/27/2007 - 23:52

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.

msabir Wed, 11/28/2007 - 04:51

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

ckatene Wed, 11/28/2007 - 06:03

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

tnooning Thu, 09/11/2008 - 12:00

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


louis.engelbrecht Thu, 09/11/2008 - 12:14

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.

matthew6640 Wed, 04/17/2013 - 09:35

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?


This Discussion