cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
202
Views
0
Helpful
2
Replies
Highlighted
Beginner

How to query the registration status of a SINGLE IP phone?

Hello Friends,

 

So, I am trying to use soapclient with PHP to query the status of a phone. 

I am aware that risport70 can do that, however, it does go pull all the records every time I query. 

Also, I am not seeing a method like <DeviceName> or <Name> to query.

 

Could someone help me with how to query just a single phone with its MAC address?

Below is what I am trying now,

 

 

try
    {
      $devices = $client->SelectCmDevice(array("StateInfo"=>"",
      "CmSelectionCriteria"=>array(
          "Status"=>"Any",
          "SelectBy"=>"Name",
          "SelectItems"=>"",
        )));
      echo "<pre>";
      print_r($devices);
      echo "</pre>";
    }
 
 

I appreciate your help.

 

Regards

Sanjay

2 REPLIES 2
Highlighted
Cisco Employee

Re: How to query the registration status of a SINGLE IP phone?

Essentially you want to provide an <items> array with a single <Item> with your device name - so the equivalent of this XML:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap">
   <soapenv:Header/>
   <soapenv:Body>
      <soap:selectCmDevice>
         <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:SelectBy>Name</soap:SelectBy>
            <soap:SelectItems>
               <soap:item>
                  <soap:Item>EMDSTAUDT</soap:Item>
               </soap:item>
            </soap:SelectItems>
            <soap:Protocol>Any</soap:Protocol>
            <soap:DownloadStatus>Any</soap:DownloadStatus>
         </soap:CmSelectionCriteria>
      </soap:selectCmDevice>
   </soapenv:Body>
</soapenv:Envelope>

Can't properly test at the moment, but it might look something like this in PHP:

$devices = $client->SelectCmDevice(array("StateInfo"=>"",
    "CmSelectionCriteria"=>array(
        "Status"=>"Any",
        "SelectBy"=>"Name",
        "SelectItems"=>array(
            "item"=>array(
                "Item"=>"EMDSTAUDT"
            ),
        )
    )
);
Highlighted
Cisco Employee

Re: How to query the registration status of a SINGLE IP phone?

I put together a few PHP based Serviceability API samples here...hope to collect more going forward: https://github.com/CiscoDevNet/serviceability-php-samples

CreatePlease to create content
Content for Community-Ad
FusionCharts will render here