Yealink Forums

Full Version: PUSH XML PROBLEM
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

after two sleepless nights....

I have some YEALINK T28P. Only one is with firmware 2.72.0.30 - all others are with Firmware 2.73.0.40 .

I try to use the 'push2phone' PHP script from demo files.

I changed the IP adresses.

Set up the phone to receive "Remote Control" - I tried the speciefied IP from the Server, I tried "any"...

I push the XML data via post:

The phone answers:

HTTP/1.1 200 OK
Content-Length: 0
Date: Fri, 22 May 2015 08:01:39 GMT
Server: embed httpd

...but no reactíon on any phone I try!




Key-Commands to "ConfigManApp.com" are working fine.
But XML - I have no more ideas....


Alex
Hi Alex,
Please send me the php file you used that I can test it in my side .

You can refer to below guide.
Yealink_IP_Phones_XML_Browser_Developer's_Guide_V73.rar


Best Regards!
Flora
Hi,

thanks for your reply.


This is my source code:

<?php

$xml = '<?xml version="1.0" encoding="UTF-8"?>';
$xml .= '<YealinkIPPhoneTextScreen Beep="yes">';
$xml .= '<Title>Push test</Title>';
$xml .= '<Text>This is a test for pushing text to a phone.</Text>';
$xml .= '</YealinkIPPhoneTextScreen>';

push2phone("xxx.xxx.xxx.xxx","yyy.yyy.yyy.yyy",$xml);

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, zzzz, $errno, $errstr, 5);
if($fp) {
fputs($fp, $post.$xml);
flush();
while ($r=fgets($fp)){
echo($r."<br>");
}
fclose($fp);
}
}
?>

where
xxx is the IP from my Server
yyy is the IP from my Phone
zzzz is a different port forwarded to port 80


I always get the response - I posted first.



Thanks,
Alex
Hi Alex,
I have tested T28 with the latest V73 version and configure the Push XML Server IP Address with the server's IP , please make sure it can't be left as blank or any.

<?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 = "<YealinkIPPhoneTextScreen Beep=\"yes\">\n";
$xml .= "<Title>Push test</Title>\n";
$xml .= "<Text>This is a test for pushing text to a phone.</Text>\n";
$xml .= "</YealinkIPPhoneTextScreen>\n";

push2phone("10.2.5.134","10.15.5.24",$xml);
push2phone("10.2.5.134","10.15.5.59",$xml);
push2phone("10.2.5.134","10.3.5.183",$xml);

#replace 10.2.5.134 with your Apache ip address
#replace 10.15.5.24 with your phone ip address
?>


Best Regards!
Flora
Hi,

my IP settings are correct.
And my script Looks like yours.

First of all:

I don't use port 80 - it's a different port because my server is not at our location. The feature makes only sence for us, when we can control from a central server all phones in all Offices.

I follow the Server log - and the message is correct and clear -all post datas are correct.

Our offices are located in different countries - the webserver too.



I checked the log file from the phone:

May 22 11:39:03 Log [470]: WEB <3+error > NOTE : readlan=[German]
May 22 11:39:03 Log [470]: WEB <3+error > NOTE : baklan=[1.English]
May 22 11:39:03 Log [470]: WEB <3+error > NOTE : lan=[5.German]
May 22 11:39:04 Log [470]: WEB <4+warnin> pushXML() don't have remoteIP, or ip don't match, or xmlvalue is error.

The error message is a wide choice off possible Errors....

What are the ERRORs above?


Alex
Hi,

I checked it with another Script (based on Javascript). This one works in the local system with the same IP range and under the same subnet.
Putting the script onto the Server - changing the IP's - and nothing works.

I logged the incomming post data, referer - everything is correct - but the phone will not take These values.
Reference URL's