[cisco-voip] Retrieving device information from CISCO

Alexander Wolf Alexander.Wolf at world-direct.at
Wed Feb 1 01:39:36 EST 2006


Hi !

I use a generated .NET Proxy-Class to retrieve the information (in contrast to the AXL provisioning API the MS wsdl tool generates code from the servicability API without problems).
I traced the request from my application with Fiddler.
Be aware that the request is generated by an autogenerated class, the "xsi:type"-Attributes my be not neccesary.
As you can see I choose the SessionId as {Host}-{Timestamp}, to create something unique. Not sure if that's the proper way, but it works.

-------------------- Begin Trace -----------------------------------

The Request:

POST /soap/astsvc.dll HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.0.3705.0)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://schemas.cisco.com/ast/soap/action/#RisPort#SelectCmDevice"
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Length: 1297
Expect: 100-continue
Host: 10.1.1.18

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://schemas.cisco.com/ast/soap/" xmlns:types="http://schemas.cisco.com/ast/soap/encodedTypes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Header>
		<tns:AstHeader id="id1">
			<SessionId xsi:type="xsd:string">10.1.1.18-2006-02-01T07:16:21</SessionId>
		</tns:AstHeader>
	</soap:Header>
	<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
		<tns:SelectCmDevice>
			<CmSelectionCriteria href="#id1"/>
		</tns:SelectCmDevice>
		<tns:CmSelectionCriteria id="id1" xsi:type="tns:CmSelectionCriteria">
			<MaxReturnedDevices xsi:type="xsd:unsignedInt">4294967295</MaxReturnedDevices>
			<Class xsi:type="tns:DeviceClass">Phone</Class>
			<Model xsi:type="xsd:unsignedInt">0</Model>
			<Status xsi:type="tns:CmDevRegStat">Any</Status>
			<SelectBy xsi:type="tns:CmSelectBy">Name</SelectBy>
			<SelectItems href="#id2"/>
		</tns:CmSelectionCriteria>
		<soapenc:Array id="id2" soapenc:arrayType="tns:SelectItem[1]">
			<Item href="#id3"/>
		</soapenc:Array>
		<tns:SelectItem id="id3" xsi:type="tns:SelectItem">
			<Item xsi:type="xsd:string">SEP0015632CE38B</Item>
		</tns:SelectItem>
	</soap:Body>
</soap:Envelope>

The Response:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
	<SOAP-ENV:Body>
		<m:SelectCmDeviceResponse xmlns:m="http://schemas.cisco.com/ast/soap/">
			<SelectCmDeviceResult>
				<TotalDevicesFound>1</TotalDevicesFound>
				<CmNodes SOAP-ENC:arrayType="m:CmNode[]">
					<CmNode>
						<ReturnCode>Ok</ReturnCode>
						<Name>10.1.1.18</Name>
						<NoChange>0</NoChange>
						<CmDevices SOAP-ENC:arrayType="m:CmDevice[]">
							<CmDevice>
								<Name>SEP0015632CE38B</Name>
								<IpAddress>10.1.1.188</IpAddress>
								<DirNumber>300,240</DirNumber>
								<Class>Phone</Class>
								<Model>7</Model>
								<Product>35</Product>
								<BoxProduct>0</BoxProduct>
								<Httpd>Yes</Httpd>
								<RegistrationAttempts>0</RegistrationAttempts>
								<IsCtiControllable>1</IsCtiControllable>
								<LoginUserId>test at VSCCM12</LoginUserId>
								<Status>Registered</Status>
								<StatusReason>0</StatusReason>
								<PerfMonObject>2</PerfMonObject>
								<DChannel>0</DChannel>
								<Description>7960 II</Description>
								<H323Trunk/>
								<TimeStamp>1138717339</TimeStamp>
							</CmDevice>
						</CmDevices>
					</CmNode>
				</CmNodes>
			</SelectCmDeviceResult>
			<StateInfo>&lt;StateInfo ClusterWide=&quot;1&quot;&gt;&lt;Node Name=&quot;10.1.1.18&quot; SubsystemStartTime=&quot;1138012525&quot; StateId=&quot;64&quot; TotalItemsFound=&quot;1&quot; TotalItemsReturned=&quot;1&quot;/&gt;&lt;/StateInfo&gt;</StateInfo>
		</m:SelectCmDeviceResponse>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

-------------------- End Trace ----------------------------------- 

Hope that helps.

Regards,
Alex



> -----Ursprüngliche Nachricht-----
> Von: cisco-voip-bounces at puck.nether.net 
> [mailto:cisco-voip-bounces at puck.nether.net] Im Auftrag von 
> Andrea Cerioli
> Gesendet: Dienstag, 31. Jänner 2006 23:02
> An: cisco-voip at puck.nether.net
> Betreff: Re: [cisco-voip] Retrieving device information from CISCO
> 
> OK, I've implemented a simple system using SNMP to retrieve 
> the full phone table and direct connections to IP phones 
> verify that stored data are still current.
> The snmp query on a cluster of 3 nodes takes about 60 seconds 
> (about 1000 phones).
> 
> It works but I really don't like it very much since I still 
> have to get the full table via snmp.
> Retrieving a single phone is only possible if you know the 
> snmp index of the phone, but since I only have the MAC 
> address, I still need to search the full table of MAC 
> addresses to retrieve this index (based on the MAC) and get 
> the IP address with a single query.
> Thus, I need an snmpwalk plus an snmpget, at least.
> 
> Do I miss something?
> 
> A better solution would be via AXL Serviceability, as 
> suggested by Alex Wolf, but I'm being quite puzzled looking 
> at the documentation and I did not manage to build a valid 
> query to date (invalid request).
> A real sample code for a RisPort query for a single phone 
> will be very appreciated.
> 
> Thansk all for your help.
> 
> Andrea.
> 
> Wes Sisk wrote:
> > Yes, SNMP works great with 4.1(3)sr2.  My phone happens to 
> be instance
> > 13 so:
> > 
> > [wsisk at ws-fc snmp]$ snmpwalk -Os -c public -v 1 172.18.110.96
> > .1.3.6.1.4.1.9.9.156.1.2.1.1.15.13
> > enterprises.9.9.156.1.2.1.1.15.13 = IpAddress: 14.48.40.131 
> > [wsisk at ws-fc snmp]$ snmpwalk -Os -c public -v 1 172.18.110.96
> > .1.3.6.1.4.1.9.9.156.1.2.1.1.14.13
> > enterprises.9.9.156.1.2.1.1.14.13 = INTEGER: 1 [wsisk at ws-fc snmp]$ 
> > snmpwalk -Os -c public -v 1 172.18.110.96
> > .1.3.6.1.4.1.9.9.156.1.2.1.1.2.13
> > enterprises.9.9.156.1.2.1.1.2.13 = Hex-STRING: 00 0A 41 F9 7C C4
> > 
> > 000A.41F9.7CC4 is the MAC address of my phone.
> > 
> > /Wes
> > 
> > Wes Sisk wrote:
> > 
> >>As this is such a frequently asked question and 
> devicelistx.asp has a 
> >>finite future,  I will test as soon as I get a few minutes.  My 
> >>initial sources say:
> >>
> >>SNMP MIB
> >>ccmPhoneInetAddress -  .1.3.6.1.4.1.9.9.156.1.2.1.1.15 
> >>ccmPhoneInetAddressType -  .1.3.6.1.4.1.9.9.156.1.2.1.1.14
> >>
> >>AXL
> >>request string - listPhoneByName
> >>parameter - searchstring %
> >>
> >>/Wes
> >>
> >>On Jan 28, 2006, at 9:56 AM, Seth Call wrote:
> >>
> >>For real-time reg info, dlx is the only way.
> >>
> >>You could also use JTAPI to monitor the device, but that's 
> obviously 
> >>pretty heavy, depending on how many phones we are talking about.
> >>
> >>-----Original Message-----
> >>From: cisco-voip-bounces at puck.nether.net
> >>[mailto:cisco-voip-bounces at puck.nether.net] On Behalf Of Andrea 
> >>Cerioli
> >>Sent: Saturday, January 28, 2006 4:10 AM
> >>To: Justin Steinberg
> >>Cc: cisco-voip at puck.nether.net
> >>Subject: Re: [cisco-voip] Retrieving device information from CISCO
> >>
> >>
> >>Thanks all for the useful hints.
> >>This saved us a lot of time.
> >>
> >>I just have a last question.
> >>
> >>I've reviewed the sample application in the SDK, and it uses 
> >>DeviceListX.asp.
> >>i.e. to retrieve the IP address of a phone, it gets the 
> complete list, 
> >>loads it in a vector, then searches the phone name to 
> extract the IP 
> >>address.
> >>This looks to be the only way to do this.
> >>
> >>Unfortunately this way can be quite heavvy if you need to query the 
> >>resident http server of hundreds, or even thousands of IP Phones 
> >>independently from each other.
> >>However we can "optimize" getting the list once per a time 
> interval, 
> >>but is still an overhead and prevent us from working 
> asynchronously, I 
> >>mean we will need to build a synchronous application that 
> will batch 
> >>al operations at fixed time intervals, then get the current list at 
> >>that time, perform all batched operations, and the sleeps for next 
> >>time interval.
> >>Not very nice IMHO, but looks to be the only way out.
> >>
> >>I would have expected a smarter API, something like 
> >>GetIPPhoneRegInfoByName, using the SEP name to retrieve 
> registration 
> >>info of the phone from the callmanager.
> >>This would be a natural complement of the DeviceListX.asp report.
> >>
> >>Is there any way, perhaps undocumented, to obtain 
> regstration info for 
> >>a single IP phone at a time, or are we bound to retrieving the 
> >>complete list?
> >>
> >>Thanks in advance for your comments.
> >>
> >>Andrea
> >>
> >>Justin Steinberg wrote:
> >>  
> >>
> >>>Andrea,
> >>>
> >>>You should download the IP Phone Services SDK for ccm 
> 4.1(3).   There
> >>>is quite a few example applications that run on asp and 
> some that run
> >>>on jsp.   I've played around with several and know that 
> some have code
> >>>that query's for the phone IP.  I know the Push2Phone app 
> query's for 
> >>>IP in order to push the xml post to the phone's IP address.
> >>>
> >>>
> >>>    
> >>
> >>http://www.cisco.com/en/US/products/sw/voicesw/ps556/product
> s_programm
> >>in g_reference_guide_chapter09186a0080405759.html
> >>  
> >>
> >>>Justin
> >>>
> >>>
> >>>
> >>>    
> >>>
> >>>>Date: Thu, 26 Jan 2006 22:03:09 +0100
> >>>>From: Andrea Cerioli <cerioli at alternet.it>
> >>>>Subject: Re: [cisco-voip] Retrieving device information from CISCO
> >>>>      CallManager
> >>>>To: cisco-voip at puck.nether.net
> >>>>Message-ID: <43D9390D.7010807 at alternet.it>
> >>>>Content-Type: text/plain; charset=us-ascii; format=flowed
> >>>>
> >>>>Thanks to all for your support.
> >>>>The very ugly way is not for us, and SNMP does not return 
> this info 
> >>>>since ccmPhoneInfo.ccmPhoneTable.ccmPhoneEntry.ccmPhoneIpAddress
> >>>>looks to be always empty.
> >>>>
> >>>>THe supported SOAP interface is the one we investigated, but 
> >>>>although we are using 4.1(3) we could not find the right 
> query to do.
> >>>>We manage to extract any sort of info but not the IP address.
> >>>>
> >>>>Perhaps we don't have the greatest and latest documentation.
> >>>>Can you please point us to the right query?
> >>>>
> >>>>Thanks in advance for any further help.
> >>>>
> >>>>Andrea.
> >>>>Wes Sisk wrote:
> >>>>
> >>>>      
> >>>>
> >>>>>There are several versions of SOAP.  In CallManager 
> 4.1(3) there is 
> >>>>>a new SOAP interface that includes device registered status.
> >>>>>
> >>>>>In older versions the file
> >>>>>        
> >>
> >>http://<ip>/CCMAdmin/reports/DeviceListX.asp
> >>  
> >>
> >>>>>provides a list of almost all devices (7902/05/12, ATA, and a few
> >>>>>        
> >>
> >>other
> >>  
> >>
> >>>>>devices excluded), their registration status, and IP.
> >>>>>
> >>>>>The very ugly way to retrieve the data is via unofficial 
> >>>>>unsupported mmfspy from cmd prompt on the CM server.
> >>>>>
> >>>>>The AXL/SOAP interface is the officially supported interface for 
> >>>>>all versions going forward.
> >>>>>
> >>>>>/Wes
> >>>>>
> >>>>>Andrea Cerioli wrote:
> >>>>>
> >>>>>
> >>>>>        
> >>>>>
> >>>>>>We are writing an application that need to query the 
> CallManager 
> >>>>>>to obtain the list of registered Phones, including current IP
> >>>>>>          
> >>
> >>address
> >>  
> >>
> >>>>>>for each phone.
> >>>>>>
> >>>>>>We have tried with AXL SOAP interface, and also looked 
> into the DC 
> >>>>>>directory and the SQL database, but we couldn't find this 
> >>>>>>information.
> >>>>>>We obtained plenty of information about phones, but not their IP
> >>>>>>          
> >>
> >>address.
> >>  
> >>
> >>>>>>The information must be there, since it is there in the 
> web based 
> >>>>>>administration interface ...
> >>>>>>
> >>>>>>This is driving us mad.
> >>>>>>Where are we wrong?
> >>>>>>Do we miss the right documentation? (we use the 
> publicly available
> >>>>>>          
> >>
> >>docs
> >>  
> >>
> >>>>>>on AXL SOAP from the CISCO web site).
> >>>>>>
> >>>>>>Thanks for any help (or direction to the proper place 
> to ask this 
> >>>>>>question).
> >>>>>>
> >>>>>>
> >>>>>>          
> >>>>
> >>>>--
> >>>>| Andrea Cerioli               alter.net Srl              |
> >>>>| e-mail: cerioli at alter.it     Via Attilio Ambrosini, 177 |
> >>>>| VOICE: +39-6-5405740         I-00147 Rome               |
> >>>>| FAX:   +39-6-5405883         Italy                      |
> >>>>
> >>>>
> >>>>
> >>>>      
> >>
> >>  
> > 
> > _______________________________________________
> > cisco-voip mailing list
> > cisco-voip at puck.nether.net
> > https://puck.nether.net/mailman/listinfo/cisco-voip
> 
> -- 
> | Andrea Cerioli               alter.net Srl              |
> | e-mail: cerioli at alter.it     Via Attilio Ambrosini, 177 |
> | VOICE: +39-6-5405740         I-00147 Rome               |
> | FAX:   +39-6-5405883         Italy                      |
> 
> _______________________________________________
> cisco-voip mailing list
> cisco-voip at puck.nether.net
> https://puck.nether.net/mailman/listinfo/cisco-voip
> 



More information about the cisco-voip mailing list