New Forum system requires email address which you used to apply for your account to replace your original username. Password stays the same.Please see this post for more details
http://forum.yealink.com/forum/showthread.php?tid=40344

Yealink Test Club has been officially launched. Please visit post below to get detail information. Come and join us!
http://forum.yealink.com/forum/announcements.php?aid=18

We just had the YMCS online and we are also working on the features plan on the future versions, in this regard we are need to hear your voice about the YMCS.
Please visit : http://forum.yealink.com/forum/showthread.php?tid=42322


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Push XML on T38G
Author Message
ruffle Offline
Junior Member
**

Posts: 4
Joined: Feb 2015
Reputation: 0
Post: #1
Push XML on T38G
Hi,

I'm trying to use push XML on a T38G. Pushing a YealinkIPPhoneTextScreen works fine but pushing a YealinkIPPhoneImageScreen doesn't Sad

The XML I'm sending is:

<?xml version="1.0" encoding="UTF-8"?>
<YealinkiPPhoneImageScreen Beep="no" mode="fullscreen">
<Image>
http://192.168.1.63/axis-cgi/jpg/image.cgi
</Image>
</YealinkiPPhoneImageScreen>

The phone says 'Load Image please wait", the screen shows the line buttons on the right and just 'Exit' on the bottom line with a different background to normal. There's no image displayed though Sad

If I use the exact same xml in a XML Browser DSS key the image is displayed correctly in fullscreen mode.

The push XML is being sent by a php script copied from the Yealink manual and as I said, works with a TextScreen.

The phone's running version 38.70.23.13

Any ideas?

Also... can one push or pull images in a loop? On the Snom 870's we've got, the idle screen shows 1 second snapshots of the entrance camera by simply pulling the image, waiting 1 second and pulling the image again and I'd like to do this on the Yealink T38G. Can this be done?
02-06-2015 12:07 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
ModCraig Offline
Moderator
*****

Posts: 716
Joined: May 2013
Reputation: 7
Post: #2
RE: Push XML on T38G
The T38 has a screensaver mode that you can load several photos. I tried it for a time but the phones kept "running out of memory" so I reset them to factory and reprovisioned without.

Craig Reilly
MCSA, 3cx Advanced Certified
Scottsdale, AZ
02-06-2015 02:21 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
ruffle Offline
Junior Member
**

Posts: 4
Joined: Feb 2015
Reputation: 0
Post: #3
RE: Push XML on T38G
Yes... but I'm not trying to display preset photos as a screen saver. I want to push/pull stills from the office entrance camera either as a 'screen saver' when it's idle (as I do on Snom 870's) or pushed to the phone when someone comes through the door (external trigger).

If the T38G would accept a YealinkIPPhoneImageScreen from a push XML I could display one frame at least.

I notice that there is an XML Idle Screen and URL on the Account page of the T38G but turning that on and providing a URL to a TextScreen XML file seems to have no effect - the phone doesn't fetch the XML at the end of a call. Anyone got any ideas what this is for and how you use it?
02-06-2015 05:15 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #4
RE: Push XML on T38G
It seems like you have the same issue that I encountered a while ago; static images do get displayed correctly, but dynamic images don't. It took me quite a while to realize that the Yealink T38G phone needs to have the Content-Length header set or the image won't be displayed...

I solved this with a PHP script by adding the appropriate Content-Length header to the output like this:
PHP Code:
<php
$dst 
imagecreatetruecolor(480,272);
imagealphablending($dsttrue);

$src imagecreatefromjpeg("http://ipcamera/snapshot.cgi");
imagecopyresampled ($dst$src000imagesx($dst), imagesy($dst) , imagesx($src), imagesy($src));

// Yealink phone needs the Content-Length header
// Get the Image Data Length
ob_start(); // start a new output buffer
   
imagejpeg$dst""90 );
   
$ImageData ob_get_contents();
   
$ImageDataLength ob_get_length();
ob_end_clean(); // stop this output buffer

//header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($fn)).' GMT', true, 200);
header("Content-type: image/jpeg") ;
header("Content-Length: ".$ImageDataLength);
echo 
$ImageData;

// Free up memory
imagedestroy($src);
imagedestroy($dst);
?>

So you will need an intermediate script, if the camera doesn't have the Content-Length header by default. I hope this solves your problem as well. Please, let us know if it does or not Smile

Please use the reputation button below if you like this post.
(This post was last modified: 02-06-2015 10:26 PM by cptjack.)
02-06-2015 10:15 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
ruffle Offline
Junior Member
**

Posts: 4
Joined: Feb 2015
Reputation: 0
Post: #5
RE: Push XML on T38G
Thanks for that suggestion but the camera does provide the content length in the header like so:

Code:
# wget -S http://192.168.1.63/axis-cgi/jpg/image.cgi
--16:59:15--  http://192.168.1.63/axis-cgi/jpg/image.cgi
           => `image.cgi.1'
Connecting to 192.168.1.63:80... connected.
HTTP request sent, awaiting response...
  HTTP/1.0 200 OK
  Cache-Control: no-cache
  Pragma: no-cache
  Expires: Thu, 01 Dec 1994 16:00:00 GMT
  Connection: close
  Content-Type: image/jpeg
  Content-Length: 45018
Length: 45,018 (44K) [image/jpeg]

100%[========================================================>] 45,018        --.--K/s            

16:59:15 (6.51 MB/s) - `image.cgi' saved [45018/45018]

I did try passing your php script in my push XML and that had the same result as all my other attempts... a beep, the phone says "Load Image, Please Wait" but no image is displayed.

This really is quite frustrating as when using a DSS key to pull the XML with the identical link to the camera, the image gets displayed Sad
02-07-2015 01:24 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #6
RE: Push XML on T38G
OK, I did some digging in the way I set this up... and it's a chain of files.

Asterisk triggers a SIP notify message, but a push XML should work too:
Code:
Event=>yealink-xml
Content-type=>application/xml
Content=><YealinkIPPhoneExecute Beep="yes">
Content=><ExecuteItem URI="http://serverip/yealink/ipcambig.xml"/>
Content=></YealinkIPPhoneExecute>

Then the ipcambig XML file contains:
Code:
<YealinkIPPhoneImageScreen doneAction="" Beep="no" Timeout="30" LockIn="no" mode="fullscreen">
<Image horizontalAlign="right" verticalAlign="top">http://serverip/yealink/tobmp.php</Image>
</YealinkIPPhoneImageScreen>

Please use the reputation button below if you like this post.
02-07-2015 01:38 AM
Find all posts by this user    like1    dislike0 Quote this message in a reply
ruffle Offline
Junior Member
**

Posts: 4
Joined: Feb 2015
Reputation: 0
Post: #7
RE: Push XML on T38G
Aha! A Result.

Using YealinkIPPhoneExecute kind of like you did above, the image gets displayed. For the record here are the bits that work should anyone else get stuck.

The php that's used to push the XML to the phone (just run with "php <filename>" on the system you've allowed to be the push XML server in the phone's config):

Code:
<?php
function push2phone($server,$phone,$data)
{
$xml = "xml=".$data;
$post = "POST / HTTP/1.1\r\n";
$post .= "Host: $phone\r\n";
$post .= "Referer: $server\r\n";
$post .= "Connection: Keep-Alive\r\n";
$post .= "Content-Type: text/xml\r\n";
$post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
$fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);

        if($fp) {
                fputs($fp, $post.$xml);
                 flush();
                 fclose($fp);
        }
}

$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<YealinkIPPhoneExecute Beep="no">';
$xml .= '<ExecuteItem URI="http://192.168.1.1/camera/yealink-cam.xml"/>';
$xml .= '</YealinkIPPhoneExecute>';

push2phone("192.168.1.1","192.168.1.118",$xml);

?>

and the xml file (yealink-cam.xml) that the phone then pulls:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<YealinkiPPhoneImageScreen Beep="no" mode="fullscreen">
<Image>http://192.168.1.63/axis-cgi/jpg/image.cgi</Image>
</YealinkiPPhoneImageScreen>

Many thanks for suggesting YealinkIPPhoneExecute. There's obviously a bug in the T38G when pushing image screens but the above will work for my purposes.
(This post was last modified: 02-07-2015 02:45 AM by ruffle.)
02-07-2015 02:42 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cptjack Offline
Member
***

Posts: 97
Joined: Jan 2014
Reputation: 8
Post: #8
RE: Push XML on T38G
Yes, there are more 'brainteasers' like that in the firmware. It's been a while since I figured it out. But most importantly it works! Big Grin

Please use the reputation button below if you like this post.
02-07-2015 03:27 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
grawil Offline
Junior Member
**

Posts: 3
Joined: Jun 2016
Reputation: 0
Post: #9
RE: Push XML on T38G
Did you ever get this working? I'm interested in doing something similar with a T32g.
06-17-2016 07:38 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  XML Push without DSS key? testengineer 8 12,680 02-12-2018 01:16 PM
Last Post: Alibaba
  Push/Pull idle image? grawil 2 3,587 06-20-2016 10:16 AM
Last Post: grawil
  T38G File Format Error w03zd8rc 3 5,232 03-25-2016 09:52 PM
Last Post: w03zd8rc
  T38G Voice In Cutting Out Vanlon 4 8,961 12-30-2015 01:35 AM
Last Post: mujizac
  T38G Firmware zmcgoogan 1 5,351 12-08-2015 02:11 AM
Last Post: ModCraig
  Yealink T38G Hide DTMF Option carlosn 7 11,285 12-08-2015 02:05 AM
Last Post: carlosgamboa06
  [split] T38G slow and unresponsive GreenLine 12 19,342 11-07-2015 04:41 AM
Last Post: zachtate
  T38G auto-provisioing. How to clear out value of a text parameter mdu113 5 6,413 07-22-2015 06:27 AM
Last Post: cptjack
  T38G needs new firmware released JamesK 41 64,942 07-16-2015 06:12 AM
Last Post: eldorel
  T38G remote Phonebook LPSIT 2 5,554 07-14-2015 08:41 PM
Last Post: LPSIT

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication