Get IP Addresses from AXL/SOAP

Version 1
    This document was generated from CDN thread

    Created by: JAMES DEPHILLIP II on 27-10-2010 05:55:30 PM
    I ran this script and can get all the information I need but how can I filter this PHP query to only retrieve the IP addresses of the devices? Any help would be greatly appreciated. I want to be able to execute a command on the returned items. Thanks in advance!
     
    <?php
     
    define('CUCM_SERVER_IP',  'myserver');
    define('CUCM_SERVER_PORT','8443');
    define('CUCM_AXL_USER',   'myuser');
    define('CUCM_AXL_PASS',   'mypass');
    define('CUCM_AXL_API',    '/Library/WebServer/Documents/Risport.wsdl');
     
    $client = new SoapClient(CUCM_AXL_API,
    array('trace'=>true,
    'exceptions'=>true,
    'location'=>"https://".CUCM_SERVER_IP.":".CUCM_SERVER_PORT."/realtimeservice/services/RisPort",
    'login'=>CUCM_AXL_USER,
    'password'=>CUCM_AXL_PASS));
     
    $devices = $client->SelectCmDevice(
        "",
        array(
            "SelectBy" => "Name",
            "Status" => "Registered"
        )
    );
     
    print_r($devices);
     
    ?>

    Subject: RE: Get IP Addresses from AXL/SOAP
    Replied by: David Staudt on 27-10-2010 06:32:28 PM
    Not sure what you're asking for..?  There is no way to modify what data is returned...whatever is in the schema for the return object is what you get.  If you need to execute a command on only the IP addresses, you will need to manipulate the returned XML, e.g. via PHP XML handling code.

    Subject: RE: Get IP Addresses from AXL/SOAP
    Replied by: Andrey Visotskiy on 27-01-2011 04:20:12 AM
    Here is an example to determine the ip address on number lines

    $client = new SoapClient(
        "https://ipcucm/realtimeservice/services/RisPort?wsdl",
        array(
            "login" => "login",
            "password"=> "passw",
            "trace" => true
        )
    );

    $array['SelectBy'] = "DirNumber";
    $array['Status'] = "Any";

    $array['SelectItems']['SelectItem[0]']['Item'] = "123456789";

    $devices = $client->SelectCmDevice( "", $array );

    $RegPhoneIP = array(  );
    foreach( $devices as $first){
    if( is_array($first->CmNodes) ){
    $CmNodes = $first->CmNodes;
    foreach( $CmNodes as $second){
    if( is_array($second->CmDevices) ){
    $CmDevices = $second->CmDevices;
    foreach( $CmDevices as $dev){
    echo $dev->IpAddress;
    }}}}}

    Subject: RE: Get IP Addresses from AXL/SOAP
    Replied by: Herath Mudiyanselage Kanishka Chathumal Thilakabandara on 11-04-2011 08:21:04 AM
    Thanx man!!!this is grate.This is very helpful.Thanx a lot.........