01-23-2019 08:09 AM
hi,everyone
does anybody know "How to query the IP address of the cisco IP phone through API interface via Directory Number or other parameter". thanks
Solved! Go to Solution.
01-23-2019 08:46 AM
Check out the Serviceability Risport SOAP API: https://developer.cisco.com/docs/sxml/#!risport70-api-reference
(Note the data is also available via SNMP)
01-24-2019 10:58 AM - edited 01-24-2019 10:59 AM
what you are looking for can be done using the risport api
https://developer.cisco.com/docs/sxml/#!risport70-api-reference/risport70-api-reference
below is an example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap"> <soapenv:Body> <soap:selectCmDevice> <soap:StateInfo></soap:StateInfo> <soap:CmSelectionCriteria> <soap:MaxReturnedDevices>1000</soap:MaxReturnedDevices> <soap:DeviceClass>Phone</soap:DeviceClass> <soap:Model>255</soap:Model> <soap:Status>Any</soap:Status> <soap:NodeName></soap:NodeName> <soap:SelectBy>DirNumber</soap:SelectBy> <soap:SelectItems> <soap:item> <soap:Item>999999</soap:Item> </soap:item> </soap:SelectItems> <soap:Protocol>Any</soap:Protocol> <soap:DownloadStatus>Any</soap:DownloadStatus> </soap:CmSelectionCriteria> </soap:selectCmDevice> </soapenv:Body> </soapenv:Envelope>
example response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:selectCmDeviceResponse xmlns:ns1="http://schemas.cisco.com/ast/soap"> <ns1:selectCmDeviceReturn> <ns1:SelectCmDeviceResult> <ns1:TotalDevicesFound>1</ns1:TotalDevicesFound> <ns1:CmNodes> <ns1:item> <ns1:ReturnCode>NotFound</ns1:ReturnCode> <ns1:Name>cm-sub.example.net</ns1:Name> <ns1:NoChange>false</ns1:NoChange> <ns1:CmDevices xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns1:item> <ns1:item> <ns1:ReturnCode>Ok</ns1:ReturnCode> <ns1:Name>mia-ucm-sub2.utg.uvn.net</ns1:Name> <ns1:NoChange>false</ns1:NoChange> <ns1:CmDevices> <ns1:item> <ns1:Name>SEP84B5170860A0</ns1:Name> <ns1:DirNumber>999999-Registered,3909999-Registered</ns1:DirNumber> <ns1:DeviceClass>Phone</ns1:DeviceClass> <ns1:Model>684</ns1:Model> <ns1:Product>569</ns1:Product> <ns1:BoxProduct>0</ns1:BoxProduct> <ns1:Httpd>Yes</ns1:Httpd> <ns1:RegistrationAttempts>0</ns1:RegistrationAttempts> <ns1:IsCtiControllable>true</ns1:IsCtiControllable> <ns1:LoginUserId xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:Status>Registered</ns1:Status> <ns1:StatusReason>0</ns1:StatusReason> <ns1:PerfMonObject>2</ns1:PerfMonObject> <ns1:DChannel>0</ns1:DChannel> <ns1:Description>test Phone 1</ns1:Description> <ns1:H323Trunk> <ns1:ConfigName xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:TechPrefix xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:Zone xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer1 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer2 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer3 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:AltGkList xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:ActiveGk xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:CallSignalAddr xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RasAddr xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns1:H323Trunk> <ns1:TimeStamp>1548252085</ns1:TimeStamp> <ns1:Protocol>SIP</ns1:Protocol> <ns1:NumOfLines>2</ns1:NumOfLines> <ns1:LinesStatus> <ns1:item> <ns1:DirectoryNumber>999999</ns1:DirectoryNumber> <ns1:Status>Registered</ns1:Status> </ns1:item> <ns1:item> <ns1:DirectoryNumber>3909999</ns1:DirectoryNumber> <ns1:Status>Registered</ns1:Status> </ns1:item> </ns1:LinesStatus> <ns1:ActiveLoadID>sip88xx.12-0-1SR1-1</ns1:ActiveLoadID> <ns1:InactiveLoadID>sip88xx.11-7-1-17</ns1:InactiveLoadID> <ns1:DownloadStatus>Unknown</ns1:DownloadStatus> <ns1:DownloadFailureReason xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:DownloadServer xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:IPAddress> <ns1:item> <ns1:IP>10.1.40.108</ns1:IP> <ns1:IPAddrType>ipv4</ns1:IPAddrType> <ns1:Attribute>Unknown</ns1:Attribute> </ns1:item> </ns1:IPAddress> </ns1:item> </ns1:CmDevices> </ns1:item> </ns1:CmNodes> </ns1:SelectCmDeviceResult> <ns1:StateInfo><![CDATA[<StateInfo><Node Name="cm-pub.example.com" SubsystemStartTime="1544362040" StateId="20" TotalItemsFound="0" TotalItemsReturned="0"/><Node Name="cm-sub.example.net" SubsystemStartTime="1544362054" StateId="24821" TotalItemsFound="1" TotalItemsReturned="1"/></StateInfo>]]></ns1:StateInfo> </ns1:selectCmDeviceReturn> </ns1:selectCmDeviceResponse> </soapenv:Body> </soapenv:Envelope>
01-23-2019 08:46 AM
Check out the Serviceability Risport SOAP API: https://developer.cisco.com/docs/sxml/#!risport70-api-reference
(Note the data is also available via SNMP)
01-24-2019 10:58 AM - edited 01-24-2019 10:59 AM
what you are looking for can be done using the risport api
https://developer.cisco.com/docs/sxml/#!risport70-api-reference/risport70-api-reference
below is an example request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap"> <soapenv:Body> <soap:selectCmDevice> <soap:StateInfo></soap:StateInfo> <soap:CmSelectionCriteria> <soap:MaxReturnedDevices>1000</soap:MaxReturnedDevices> <soap:DeviceClass>Phone</soap:DeviceClass> <soap:Model>255</soap:Model> <soap:Status>Any</soap:Status> <soap:NodeName></soap:NodeName> <soap:SelectBy>DirNumber</soap:SelectBy> <soap:SelectItems> <soap:item> <soap:Item>999999</soap:Item> </soap:item> </soap:SelectItems> <soap:Protocol>Any</soap:Protocol> <soap:DownloadStatus>Any</soap:DownloadStatus> </soap:CmSelectionCriteria> </soap:selectCmDevice> </soapenv:Body> </soapenv:Envelope>
example response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> <soapenv:Body> <ns1:selectCmDeviceResponse xmlns:ns1="http://schemas.cisco.com/ast/soap"> <ns1:selectCmDeviceReturn> <ns1:SelectCmDeviceResult> <ns1:TotalDevicesFound>1</ns1:TotalDevicesFound> <ns1:CmNodes> <ns1:item> <ns1:ReturnCode>NotFound</ns1:ReturnCode> <ns1:Name>cm-sub.example.net</ns1:Name> <ns1:NoChange>false</ns1:NoChange> <ns1:CmDevices xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns1:item> <ns1:item> <ns1:ReturnCode>Ok</ns1:ReturnCode> <ns1:Name>mia-ucm-sub2.utg.uvn.net</ns1:Name> <ns1:NoChange>false</ns1:NoChange> <ns1:CmDevices> <ns1:item> <ns1:Name>SEP84B5170860A0</ns1:Name> <ns1:DirNumber>999999-Registered,3909999-Registered</ns1:DirNumber> <ns1:DeviceClass>Phone</ns1:DeviceClass> <ns1:Model>684</ns1:Model> <ns1:Product>569</ns1:Product> <ns1:BoxProduct>0</ns1:BoxProduct> <ns1:Httpd>Yes</ns1:Httpd> <ns1:RegistrationAttempts>0</ns1:RegistrationAttempts> <ns1:IsCtiControllable>true</ns1:IsCtiControllable> <ns1:LoginUserId xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:Status>Registered</ns1:Status> <ns1:StatusReason>0</ns1:StatusReason> <ns1:PerfMonObject>2</ns1:PerfMonObject> <ns1:DChannel>0</ns1:DChannel> <ns1:Description>test Phone 1</ns1:Description> <ns1:H323Trunk> <ns1:ConfigName xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:TechPrefix xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:Zone xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer1 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer2 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RemoteCmServer3 xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:AltGkList xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:ActiveGk xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:CallSignalAddr xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:RasAddr xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> </ns1:H323Trunk> <ns1:TimeStamp>1548252085</ns1:TimeStamp> <ns1:Protocol>SIP</ns1:Protocol> <ns1:NumOfLines>2</ns1:NumOfLines> <ns1:LinesStatus> <ns1:item> <ns1:DirectoryNumber>999999</ns1:DirectoryNumber> <ns1:Status>Registered</ns1:Status> </ns1:item> <ns1:item> <ns1:DirectoryNumber>3909999</ns1:DirectoryNumber> <ns1:Status>Registered</ns1:Status> </ns1:item> </ns1:LinesStatus> <ns1:ActiveLoadID>sip88xx.12-0-1SR1-1</ns1:ActiveLoadID> <ns1:InactiveLoadID>sip88xx.11-7-1-17</ns1:InactiveLoadID> <ns1:DownloadStatus>Unknown</ns1:DownloadStatus> <ns1:DownloadFailureReason xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:DownloadServer xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> <ns1:IPAddress> <ns1:item> <ns1:IP>10.1.40.108</ns1:IP> <ns1:IPAddrType>ipv4</ns1:IPAddrType> <ns1:Attribute>Unknown</ns1:Attribute> </ns1:item> </ns1:IPAddress> </ns1:item> </ns1:CmDevices> </ns1:item> </ns1:CmNodes> </ns1:SelectCmDeviceResult> <ns1:StateInfo><![CDATA[<StateInfo><Node Name="cm-pub.example.com" SubsystemStartTime="1544362040" StateId="20" TotalItemsFound="0" TotalItemsReturned="0"/><Node Name="cm-sub.example.net" SubsystemStartTime="1544362054" StateId="24821" TotalItemsFound="1" TotalItemsReturned="1"/></StateInfo>]]></ns1:StateInfo> </ns1:selectCmDeviceReturn> </ns1:selectCmDeviceResponse> </soapenv:Body> </soapenv:Envelope>
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide