cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
4368
Views
2
Helpful
15
Replies

updatePhone Lines not working in AXL 10.5 with PHP

nkleven
Level 4
Level 4

I have seen several threads about this issue, but I don't see any accepted solutions.  I am trying to run an updatePhones query to change things like Line Text Label on an existing phone and it's not working.  For whatever reason, php seems to parse the entire <lines></lines> element from the XML before sending it to CUCM.  Is this because it's not finding it in the wsdl?  I've tried multiple versions of schema, including 11.0 and the result is the same.

Here is a snippet of the code I'm sending:

include 'axlConnection.php';

$line = array("line"=>array("index"=>"1","label"=>$label));

$response = $client->updatePhone(array("name"=>$deviceName,"description"=>"this works","lines"=>$line));

After sending the request, I output the value of $client->__getLastRequest(); in order to look at the actual XML request, and here is what I'm getting:

<?xml version="1.0" encoding="UTF-8"?>

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.cisco.com/AXL/API/10.5">

  <SOAP-ENV:Body>

    <ns1:updatePhone>

      <name>SEP887556511A3F</name>

      <description>this works</description>

    </ns1:updatePhone>

  </SOAP-ENV:Body>

</SOAP-ENV:Envelope>

As you can see, the <lines> element is completely missing.   This is driving me crazy!  Any one else seen this before and been able to get around it?

Thanks in advance for your assistance.

Nate

1 Accepted Solution

Accepted Solutions

nkleven
Level 4
Level 4

This issue is now resolved, thanks to suggestions from Nicholas Petreley and a lot more debugging.  I peeled back the layers of the onion and made the AXL calls directly from my client rather than going through a web service I built.  I then noticed that although the <lines> tags were accepted, they were completely missing from the request.  I then moved to <addLines> and started getting an error back stating that "recordingMediaSource" was missing from the request.  For whatever reason, this field is listed as required.  I added the field and now it's working!  Luckily the "addLines" actually works like an update when you are making changes to an existing line.

To summarize...

SOLUTION: Add the "recordingMediaSource" field to the <addLines> element of the "updatePhone" operation.  The valid settings are "Gateway Preferred" or "Phone Preferred".

View solution in original post

15 Replies 15

npetrele
Cisco Employee
Cisco Employee

I have reproduced the problem here.  You're right; it ignores "lines".  It doesn't ignore "addLines", which tells me there's something unique about the "lines" identifier that's tripping it up.

I've examined the WSDL and xsd files, and I don't see any problem there.  SoapUI has no problem with the request, and it's using the same WSDL and xsd.  So I'm wondering if this is a PHP variable namespace problem.  Perhaps there's something in the PHP SOAP library that's causing the problem.

I recommend submitting this as a possible bug to the PHP developers.

Thanks for the confirmation Nicholas.  Can you think of any workarounds?  This has my development efforts at a standstill.

Also, how do I submit this as a bug?

I tried a number of workarounds, such as using a class instead of an array, but that didn't help.  I'll continue to think about it, though.  Maybe something will come to me.  I haven't tried it yet, but you might consider doing a removeLines followed by an addLines to replace the existing line with the updated line.  That's a pretty nasty workaround, but it might work. 

It's best to check to see if this has already been reported.  You can view existing bugs here:  https://bugs.php.net/

If you don't see the bug, you can submit a new bug here:  PHP :: Report - New

Thanks for your help with this.  I will update the thread with my findings.

For what it's worth, this worked for me (addLines):

$line = array("line"=>array("index"=>"2","label"=>"MyPhone","dirn"=>array("pattern"=>"3536","routePartitionName"=>""),"recordingMediaSource"=>"Gateway Preferred"));
$response = $client->updatePhone(array("name"=>"Pomeroy","addLines"=>$line));

Ok, so the question is, can we do an "addLine" to replace an existing line?  If that is possible it would be a good workaround.  Just do a getPhone to download the current line settings, make necessary changes and then re-add the line.  The only problem I see with this is that it will likely change the UUID, which could be troublesome.

Also, do you think Nusoap client could be a possible solution?

Well, I tried it, and it actually seems to work.  If you do an addLines to the index of an existing line, it modifies it, and the uuid for the line remains the same.  I'm surprised it works.  I expected an error.

Keep in mind that if you want to modify multiple lines at a time, you can't use an array for "line", since PHP can't deal with multiple elements with the same key.  You'll need to use an array of classes.  The PHP/AXL tutorial explains how to do that in "how to handle duplicate tags". 

Cisco DevNet

That's great!  I will try this tonight and mark it as solved if that works for me.  Would you be willing to send your sample code?  The piece I haven't done before is taking the results of a getPhone and then sending it to an updatePhone.

Thanks again!

I didn't code it.  I used SoapUI to test it. But since my PHP addLines worked (see sample above), there shouldn't be any problems with doing in PHP.

nkleven
Level 4
Level 4

This issue is now resolved, thanks to suggestions from Nicholas Petreley and a lot more debugging.  I peeled back the layers of the onion and made the AXL calls directly from my client rather than going through a web service I built.  I then noticed that although the <lines> tags were accepted, they were completely missing from the request.  I then moved to <addLines> and started getting an error back stating that "recordingMediaSource" was missing from the request.  For whatever reason, this field is listed as required.  I added the field and now it's working!  Luckily the "addLines" actually works like an update when you are making changes to an existing line.

To summarize...

SOLUTION: Add the "recordingMediaSource" field to the <addLines> element of the "updatePhone" operation.  The valid settings are "Gateway Preferred" or "Phone Preferred".

lcwittebol
Level 1
Level 1

I'm using python suds-jurko to send updates to CUCM so far all my scripts work fine, I cannot however update a 'deviceProfile ' with the following fields :-

'Line Text Label'

'Display (Caller ID)'

'ASCII Display (Caller ID)'  - not to be confused with the 'Alerting Name' and 'ASCII Alerting Name' which I can set

I use soapUI to initially test the results then move this to python, soapUI gives me a positive result to the request using the 'updatePhone' method as described above but the fields remain empty

so does anyone have a soapui envelope example for cucm 10.5 that I can work from

Please view the SOAP request you are sending to.

hi , thanks for replying I have actually worked out whats wrong and fixed my problem so all my scripts are now working fine.

I didn't realise that the WSDL schema was so 'broken' I've had to improvise a lot to egt any of my updates working but as I say they all work fine now

Hi,

Can you tell us please, what you changed in the WSDL schema?

Best Regards,

Marcus