Cisco Support Community
Community Member

Does #NUMBER# or #EXTENSION# work?

Hi, I completed a fantastic project which needed the MAC address of the Cisco IP Phones accessing a Web Service through Call Manager, and with help from the forum, I found a simple way of obtaining this from the Service URL without having to spend time working with AXL.


But now I have another project which I need to find out the telephone number that is requesting the Web Service on the phone.

I'm wondering if something like #NUMBER# or #EXTENSION# will work using the ServiceURL?

Many thanks in advance,



Re: Does #NUMBER# or #EXTENSION# work?

To the best of my knowledge #DEVICENAME# is the only thing.. you can try but considering that a phone can have multiple extensions I wouldn't consider this to be likely.

A simple SQL query (sent through axl) with the device name will give you a phone's extension though.

The query would look like this:

SELECT np.dnorpattern FROM device d INNER JOIN devicenumplanmap dnmp ON dnmp.fkdevice = d.pkid INNER JOIN numplan np ON dnmp.fknumplan = np.pkid AND = 'SEP123..'

Community Member

Re: Does #NUMBER# or #EXTENSION# work?

Thanks Stephan for your response. As I don't have any development setup here I needed a solution that will work when I take it to site like the #DEVICENAME# solution.

AXL isn't something I want to spend days debugging on site, unless you can point me in the direction on a demo of call manager and a soft phone I can use?


Re: Does #NUMBER# or #EXTENSION# work?

You're writing apps without having a single phone? Okay (imagine me having my eyes in a really weird position).. I've been doing this for a bit and there are plenty of reasons why you need to test your apps in an environment matching the customer's.

I'd suggest you get in touch with the nearest Cisco Partner and look at buying the developer kit (iirc they have a set of software with some licenses now for a reduced price for developers).. and have them send you a copy of the IP Communicator for basic testing (though as I said.. nothing replaces hardphones and just today I came across another issue - and the last one I found not so long ago) where an application would act completely different on one single phone type than the rest (and both issues concerned another phone type).. so there really is no way around.

I'm unaware of any way to get a list of DNs on a phone other than using an API - it's not in DeviceListX, it's not on the phone's status page either so I wouldn't know where to look.

Community Member

Re: Does #NUMBER# or #EXTENSION# work?


Yes I really do write code without the phones - _as if_ I'd spend hundreds of £££'s on a Phone, CM and someone to commision it. The last job I handed over, was a 1000 Cisco phone solution based on that #DEVICENAME#.

I think it would really be helpful if Cisco updated the Call Manager Simulator, if only to help the Web developers.

Your SQL query looks like the thing I'm after, but could I make the query directly to Call Manager from my Web Server using a SQL connection? As I already have the SEP address from the phone, the extension number I need is only for the Web Servers need, not the Web Application on the phone?


Re: Does #NUMBER# or #EXTENSION# work?

I don't know what kind of CCM version you are working with.. with CCM4 you could change the SQL server to mixed mode authentication and then you should be able to directly connect to the SQL database. But with CCM5 that possibility is gone (and won't come back, ever). Changing to mixed mode authentication requires a restart of CallManager though but I've done that a couple of times and it's no problem.

I only have a single phone service in production that doesn't require the use of any of the CCM APIs - all others require at least one of the APIs (many even use several) and that's things Cisco simply cannot simulate. You can however run CCM on a virtual machine just fine - as a partner we even got a fully configured VM once with both CCM and IPCC Express - all you had to do is connect a phone and you were ready to go.

I'm not aware that there's any PBX maker that offers a simulator for their PBX that's really useful for development.. I've seen stuff like the CCM Sim which allows registration but that was it. Depending on the PBX maker they might offer a special program where you get VPN access to a configured box running at the maker's premises to test your apps but that's about it.

CreatePlease to create content