cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1307
Views
2
Helpful
4
Replies

updateLine in PHP

herenyii
Level 1
Level 1

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?

4 Replies 4

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.');
}

}

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);

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}

                        )

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}

                )

        )

)

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: