XML Browser Developer’s Guide for Yealink IP Phones
82
flush();
fclose($fp);
}
}
##############################
# The above codes are fixed, please just edit the following codes according to requirement.
$xml = "the beginning of the root element in the XML object\n";
$xml . = "the child elements in the XML object\n";
$xml . = "the end of the root element in the XML object\n ";
<!--Additional XML Items may be added -->
<!--All XML Items added here construct an XML object -->
push2phone("Server IP Address, Phone IP Address ",$xml);
# replace IP address of the push XML server with ”Server IP Address”
# replace IP address of the phone with “Phone IP Address”
?>
Sample php source code:
In this example, the IP address of the push XML server is 192.168.0.112, and the server
is defined to send a XML message to the IP phone with IP address 192.168.0.150.
<?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();