« Back to How-To Articles
Using WebDialer with PHP
CUCM/WebDialer Version tested: 6.0(1)
Platform: Ubuntu 9.04, extra packages: php5, php-soap
The PHP project provides a simple SOAP handling library that makes it
fairly easy to interact with web services. The following code takes some hard-coded credentials
and profile info and exercises the WebDialer getProfileSoap and makeCallSoap requests.
Note, this example uses standard a standard HTTP (non-secure) session:
<?php
$soap = new SoapClient("https://10.88.131.131:8443/webdialer/services/WebdialerSoapService?wsdl",array(
"uri" => "urn:WebdialerSoap",
"trace" => 1,
"exceptions" => 1));
$rs = $soap->getProfileSoap(
array(
"userID"=>'dstaudt',
"password"=>'password'
),'dstaudt'
);
print_r($rs); // Returns the device info list
$rs2 = $soap->makeCallSoap(
array(
"userID"=>'dstaudt',
"password"=>'password'
),
'1000', // Destination number to be called
array(
'user'=>'dstaudt',
'deviceName'=>'SEP00070EB9C4B4',
'lineNumber'=>'0',
'supportEM'=>true,
'locale'=>'English',
'dontAutoClose'=>true,
'dontShowCallConf'=>true
)
);
print_r($rs2);
?>
The output looks like this:
stdClass Object ( [description] => Success [deviceInfoList] => Array ( [0] => stdClass Object ( [deviceName] => SEP00070EB9C4B4 [lines] => Array ( [0] => 9876 ; no partition [1] => 6666 ; no partition ) ) ) [responseCode] => 0 ) stdClass Object ( [responseCode] => 0
[responseDescription] => Success )
3099 Views