cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1427
Views
0
Helpful
6
Replies

updatePhone with php

florianwolf1
Level 1
Level 1

Hi!

I'm trying to update the e164Mask for my phone by using the function updatePhone. Getting information from my CUCM-Server is no problem but update doesn't throw errors and doesn't work.

I use php to do this:

<?php
        $client = new SoapClient("[Server-IP]/AXLAPI.wsdl",
                array('trace' => 1,
                      'exceptions' => true,
                      'cahe_wsdl' => WSDL_CACHE_NONE,
                      'location' => "https://[CUCM server]/axl",
                      'login' => '[username]',
                      'password' => '[password]'));      

        //Uebermittelte Rufnummer aendern

        $telefonname = [SEP....];
        $neuenummer = '+491234567890';
        $update = $client->updatePhone(array('name'=>$telefonname));
        $update->return->lines->line->e164Mask = $neuenummer;
        echo("getPhone-Infos: ".$response->return->phone->lines->line->e164Mask)."<br>";
?>

The last getPhone is still showing the old e164Mask.

Could anybody tell me what's going wrong here?

Reading information is no problem.

Regards

Florian

1 Accepted Solution

Accepted Solutions

Florian,

The update needs to be within the form of the following.

<updatePhone>

<name>SEP</name>

<lines>

<line>

<index>1</index>

<dirn>

<pattern>1010</pattern>

</dirn>

<e164Mask>+491234567890</e164Mask>

</line>

</lines>

</updatePhone>

Please note, when getting the phone, you need to get the line index (If it's more than one DN assigned), dn pattern so that you can update to the correct DN with that e164Mask.

Then in php, you update with the array look like this

$line = array("line"=>array("index"=>"1","dirn"=>array("pattern"=>"1010"),"e164Mask"=>"+491234567890"));

$response = $client->updatePhone(array("name"=>"SEP","lines"=>$line));

Hope this help

Howard

View solution in original post

6 Replies 6

tinghche
Level 5
Level 5

Hi Florian,

Could you please provide the details SOAP request/response here? What was the response code when updatephone?

Thanks,

Howard

Hi Howard,

the var_dump($update) shows the following:

object(stdClass)#2 (1) { ["return"]=> string(38) "{3EB18A3E-4DC5-96D0-591F-21611CD5710E}" } getPhone-Infos: +49123456789123

The apache error_log has no entries for this request.

Regards

Florian

Florian,

The update needs to be within the form of the following.

<updatePhone>

<name>SEP</name>

<lines>

<line>

<index>1</index>

<dirn>

<pattern>1010</pattern>

</dirn>

<e164Mask>+491234567890</e164Mask>

</line>

</lines>

</updatePhone>

Please note, when getting the phone, you need to get the line index (If it's more than one DN assigned), dn pattern so that you can update to the correct DN with that e164Mask.

Then in php, you update with the array look like this

$line = array("line"=>array("index"=>"1","dirn"=>array("pattern"=>"1010"),"e164Mask"=>"+491234567890"));

$response = $client->updatePhone(array("name"=>"SEP","lines"=>$line));

Hope this help

Howard

Hi Howard!

Thank you very much for your help!

Now I'm able to update the e164Mask. The missing jigsaw piece was $line variable.

Regards

Florian

This no longer works in AXL 10.5.  Any idea why?

dstaudt
Cisco Employee
Cisco Employee

This kind of operation will require a couple of steps.  Working backwards, the final step will be an updatePhone request, which request will need to provide a complete <lines> object specifying the lines (and their attributes, such as e164Mask) to be populated on the phone.

In order to provide a complete updated <lines> object for an existing phone, you will first need to retrieve the existing info about the lines from AXL via getPhone request.  This will give you a $lines object which you can manipulate/update - e.g. setting the e164 Mask.  Once updated, the updatePhone request can be called, including the updated lines object as part of the request.

Looking at your sample code above, this line executes an updatePhone, but since only the search field 'name' is specified (no updated contents - i.e. lines or anything else - are provided), nothing is done:

$update = $client->updatePhone(array('name'=>$telefonname));

This line of code does not work,

$update->return->lines->line->e164Mask = $neuenummer;

since the object returned by updatePhone is only a representation of an XML result like this:

<return>{A676D60D-47A2-0C63-E01B-47E7F649A11A}</return>

It has no return->lines->line members.