phpcisco-axl

Understanding Cisco IP Phone's Screenshot system


Update:

I posted this question originally with the tag cisco-axl, which should explain the context of this post to anyone who knows what cisco-axl is. Not sure why it was voted to be closed and placed on hold. I will attempt to make this post clearer for the uninitiated. However, if you are not familiar with the topic, you probably should not be trying to solve the problem described (or voting to close it, for that matter).

Original Post:

I'm writing an interface that will allow users to get Cisco IP phone information and also remote control a Cisco IP phone. The screenshot utility (http://userName:password@ipAddressOfPhone/CGI/Screenshot) built into most modern Cisco IP phones is handy and I would like to use it but I'm having a hard time understanding how to pull the image of each screen. I'm writing the tool in PHP and would like to know if anyone has written anything that will pull the output from the phone and render it on a screen. And, no, using <img src http://. . .> is not an option here for two reason:

1) it doesn't work with Chrome and IE

2) it's not secure. Any help is appreciated.


Solution

  • This is a straightforward issue of connecting to the Cisco IP phone with file_get_contents, creating a temp file, and then dumping the contents from file_get_contents into the temp file;

    <?php
    
    $data = file_get_contents("http://userName:password@/CGI/Screenshot");
    $filename = tempnam("/directory", "testImage");
    file_put_contents($filename, $data);
    
    ?>