02-05-2014 06:39 AM
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
Solved! Go to Solution.
02-10-2014 01:27 PM
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
02-06-2014 02:59 PM
Hi Florian,
Could you please provide the details SOAP request/response here? What was the response code when updatephone?
Thanks,
Howard
02-06-2014 11:15 PM
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
02-10-2014 01:27 PM
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
02-11-2014 12:57 AM
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
09-11-2015 06:00 PM
This no longer works in AXL 10.5. Any idea why?
02-07-2014 01:02 PM
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.
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