Jump to content
C4 Forums | Control4

Soap calls and 2.0


BrettB0727

Recommended Posts

I am trying to do this soap commands, and it definitely looks like they are supported pre2.0, but are they supported in 2.0 and later? I am SSHing into my controller via Terminal on my Mac.

I am trying to start with the following command:

<c4soap name="GetVersionInfo" async="False" />

But it gives me the following response:

-sh: Syntax error: newline unexpected

Anybody know what I am doing wrong?

Thanks for the help,

Brett

Link to comment
Share on other sites


What port are you connecting to?

Regular telnet / ssh into the box on the normal telnet or SSH port will give you a shell, not the C4Soap interface.

You need to connect to port 5020 or port 5021 (SSL).

RyanE

Go it, so do I connect using:

telnet root@CONTROLLERIPADDRESS:5020 ?

Link to comment
Share on other sites

As this is not documented by Control4, you're somewhat on your own.

Give you a hint, though. It's just a socket connection, not a telnet connection... i.e. there's no username, and you probably can't communicate with it via telnet, since it requires null characters (0x00 or \0) to terminate the C4Soap messages.

RyanE

Link to comment
Share on other sites

As this is not documented by Control4, you're somewhat on your own.

Give you a hint, though. It's just a socket connection, not a telnet connection... i.e. there's no username, and you probably can't communicate with it via telnet, since it requires null characters (0x00 or \0) to terminate the C4Soap messages.

RyanE

Thanks for this hints Ryan!

For anyone who is following along I wrote the following script and just executed it via terminal:

#!/usr/bin/php -q

<?php
$fp = fsockopen("192.168.29.10", 5020, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else {
$out = "<c4soap name=\"GetVersionInfo\" async=\"False\" />\0";
fwrite($fp, $out);
while (!feof($fp)) {
echo fgets($fp, 128);
}
fclose($fp);
}
?>

It yielded the following:

<c4soap name="GetVersionInfo" seq="" result="1"><versions>
<version name="Director" version="2.0.5.99233" buildtype="" builddate="Nov 24 2010" buildtime="14:35:12"/>
<version name="MediaManager" version="2.0.5.99233" buildtype="" builddate="Nov 24 2010" buildtime="13:36:35"/>
</versions>
</c4soap>

Link to comment
Share on other sites

FYI, bbcode doesn't work inside the <code> section. Your code would make a bit more sense if you removed the italics codes, and just put in an actual local network address, like 192.168.29.10...

Oops! I just told everyone my controller's IP address!

:)

RyanE

Link to comment
Share on other sites

FYI, bbcode doesn't work inside the <code> section. Your code would make a bit more sense if you removed the italics codes, and just put in an actual local network address, like 192.168.29.10...

Oops! I just told everyone my controller's IP address!

:)

RyanE

Haha you are just full of good advice!

Now my "code" is complete with Ryan's local IP address :)

Link to comment
Share on other sites

Indeed.

<c4soap name="GetVersionInfo" seq="" result="1"><versions>
<version name="Director" version="2.1.0.104929" buildtype="" builddate="Jan 18 2011" buildtime="07:43:08"/>
<version name="MediaManager" version="2.1.0.104929" buildtype="" builddate="Jan 18 2011" buildtime="06:10:22"/>
</versions>

Link to comment
Share on other sites

As this is not documented by Control4, you're somewhat on your own.

Give you a hint, though. It's just a socket connection, not a telnet connection... i.e. there's no username, and you probably can't communicate with it via telnet, since it requires null characters (0x00 or \0) to terminate the C4Soap messages.

RyanE

I've sent c4soap commands via telnet. Use [ctrl-space] to add a null byte at the end before hitting [enter] but It won't work in Windows. I guess it doesn't work in 2.0+

telnet 192.168.1.100 5020

Link to comment
Share on other sites

Should work the same to port 5020.

I don't know how specifically to send a null byte (it may differ depending on terminal program), but there's no difference between that and the PHP code posted, which I just used on 2.1 to show my version.

No, it's not close to release. I'm in internal beta, one of the first, which unfortunately, doesn't give much indication when final release will actually be.

Sorry.

RyanE

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...