$hostname = '10.0.0.10'; $client = new SoapClient("https://$hostname:8443/realtimeservice/services/RisPort?wsdl", array('trace'=>true, 'exceptions'=>true, 'location'=>"https://$hostname:8443/realtimeservice/services/RisPort", 'login'=>'LOGIN', 'password'=>'PASSWORD', )); $response = $client->__getFunctions(); print_r($response);
[0] => list(SelectCmDeviceResult $SelectCmDeviceResult, string $StateInfo) SelectCmDevice(string $StateInfo, CmSelectionCriteria $CmSelectionCriteria) [1] => list(string $StateInfo, SelectCtiItemResult $SelectCtiItemResult) SelectCtiItem(string $StateInfo, CtiSelectionCriteria $CtiSelectionCriteria) [2] => ArrayOfColumnValues ExecuteCCMSQLStatement(string $ExecuteSQLInputData, ArrayOfGetColumns $GetColumns) [3] => ArrayOfServerInfo GetServerInfo(ArrayOfHosts $Hosts) [4] => list(SelectCmDeviceResultSIP $SelectCmDeviceResultSIP, string $StateInfo) SelectCmDeviceSIP(string $StateInfo, CmSelectionCriteriaSIP $CmSelectionCriteriaSIP)
// SOAP- $response = $client->getServerInfo(); print_r($response);
[HostName] => CUCM1 [os-name] => VOS [os-version] => 2.6.9-78.ELsmp [os-arch] => i386 [java-runtime-version] => 1.6.0_24-b07 [java-vm-vendor] => Sun Microsystems Inc. [call-manager-version] => 7.1.5.33900-10 [Active_Versions] => hwdata-0.146.33.EL-11 : ...
// SOAP- $items = array(); $items['SelectItem[0]']['Item'] = "501"; $items['SelectItem[1]']['Item'] = "502"; $response = $client->SelectCmDevice("", array( "SelectBy" => "DirNumber", // "Name", $items "SEPaabbccxxyyzz", .. "Status" => "Any", "SelectItems" => $items )); $devices = $response['SelectCmDeviceResult']->CmNodes[1]->CmDevices; print_r($devices);
[0] => stdClass Object ( [Name] => SEPAABBCC112233 [IpAddress] => 10.0.0.101 [DirNumber] => 501-Registered [Class] => Phone [Model] => 564 [Product] => 451 [BoxProduct] => 0 [Httpd] => Yes [RegistrationAttempts] => 0 [IsCtiControllable] => 1 [LoginUserId] => [Status] => Registered [StatusReason] => 0 [PerfMonObject] => 2 [DChannel] => 0 [Description] => 501 (Ivanov) [H323Trunk] => stdClass Object ( [ConfigName] => [TechPrefix] => [Zone] => [RemoteCmServer1] => [RemoteCmServer2] => [RemoteCmServer3] => [AltGkList] => [ActiveGk] => [CallSignalAddr] => [RasAddr] => ) [TimeStamp] => 1403127103 ) [1] => stdClass Object ( [Name] => SEPAABBCC112234 [IpAddress] => 10.0.0.102 [DirNumber] => 502-Registered [Class] => Phone [Model] => 30016 [Product] => 30041 [BoxProduct] => 0 [Httpd] => Yes [RegistrationAttempts] => 1 [IsCtiControllable] => 1 [LoginUserId] => [Status] => Registered [StatusReason] => 0 [PerfMonObject] => 2 [DChannel] => 0 [Description] => 502 (Petrov) [H323Trunk] => stdClass Object ( [ConfigName] => [TechPrefix] => [Zone] => [RemoteCmServer1] => [RemoteCmServer2] => [RemoteCmServer3] => [AltGkList] => [ActiveGk] => [CallSignalAddr] => [RasAddr] => ) [TimeStamp] => 1403531108 )
$hostname = "10.0.0.10"; $client = new SoapClient("https://$hostname:8443/perfmonservice/services/PerfmonPort?wsdl", array('trace'=>true, 'exceptions'=>true, 'location'=>"https://$hostname:8443/perfmonservice/services/PerfmonPort", 'login'=>'LOGIN', 'password'=>'PASSWORD', )); $collection = "Cisco Lines"; $response = $client->PerfmonCollectCounterData($hostname, $collection); print_r($response);
[0] => stdClass Object ( [Name] => \\10.0.0.10\Cisco Lines(12345678-abcd-dead-beef-0987654321ff:501)\Active [Value] => 0 [CStatus] => 1 ) [1] => stdClass Object ( [Name] => \\10.0.0.10\Cisco Lines(12345678-abcd-dead-beef-0987654321ff:502)\Active [Value] => 1 [CStatus] => 1 )
$response = $client->PerfmonListCounter($hostname);
admin: run sql select tabname from systables
$hostname = '10.0.0.10'; $client = new SoapClient("https://$hostname:8443/realtimeservice/services/RisPort?wsdl", array('trace'=>true, 'exceptions'=>true, 'location'=>"https://$hostname:8443/realtimeservice/services/RisPort", 'login'=>'LOGIN', 'password'=>'PASSWORD', )); $items = array(); $items[] = array('Name'=>'hlog'); $items[] = array('Name'=>'description'); $response = $client->ExecuteCCMSQLStatement("SELECT h.hlog, d.description FROM device AS d INNER JOIN devicehlogdynamic AS h ON d.pkid = h.fkdevice", $items); print_r($response);
[1] => stdClass Object ( [Name] => description [Value] => 501 (Ivanov) ) [2] => stdClass Object ( [Name] => hlog [Value] => t ) [3] => stdClass Object ( [Name] => description [Value] => 502 (Petrov) ) [4] => stdClass Object ( [Name] => hlog [Value] => f )
Source: https://habr.com/ru/post/171219/