cancel
Showing results for 
Search instead for 
Did you mean: 
cancel

MCU API

562
Views
0
Helpful
0
Comments
This document was generated from CDN thread

Created by: Jason Shaffer on 25-06-2013 08:47:16 AM
Hi Cisco Dev Peeps,

We are doing POST to our MCU and can not get any repsonse but a fault code 201.

Here is what we send:
$command = "<methodCall><methodName>participant.add</methodName></methodCall>";
$command .= "<params><param><value><struct><member><name>conferenceName</name><value><string>Test</string></value></member><member><name>participantName</name><value><string>William</string></value></member></struct></value></param></params>";
$command .= "</struct></value></param></params></methodCall>";

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://192.168.12.14/RPC2");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array("xmldoc" => $command);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);$info = curl_getinfo($ch);curl_close($ch);

Here is our error back:
SimpleXMLElement Object (  => SimpleXMLElement Object (  => SimpleXMLElement Object (  => SimpleXMLElement Object (  => Array ( [0] => SimpleXMLElement Object (  => faultCode  => SimpleXMLElement Object (  => 201 ) ) [1] => SimpleXMLElement Object (  => faultString  => SimpleXMLElement Object (  => operation failed ) ) ) ) ) ) )

Since the falut code is a generic one it's obviously hard to troubleshoot.  Its also the same error if I just open the page in the browser.

One thought is authentication, but we've tried this via URL String  http://user:passwd@ipAddress/RPC2.  User has admin privs.

Can anyone tell use what we are doing wrong?

Thanks,

-jason

Subject: RE: MCU API
Replied by: Jason Shaffer on 25-06-2013 10:26:04 AM
Well Made just a little more progress, but are now running into Auth Fault code with verified accounts creditials.

Here is what we are sending now: 
 1$request = xmlrpc_encode_request("participant.add", array("conferenceName"=>"Studio01","participantName"=>"william" ));
 2$headers = array();
 3array_push($headers,"Content-Type:text/xml");
 4array_push($headers,"Content-Length: ".strlen($request));
 5array_push($headers, '\r\n');
 6
 7$ch = curl_init();
 8curl_setopt($ch, CURLOPT_URL, "http://192.168.12.14/RPC2");
 9curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
10curl_setopt($ch, CURLOPT_USERPWD, "admin:12345");
11curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
12//curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
13curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);
14curl_setopt($ch, CURLOPT_POST, true);
15curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
16curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
17$output = curl_exec($ch);
18
19curl_close($ch);
20print_r(xmlrpc_decode($output));

MCU response is:
 1<?xml version="1.0"?>
 2<methodResponse>
 3<fault>
 4<value>
 5<struct>
 6<member>
 7<name>faultCode</name>
 8<value>
 9<int>14</int>
10</value>
11</member>
12<member>
13<name>faultString</name>
14<value>
15<string>authorization failed</string>
16</value>
17</member>
18</struct>
19</value>
20</fault>
21</methodResponse>


From the log:
479  10:16:50.565   API Warning  unable to handle XML RPC request participant.add from 192.168.14.5:60979 - invalid user / password

Is there anything special that has to be done to the API user?

Thanks!

Subject: RE: MCU API
Replied by: Thomas Bonhomme on 25-06-2013 11:11:05 AM
Hi Jason,

Have a look at the doc, page 7 :
The controlling application must authenticate itself to the MCU. Also, because the interface is stateless, every call must contain authentication parameters.

http://www.cisco.com/en/US/docs/telepresence/infrastructure/mcu/api_guide/MCU_API_2-9.pdf

Happy coding!
Thomas

Subject: RE: MCU API
Replied by: Jason Shaffer on 25-06-2013 01:23:38 PM
Hi Thomas,

Thanks for the prompt response.  Duh, so the Auth is XML Params, not HTTP Auth...  Not sure how we missed that one.  BTW, it's working now.  =)

Since the Auth is sent in CLEAR TEXT, is the only way to do HTTPS is via encryption key?

Thanks,

-jason




Subject: RE: MCU API
Replied by: Thomas Bonhomme on 25-06-2013 03:29:40 PM
Glad this is now working and yeah, you need either the Secure management (HTTPS) or Encryption key to get https enabled. Check with your Cisco Rep. but I believe those keys are free of charge.