11-21-2017 05:49 AM
I have tried to use the updateLine AXL API from PHP:
$line = array(
"pattern"=>"44",
"description"=>"Test 44"
);
$response = $client->updateLine($line);
echo $response;
I have got the error message:
Fatal error: Uncaught SoapFault exception: [soapenv:Server] Item not valid: The specified Directory Number was not found in C:\Cisco\updateline.php:19
What is the reason? What is the Directory Number? Can you help me?
11-23-2017 12:35 AM
Hello,
i think your Code is not complete. On my opinion is it not enough, to Redirect the Line. On our CUCM i have to set CSS too.
look at my Code:
function CallForwardto($Device,$destination) {
// Login zu CUCM einbinden
require_once("../include/connect_cucm.inc.php");// GET PHONE Sammeln von Daten wie Patter UUID und RoutPartion Name für Get LINE
try {
$response = $client->getPhone(
array(
'name' => $Device,
'returnedTags' => array(
'lines' => array(
'line' => array(
'index' => true,
'dirn' => array(
'pattern' => true,
'routePartitionName' => true
)
)
)
)
)
);
}catch (Exception $fault) {
// Telefon konnte nicht gefunden werden.
die('Telefon nicht gefunden.');
}$UUID = $response->return->phone->lines->line->dirn->uuid;
$rptName = $response->return->phone->lines->line->dirn->routePartitionName->_;
$pattern = $response->return->phone->lines->line->dirn->pattern;
//GET LINE Sammeln von Daten wie CallingSearchSpaceName, secondaryCallingSearchSpaceName etc.
try {
$responseLine = $client->getLine(
array(
'uuid' => $UUID,
'returnedTags' => array(
'pattern' => true,
'callForwardAll' => array(
'forwardToVoiceMail' => true,
'destination' => true,
'callingSearchSpaceName' => true,
'secondaryCallingSearchSpaceName' => true
)
)
)
);
}catch (Exception $fault) {
// Line konnte nicht gefunden werden.
die('Line nicht gefunden');
}
$CSS = $responseLine->return->line->callForwardAll->callingSearchSpaceName->_;
$CSS2 = $responseLine->return->line->callForwardAll->secondaryCallingSearchSpaceName->_;
$currentDestination = $responseLine->return->line->callForwardAll->destination;
// UPDATE Line mit den gesammelten Inhalten.try {
$responseUpdate = $client->updateLine(
array(
'uuid' => $UUID,
'callForwardAll' => array(
'forwardToVoiceMail' => 'false',
'destination' => trim($destination),
'callingSearchSpaceName' => $CSS,
'secondaryCallingSearchSpaceName' => $CSS2
)
)
);
echo "Telefon erfolgreich auf " . $destination . " umgeleitet!";
}catch (Exception $fault) {
// Update Line konnte nicht ausgeführt werden.
die('UpdateLinde konnte nicht ausgeführt werden.');
}
}
11-23-2017 04:27 AM
Thank you,
You are right: there are no more the error messages. But I want to modify the description and not the destination. I have tried it according to your pattern, but nothing changed.
$updateLine = array(
'uuid' => '{9207D366-E343-D85B-20F1-8C30A5255517}',
'callForwardAll' => array(
'forwardToVoiceMail' => 'false',
'description' => "Test 44",
'callingSearchSpaceName' => $CSS,
'secondaryCallingSearchSpaceName' => $CSS2
)
);
$responseUpdate = $client->updateLine($updateLine);
11-23-2017 11:38 PM
hi,
i´m only read updat Line an associated this with my Project, where i Change the Destination on Phones an Huntgroups :-)
OK.
Try this:
$updateLine = array(
'uuid' => '{9207D366-E343-D85B-20F1-8C30A5255517}',
'line' => array(
'description'=> 'Whatever'
)
);
Because, whenn you print_r the Response from SOAP API you find the right way.
stdClass Object
(
[return] => stdClass Object
(
[line] => stdClass Object
(
[pattern] => \+4961XXXXX
[description] => NAME
[usage] => Device
[routePartitionName] => stdClass Object
(
[_] => PT_Endgeraete
[uuid] => {75CAA4ED-48AD-4698-B1AB-534E986FA53F}
)
11-24-2017 02:19 AM
Hi,
I am very glad you are dealing with my problem, but the description (Konig Peter) does not change. Please look at the program:
$getline = array(
'uuid' => '{9207D366-E343-D85B-20F1-8C30A5255517}',
'returnedTags' => array(
'pattern' => true,
'description' => true,
'callForwardAll' => array(
'forwardToVoiceMail' => true,
'destination' => true,
'callingSearchSpaceName' => true,
'secondaryCallingSearchSpaceName' => true
)
)
);
$responseLine = $client->getLine($getline);
echo "\n".'getLine result'."\n"."\n"."\n";
print_r($responseLine);
$CSS = $responseLine->return->line->callForwardAll->callingSearchSpaceName->_;
$CSS2 = $responseLine->return->line->callForwardAll->secondaryCallingSearchSpaceName->_;
$currentDestination = $responseLine->return->line->callForwardAll->destination;
$updateLine = array(
'uuid' => '{9207D366-E343-D85B-20F1-8C30A5255517}',
'line' => array(
'description'=> 'Test 44'
),
'callForwardAll' => array(
'forwardToVoiceMail' => 'false',
'callingSearchSpaceName' => $CSS,
'secondaryCallingSearchSpaceName' => $CSS2
)
);
$responseUpdate = $client->updateLine($updateLine);
echo "\n".'updateLine result'."\n"."\n"."\n";
print_r($responseUpdate);
$getline = array(
'uuid' => '{9207D366-E343-D85B-20F1-8C30A5255517}',
'returnedTags' => array(
'pattern' => true,
'description' => true
)
);
$responseLine = $client->getLine($getline);
echo "\n".'getLine result'."\n"."\n"."\n";
print_r($responseLine);
And now the result:
getLine result
stdClass Object
(
[return] => stdClass Object
(
[line] => stdClass Object
(
[pattern] => 44
[description] => Konig Peter
[callForwardAll] => stdClass Object
(
[forwardToVoiceMail] => false
[callingSearchSpaceName] => stdClass Object
(
[_] => intl-css
[uuid] => {F2C211AC-19BA-76B3-9D38-1BE867CE59DD}
)
[secondaryCallingSearchSpaceName] => stdClass Object
(
[_] =>
[uuid] =>
)
[destination] =>
)
[uuid] => {9207D366-E343-D85B-20F1-8C30A5255517}
)
)
)
updateLine result
stdClass Object
(
[return] => {9207D366-E343-D85B-20F1-8C30A5255517}
)
getLine result
stdClass Object
(
[return] => stdClass Object
(
[line] => stdClass Object
(
[pattern] => 44
[description] => Konig Peter
[uuid] => {9207D366-E343-D85B-20F1-8C30A5255517}
)
)
)
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